﻿/* คุมฟอนต์หลักทั้งเว็บไว้ที่นี่ */
html, body {
    height: 100%;
    margin: 0;
    font-family: 'Noto Sans Thai', sans-serif !important;
    background-color: #f0f2f5;
}

/* ใช้คลาสเหล่านี้เพื่อตกแต่งความสวยงามเพิ่มเติม */
.font_heading {
    font-size: 1.5rem; /* ขนาดใหญ่กว่าปกติ */
    font-weight: 700; /* ตัวหนา */
    color: #2c3e50; /* สีโทนเข้มดูเป็นทางการ */
    letter-spacing: 0.5px;
}

.font_normal {
    font-size: 15px; /* ขนาดอ่านง่าย */
    color: #4a4a4a; /* สีเทาเข้มถนอมสายตา */
}

/* ใช้คลาสนี้ใน Tag <form> เพื่อคุม Footer ให้อยู่ล่างสุด */
.flex-form {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-wrapper {
    flex: 1 0 auto;
}

.footer-wrapper {
    flex-shrink: 0;
    width: 100%;
}

    .footer-wrapper img {
        display: block;
    }

/* --- 2. User Bar (Header ส่วนล่าง) --- */
.user-bar {
    background: white;
    padding: 12px 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-label {
    background: #6c757d;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.btn-logout-link {
    color: #dc3545;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
}
   .btn-logout-link:hover {
        color: #a71d2a;
    }

.btn-home-link {
    color: #00aeef; /* สีฟ้าเดียวกับ Spinner */
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

    .btn-home-link:hover {
        color: #0086b8;
    }

/* ตกแต่งปุ่มเวลา Hover */
.b_hover {
    transition: transform 0.2s;
}

    .b_hover:hover {
        transform: scale(1.2); /* ขยายขนาดนิดนึงเวลาเอาเมาส์วาง */
        opacity: 0.8;
    }

/* --- 3. Menu Cards (สำหรับหน้า track_menu.aspx) --- */
.menu-card {
    background: white;
    border-radius: 15px;
    padding: 35px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

    .menu-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 25px rgba(0,0,0,0.1);
        border-color: #00aeef;
    }

    .menu-card i {
        font-size: 3.5rem;
        color: #4a4a4a;
        margin-bottom: 20px;
    }

.menu-title {
    font-weight: 700;
    font-size: 1.3rem;
    color: #333;
}

/* --- 4. GridView & Modal Components (สำหรับหน้า track_account.aspx) --- */
.gv_bg_header {
    background-color: #4472c4 !important;
    color: white !important;
    font-weight: bold;
}

.table-responsive {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.modal-body {
    padding: 2rem !important;
}   

/* --- 5. Custom Spinner (เหมือนหน้าลงทะเบียน) --- */
/* Spinner Style */
.spinner {
    width: 100px;
    height: 100px;
    border: 6px solid #00aeef;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    backface-visibility: hidden;
    will-change: transform;
    transform: translateZ(0);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

    #loading.hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

/* --- 6. Login Section (Professional UI) --- */
.main-section-login {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: none;
    margin-top: 40px;
    margin-bottom: 40px;
}

    /* ปรับแต่ง Input ในหน้า Login ให้ดูพรีเมียมขึ้น */
    .main-section-login .form-control {
        border-radius: 8px;
        padding: 12px;
        border: 1px solid #ddd;
        transition: all 0.2s;
    }

/* Password Input & Eye Icon (แบบไร้รอยต่อ Seamless) */
.pwd-input {
    border-right: none !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

#togglePassword {
    border-left: none !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    background-color: white !important;
    cursor: pointer;
    min-width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    color: #6c757d;
    transition: 0.2s;
}

/* Focus State สำหรับช่องกรอกรหัส */
.input-group:focus-within .form-control,
.input-group:focus-within .input-group-text {
    border-color: #00aeef !important; /* เปลี่ยนเป็นสีฟ้าตาม Spinner */
    box-shadow: none;
}

/* Button Styles (Interactive & Symmetry) */
.btn-login {
    border-radius: 8px !important;
    padding: 12px !important;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-secondary.btn-login {
    background-color: #4a4a4a !important;
    border: none !important;
}

.btn-login:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Error / Validation Styles */
.form-control.is-invalid {
    background-image: none !important;
    border-color: #dc3545 !important;
}

.is-invalid + #togglePassword {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

/* Animation สั่นเวลาใส่ผิด */
.is-invalid {
    animation: shake 0.2s ease-in-out 0s 2;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }
}

@media (max-width: 576px) {
    .main-section-login {
        padding: 30px 20px;
        margin-top: 20px;
    }
}

/* การตั้งค่า Card ให้ดูเหมือนแอปมือถือ */
.visitor-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.03);
}

.card-header-custom {
    padding: 12px 20px;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    background-color: #f8f9fa;
    color: #555;
    border-bottom: 1px solid #eee;
}

.card-body-custom {
    padding: 20px;
}

/* การจัดแถวข้อมูล Label - Value */
.info-row {
    display: flex;
    flex-direction: column; /* เหมาะสำหรับมือถือ: Label อยู่บน Value อยู่ล่าง */
    margin-bottom: 15px;
}

.info-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 2px;
}

.info-value {
    font-size: 1.05rem;
    color: #333;
    word-break: break-word; /* ป้องกันข้อความยาวล้นจอ */
}

/* เน้นส่วน SRN ให้ดูพิเศษ */
.highlight-row .info-value {
    font-size: 1.4rem;
    font-weight: 800;
}

.divider {
    margin: 15px 0;
    border: 0;
    border-top: 1px solid #f0f0f0;
    opacity: 1;
}

.bg-info-subtle {
    background-color: #e3f2fd !important;
    color: #007bbd;
}

/* ปรับปรุงปุ่ม Scan Next */
.rounded-pill {
    font-weight: 700;
    transition: all 0.3s;
}

    .rounded-pill:hover {
        background-color: #00aeef;
        color: white;
        transform: translateY(-2px);
    }

/* ทำให้คำว่า CLOSE "เตะตา" และดูเหมือนปุ่ม */
.close-instruction {
    background-color: #fff3f3;
    border: 2px dashed #dc3545;
    color: #dc3545;
    padding: 15px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    display: inline-block;
    width: 100%;
    animation: pulse 2s infinite; /* ทำให้กระพริบเบาๆ เพื่อดึงดูดสายตา */
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}