/* =========================================
   GeTeCe S'more Talk: Universal Master Style
   Branding: GeTeCe Red (#ed1c24)
   ========================================= */

:root {
    --primary: #a02d2d;
    --primary-hover: #802323;
    --primary-light: #ffffff;
    --warning: #ecc94b;
    --bg-gray: #f7fafc;
    --white: #ffffff;
    --border: #edf2f7;
    --text-main: #2d3748;
    --text-muted: #718096;
}

/* 1. Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg-gray);
    color: var(--text-main);
    line-height: 1.6;
}

.container {
    max-width: 1440px;
    margin: auto;
    padding: 20px;
}

/* 2. Layouts (ระบบ 3 คอลัมน์สำหรับ Admin) */
.layout-grid {
    display: grid;
    gap: 20px;
    align-items: start;
}

.layout-2-col {
    grid-template-columns: 260px 1fr;
}

.layout-3-col {
    grid-template-columns: 260px 1fr 420px;
}

/* 3. Header & Navigation */
.header {
    background: var(--primary);
    color: var(--white);
    padding: 20px 25px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    box-shadow: 0 8px 15px rgba(93, 64, 55, 0.2);
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
}

/* ปรับปุ่มเฉพาะที่อยู่ใน Header ให้เล็กลงเพื่อประหยัดพื้นที่ */
.header .btn {
    height: 40px;
    /* บังคับความสูงให้เท่ากันทุกปุ่ม */
    padding: 0 14px;
    /* เปลี่ยนมาใช้ Padding ซ้าย-ขวา แทน */
    display: inline-flex;
    align-items: center;
    /* จัดตัวหนังสือให้อยู่กลางปุ่มในแนวตั้ง */
    font-size: 0.85em;
    border-radius: 10px;
    /* ปลายโค้งมนสวยๆ */
    white-space: nowrap;
    transition: 0.2s;
}

/* ลดช่องว่างระหว่างปุ่มใน Header */
/* 🛠️ แก้ไขในกรอบสีแดงในไฟล์ style.css ของคุณ */
.header .nav-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 1;
    flex-wrap: wrap;
    /* 🎯 เพิ่มบรรทัดนี้: เพื่อให้ปุ่มปัดลงแถวใหม่ได้ถ้าเนื้อที่เต็ม */
    justify-content: flex-end;
    /* จัดปุ่มให้ชิดขวาเพื่อความสวยงาม */
}

.nav-group .btn {
    padding: 8px 12px;
    /* ลด Padding */
    font-size: 0.85em;
    /* ลดขนาดฟอนต์ */
    white-space: nowrap;
    /* ป้องกันตัวหนังสือตัดบรรทัดในปุ่ม */
}

/* 4. Buttons */
.btn {
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: none;
    font-size: 0.9em;
    transition: 0.2s;
}

.btn-white {
    background: var(--white);
    color: var(--primary);
}

.btn-warning {
    background: var(--warning);
    color: #333;
}

.btn-blue {
    background: #007bff;
    color: white;
}

.btn-admin {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 🔑 ปุ่มสำหรับเปลี่ยนรหัสผ่าน (สีขาวโปร่งแสงมีขอบ) */
.btn-outline-white {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white !important;
}

.btn-outline-white:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 🚪 ปุ่ม Logout: ใช้สีเข้มเพื่อให้ดูแยกออกจากกลุ่มหลักชัดเจน */
.btn-logout {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffdada !important;
    /* สีชมพูอ่อนให้อ่านง่ายบนพื้นแดง */
}

.btn-logout:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* 5. Dashboard Grade Grid (5 คอลัมน์แนวนอน) */
.grade-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 16px;
    margin: 25px 0;
}

