/* Login Form - Complete & Self-Contained */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* ใช้ฟอนต์เดิม */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    
    background: #f8fafc; /* DEFAULT: สีขาว (สำหรับ Menu) */
    min-height: 100vh;
    height: 100%; /* ล็อคความสูง */
    /* *** แก้ไข: ลบ overflow: hidden !important; ออกจาก body เพื่อให้ JS ควบคุม/ Menu เลื่อนได้ *** */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.5;
    position: relative;
    transition: background 0.3s ease; 
}

/* ============================================== */
/* ***** โหมด DARK (สำหรับ Geofence Checker เท่านั้น) ***** */
/* ============================================== */

/* เปลี่ยนเป็น Dark Mode เมื่อ Geofence Checker ทำงาน (พื้นหลังดำ/ข้อความขาว) */
body.dark-mode {
    background: #0a0a0f; /* พื้นหลัง: ดำ */
}

body.dark-mode .status-card {
    background: rgba(15, 15, 20, 0.95); /* Card: ดำ */
    border: 1px solid rgba(59, 130, 246, 0.2);
}

body.dark-mode .status-card h1 {
    color: #f8fafc; /* หัวข้อ: ขาว */
}

body.dark-mode .status-card p {
    color: #94a3b8; /* คำบรรยาย: เทาอ่อน */
}

body.dark-mode .neural-node {
    background: #3b82f6; 
    opacity: 0.6;
}
body.dark-mode .ai-glow {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
}
body.dark-mode .status-icon svg {
    color: #3b82f6; 
}

/* ============================================== */
/* ***** โหมด LIGHT (สำหรับ Menu หลัก) ***** */
/* ============================================== */

/* สีเริ่มต้นของส่วนประกอบใน Light Mode */
.neural-node {
    background: #3b82f6;
    border-radius: 50%;
    opacity: 0.2; /* opacity น้อยลงใน Light Mode */
    animation: neuralPulse 4s ease-in-out infinite;
}

.status-card {
    background: #ffffff; /* Card: ขาว */
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px 32px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease; 
}

.status-card h1 {
    color: #000000; /* หัวข้อ: ดำ */
}

.status-card p {
    color: #475569; /* คำบรรยาย: เทาเข้ม */
}

.status-icon svg {
    color: #3b82f6; /* Icon สีน้ำเงิน */
}

/* (โค้ดส่วน Neural Background อื่นๆ ถูกละไว้) */

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-card {
    /* ใช้สำหรับ Modal และเป็นพื้นฐาน */
    background: rgba(15, 15, 20, 0.95); /* Default: Dark Card */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    padding: 40px 32px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease; 
}

/* --- Modal Announcement Styles --- */

.neural-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000; 
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.neural-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}
.neural-modal-content {
    background: #000; 
    border: none;
    padding: 0; 
    border-radius: 20px; 
    max-width: 90vw; 
    width: 400px;
    height: auto;
    max-height: 90vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: translateY(20px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}
.neural-modal-overlay.show .neural-modal-content {
     transform: translateY(0);
     opacity: 1;
}
.modal-close-button {
    position: fixed; 
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5); 
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    z-index: 1010; 
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close-button:hover {
    background: #fff;
    color: #000;
}
.modal-body {
    padding: 0; 
    line-height: 0; 
}
.modal-body img {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain; 
    border-radius: 20px; 
    margin-top: 0;
}
.login-header {
    display: none; 
}


/* Neural Button */
.neural-button {
    width: 100%;
    background: transparent;
    color: #ffffff; /* ข้อความ: ขาว */
    border: none;
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    position: relative;
    margin-bottom: 28px;
    overflow: hidden;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ***** การแก้ไขสำคัญ: ปุ่มสีดำ (พื้นหลังเป็นสีดำถาวร) ***** */
.button-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000000; /* พื้นหลังปุ่ม: ดำ */
    border-radius: 12px;
    transition: all 0.3s ease;
}

.neural-button:hover .button-bg {
    background: #1f1f1f; /* Hover: ดำเข้มขึ้นเล็กน้อย */
    transform: scale(1.02);
}

.neural-button:active .button-bg {
    transform: scale(0.98);
}

.button-text {
    position: relative;
    z-index: 2;
    color: #ffffff; /* ข้อความ: ขาว */
    transition: opacity 0.2s ease;
}

/* ลบ Glow สีน้ำเงินออกเพื่อให้เข้ากับสีดำ */
.button-glow {
    /* ใช้สีดำจางๆ เพื่อทำ Glow แทนสีน้ำเงิน */
    background: rgba(0, 0, 0, 0.4); 
    filter: blur(5px);
}
.neural-button:hover .button-glow {
    opacity: 0.8;
}

/* Mobile Responsive (โค้ดเดิม) */
@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .login-card {
        padding: 32px 24px;
        border-radius: 16px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
}