.grade-card {
    background: var(--white);
    padding: 25px;
    border-radius: 18px;
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.grade-active {
    border: 2px solid #38a169 !important;
    background: #f0fff4;
}

/* 6. Admin Sidebar & Sections */
.sidebar {
    background: var(--white);
    padding: 20px;
    border-radius: 20px;
    position: sticky;
    top: 20px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    border-radius: 12px;
    margin-bottom: 8px;
}

.menu-item.active {
    background: var(--primary);
    color: white;
}

.section {
    background: var(--white);
    padding: 25px;
    /* ค่ามาตรฐาน 25px */
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    margin-bottom: 20px;
    width: 100%;
    /* 🎯 บังคับกว้าง 100% เท่ากัน */
    box-sizing: border-box;
    /* ป้องกันการบวมของกล่อง */
}

.input-field {
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f9f9f9;
    font-size: 0.95em;
}

/* 7. Responsive */
@media (max-width: 1024px) {

    .layout-2-col,
    .layout-3-col {
        grid-template-columns: 1fr;
    }

    .grade-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* --- Login Page Styles (ย้ายมาจาก login.php) --- */
.login-body {
    background: var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.1em;
    display: flex;
    justify-content: center;
    /* จัดข้อความให้อยู่ตรงกลางเป๊ะ */
    align-items: center;
    transition: 0.3s;
}

.btn-login:hover {
    background: var(--primary-hover);
}

.error-msg {
    background: #fff5f5;
    color: #e53e3e;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #feb2b2;
}

/* --- Dashboard Activity List Styles --- */
.activity-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.activity-table th {
    text-align: left;
    padding: 12px 15px;
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.85em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border);
}

.activity-table td {
    padding: 20px 15px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.topic-title {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--text-main);
    display: block;
    margin-bottom: 4px;
}

.topic-meta {
    font-size: 0.85em;
    color: var(--text-muted);
    display: flex;
    gap: 15px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
}

/* --- Score Summary Card --- */
.score-summary-container {
    display: flex;
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
}

.score-left {
    flex: 1;
    padding: 30px;
    text-align: center;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.score-right {
    flex: 2;
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.score-big {
    font-size: 3.5em;
    font-weight: bold;
    color: var(--primary);
    line-height: 1;
    margin: 10px 0;
}

.next-grade-text {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.progress-container-small {
    background: #edf2f7;
    border-radius: 10px;
    height: 8px;
    width: 100%;
    margin-top: 15px;
}

/* --- Proposal Form Styles --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1em;
    background: #fdfdfd;
    transition: 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(160, 45, 45, 0.1);
}

.readonly-box {
    background: #f8fafc;
    border: 2px solid #edf2f7;
    color: #a0aec0;
    cursor: not-allowed;
}

.btn-save {
    background: var(--primary);
    color: white;
    border: none;
    padding: 18px;
    width: 100%;
    border-radius: 15px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 20px;
}

.btn-save:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.cancel-link {
    display: block;
    text-align: center;
    margin-top: 25px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9em;
    transition: 0.2s;
}

.cancel-link:hover {
    color: var(--primary);
}

.card-form {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.full-width {
    grid-column: span 2;
}

.quota-box {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 15px;
    border: 1px solid var(--border);
}

.quota-item {
    flex: 1;
    text-align: center;
}

.quota-number {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary);
    display: block;
}

.quota-label {
    font-size: 0.8em;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* --- Booking Page Styles --- */
.booking-container {
    max-width: 600px;
    margin: 40px auto;
}

.time-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.info-banner {
    background: #ebf8ff;
    border-left: 4px solid #3182ce;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 8px;
    font-size: 0.9em;
}

/* --- Live Session Styles --- */
.pin-display {
    font-size: 4em;
    font-weight: bold;
    letter-spacing: 15px;
    color: var(--primary);
    background: #fff5f5;
    padding: 20px;
    border-radius: 15px;
    border: 3px dashed var(--primary);
    margin: 20px 0;
    text-align: center;
}

.live-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #e53e3e;
    border-radius: 50%;
    margin-right: 8px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        opacity: 1;
    }
}

/* --- Summary Submission Styles --- */
.summary-card {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.summary-textarea {
    width: 100%;
    min-height: 200px;
    padding: 20px;
    border: 2px solid #edf2f7;
    border-radius: 15px;
    font-size: 1.1em;
    line-height: 1.6;
    resize: vertical;
    background: #fcfcfc;
}

.summary-textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: #fff;
}

/* --- Leaderboard Styles --- */
.rank-card {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    background: #fff;
    border-radius: 15px;
    margin-bottom: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.rank-card:hover {
    transform: scale(1.02);
}

.rank-number {
    font-size: 1.5em;
    font-weight: bold;
    width: 50px;
    color: var(--text-muted);
}

.rank-1 {
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
    border-left: 6px solid #ecc94b;
}

/* Gold */
.rank-1 .rank-number {
    color: #ecc94b;
}

.rank-2 {
    border-left: 6px solid #a0aec0;
}

/* Silver */
.rank-3 {
    border-left: 6px solid #ed8936;
}

/* Bronze */

.grade-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    background: #edf2f7;
}

/* =========================================
   GeTeCe S'more Talk: Available Topics Page
   ========================================= */
.smore-topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.smore-topic-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
    transition: 0.3s;
}

.smore-topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08);
}

.card-status-line {
    height: 6px;
    background: #e2e8f0;
}

.smore-topic-card.booked .card-status-line {
    background: #48bb78;
}

.card-inner {
    padding: 25px;
}

.smore-tag {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 800;
    text-transform: uppercase;
}

.tag-general {
    background: #ebf8ff;
    color: #2b6cb0;
}

.tag-functional {
    background: #faf5ff;
    color: #6b46c1;
}

.smore-topic-title {
    font-size: 1.3em;
    margin: 15px 0;
    color: var(--text-main);
    line-height: 1.4;
    font-weight: bold;
}

.smore-speaker {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.smore-avatar-box {
    background: #f7fafc;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    border: 1px solid var(--border);
}

.speaker-text .name {
    font-weight: 600;
    color: var(--text-main);
}

.speaker-text .dept {
    font-size: 0.85em;
    color: var(--text-muted);
}

.smore-time-info {
    background: #f8fafc;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid var(--border);
}

.time-row.date {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.time-row.waiting {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9em;
}

.btn-booking-red {
    display: block;
    text-align: center;
    background: var(--primary);
    color: white !important;
    text-decoration: none;
    padding: 12px;
    border-radius: 12px;
    margin-top: 20px;
    font-weight: bold;
}

.btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* =========================================
   Navbar - GeTeCe S'more Talk
   ========================================= */
.smore-navbar {
    background: var(--primary);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-radius: 12px;
    font-family: 'Tahoma', sans-serif;
    margin-bottom: 25px;
    box-shadow: 0 6px 15px rgba(93, 64, 55, 0.15);
}

.smore-navbar .user-profile .name {
    font-size: 1.2rem;
    font-weight: bold;
}

.smore-navbar .user-profile .dept {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 5px;
}

/* กลุ่มปุ่มฝั่งขวา */
.smore-navbar .nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* สไตล์ปุ่มทั่วไป */
.smore-navbar .nav-btn {
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
}

/* สีปุ่มหลักที่โชว์ด้านนอก */
.smore-navbar .btn-white {
    background-color: var(--white);
    color: var(--primary);
    border-color: var(--white);
}

.smore-navbar .btn-white:hover {
    background-color: #f7fafc;
}

.smore-navbar .btn-darkred {
    background-color: rgba(0, 0, 0, 0.15);
    /* ทำให้โปร่งใสเข้ากับสีพื้นหลัง */
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.smore-navbar .btn-darkred:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

.smore-navbar .btn-yellow {
    background-color: #ecc94b;
    color: #1a202c;
    border-color: #d69e2e;
}

.smore-navbar .btn-yellow:hover {
    background-color: #FFCA28;
}

/* เมนู 3 ขีด (Hamburger Dropdown) */
.smore-navbar .dropdown {
    position: relative;
    display: inline-block;
}

.smore-navbar .hamburger-btn {
    background-color: transparent;
    color: white;
    border: 1px solid white;
    padding: 8px 12px;
    font-size: 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.smore-navbar .hamburger-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.smore-navbar .dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 110%;
    background-color: #ffffff;
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 100;
    /* ดันให้เมนูอยู่บนสุดเสมอ */
    border-radius: 5px;
    overflow: hidden;
}

.smore-navbar .dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    border-bottom: 1px solid #eee;
}

.smore-navbar .dropdown-content a:hover {
    background-color: #f8f9fa;
    color: #ed1c24;
}

/* แสดงเมนูเมื่อกด */
.smore-navbar .show {
    display: block;
}

/* =========================================
   Filter Bar & Success Cards
   ========================================= */
.filter-bar {
    background: #f8fafc;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-end;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.success-body {
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
}

.success-card {
    background: white;
    padding: 50px;
    border-radius: 25px;
    box-shadow: 0 15px 35px rgba(160, 45, 45, 0.1);
    text-align: center;
    max-width: 400px;
    border-top: 8px solid var(--primary);
}

.success-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.success-card h2 {
    color: var(--text-main);
    margin: 10px 0;
}

.success-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

.success-loader {
    margin-top: 30px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.success-progress {
    width: 0%;
    height: 100%;
    background: var(--primary);
    animation: successLoad 3s linear forwards;
}

@keyframes successLoad {
    to {
        width: 100%;
    }
}

/* =========================================
   Responsive Navbar Mobile Styles
   ========================================= */
@media (max-width: 850px) {

    /* ซ่อนปุ่มด้านนอกเมื่อจอเล็ก */
    .desktop-only {
        display: none !important;
    }

    /* แสดงเมนูเหล่านี้เฉพาะในมือถือ (อยู่ในเมนู 3 ขีด) */
    .mobile-only {
        display: block !important;
    }

    /* ปรับขนาดตัวอักษรไม่ให้ล้น */
    .user-profile .name {
        font-size: 0.95em;
        white-space: normal;
        word-break: break-word;
    }

    .user-profile .dept {
        font-size: 0.85em;
    }

    .smore-navbar {
        padding: 12px 15px;
    }
}

@media (min-width: 851px) {

    /* ในจอคอม ซ่อนเมนูที่ทำซ้ำไว้สำหรับมือถือ */
    .mobile-only {
        display: none !important;
    }
}

/* =========================================
   Executive Report Styles
   ========================================= */
.section-box {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    border: 1px solid var(--border);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.metric-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border-top: 5px solid var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.group-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 20px;
    border-top: 6px solid var(--primary);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.member-list-box {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #cbd5e0;
    font-size: 0.9em;
    max-height: 250px;
    overflow-y: auto;
}

.top-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.top-table td,
.top-table th {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

/* =========================================
   Summary Submission Rating
   ========================================= */
.rating-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
    margin: 15px 0;
}

.rating-item {
    position: relative;
}

.rating-item input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.rating-label {
    display: block;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 10px 0;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.rating-item input:checked+.rating-label {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.05);
}

.rating-item:hover .rating-label {
    border-color: var(--primary);
}

/* =========================================
   PIN Input Check-in
   ========================================= */
.pin-input {
    width: 100%;
    font-size: 2.5em;
    text-align: center;
    letter-spacing: 12px;
    border: 2px solid #90cdf4;
    border-radius: 12px;
    padding: 15px;
    color: var(--text-main);
    background: #ebf8ff;
    transition: 0.3s;
}

.pin-input:focus {
    border-color: var(--primary);
    outline: none;
    background: white;
}

/* =========================================
   Booking Page Styles
   ========================================= */
.booking-layout {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.booking-left {
    flex: 1;
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.booking-right {
    flex: 1.2;
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.time-select-group {
    display: flex;
    gap: 5px;
    align-items: center;
}

.time-select-group select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    flex: 1;
}

.month-header {
    background: var(--bg-gray);
    padding: 12px 15px;
    border-radius: 10px;
    font-weight: bold;
    color: var(--primary);
    border-left: 6px solid var(--primary);
    margin: 20px 0 10px 0;
}

/* =========================================
   Topic Cards & Badges
   ========================================= */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 20px;
}

.card-finished {
    opacity: 0.6;
    filter: grayscale(100%);
    border: 1px solid #cbd5e0 !important;
}

.card-live {
    border: 2px solid #e53e3e !important;
    box-shadow: 0 0 15px rgba(229, 62, 62, 0.3);
    position: relative;
}

.live-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e53e3e;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* =========================================
   Check-in PIN Split Card Layout
   ========================================= */
.checkin-wrapper {
    display: flex;
    flex-wrap: wrap;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #edf2f7;
    overflow: hidden;
    width: 100%;
}
.checkin-left {
    flex: 1;
    min-width: 300px;
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid #feb2b2;
}
.checkin-right {
    flex: 1.5;
    min-width: 300px;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.custom-pin-input { 
    width: 100%; 
    max-width: 400px; 
    font-size: 3em; 
    text-align: center; 
    letter-spacing: 15px; 
    border: 2px solid #90cdf4; 
    border-radius: 15px; 
    padding: 20px; 
    color: #2d3748; 
    background: #ebf8ff; 
    transition: 0.3s;
    box-sizing: border-box;
    font-family: monospace;
}
.custom-pin-input:focus { 
    border-color: #3182ce; outline: none; background: white; 
    box-shadow: 0 0 0 4px rgba(49, 130, 206, 0.2); 
}
.btn-submit-pin {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    font-size: 1.3em;
    font-weight: bold;
    border-radius: 15px;
    background: #3182ce;
    color: white;
    border: none;
    cursor: pointer;
    margin-top: 25px;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
}
.btn-submit-pin:hover {
    background: #2b6cb0;
    transform: translateY(-2px);
}

/* 📱 Responsive ตัดแถวลงมาซ้อนกันบนมือถือ */
@media (max-width: 768px) {
    .checkin-left { border-right: none; border-bottom: 1px solid #feb2b2; padding: 30px 20px; text-align: center; }
    .checkin-right { padding: 30px 20px; }
    .custom-pin-input { font-size: 2.2em; letter-spacing: 10px; }
}
