:root {
    --app-font-scale: 1;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    overflow-x: clip;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: none;
}
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f1f5f9;
    color: #333;
    line-height: 1.6;
}
.main-wrapper { max-width: 1100px; margin: 0 auto; background: #fff; min-height: 100vh; box-shadow: 0 0 10px rgba(0,0,0,0.05); }

/* ================= LMS TRACKER ================= */
.lms-container { padding-bottom: 30px; }
.lms-title { font-size: 22px; font-weight: 800; text-align: center; color: #0f172a; margin-top: 10px; margin-bottom: 25px; }
#lms-guest-msg { text-align: center; color: #64748b; font-size: 14px; background: #f8fafc; padding: 25px; border-radius: 6px; border: 1px dashed #cbd5e1; }

.lms-stats-row { display: flex; justify-content: space-evenly; text-align: center; margin-bottom: 20px; border: 1px solid #f1f5f9; border-radius: 8px; padding: 15px; background: #fafafa; max-width: 480px; margin-left: auto; margin-right: auto; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.lms-stat-box { display: flex; flex-direction: column; gap: 5px; }
.lms-label { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.lms-val { font-size: 22px; font-weight: 900; color: #000000; }

.lms-suggestion { font-size: 13px; color: #475569; margin-bottom: 30px; text-align: center; }

.lms-circle-wrap { display: flex; justify-content: center; margin-bottom: 30px; }
.lms-circle { width: 190px; height: 190px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: conic-gradient(#4f46e5 0%, #eef2ff 0%); box-shadow: 0 0 30px rgba(79, 70, 229, 0.15); transition: background 1s ease-out; }
.lms-circle-inner { width: 170px; height: 170px; background: white; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: inset 0 2px 10px rgba(0,0,0,0.05); }
.lms-pct-text { font-size: 36px; font-weight: 900; color: #0f172a; line-height: 1.1; }
.lms-done-text { font-size: 10px; font-weight: 700; color: #64748b; letter-spacing: 1px; margin-top: 5px; }
.lms-frac-text { font-size: 13px; color: #94a3b8; font-weight: 500; margin-top: 2px; }

.lms-categories { border: 1px solid #e2e8f0; border-radius: 8px; padding: 25px; background: #fdfdfd; }
.lms-cat-row { margin-bottom: 20px; }
.lms-cat-row:last-child { margin-bottom: 0; }
.lms-cat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: #334155; }
.lms-cat-pct { color: #000000; }
.lms-cat-track { width: 100%; height: 14px; background: #e2e8f0; border-radius: 8px; overflow: hidden; }
.lms-cat-fill { height: 100%; background: #d1d5db; border-radius: 8px; transition: 1s width ease-out; }
.lms-cat-fill.red { background: #ef4444; }
.lms-history-btn { background: white; border: 1px solid #cbd5e1; padding: 10px 20px; border-radius: 6px; color: #475569; font-size: 14px; font-weight: 600; cursor: pointer; transition: 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.lms-history-btn:hover { background: #f8fafc; color: #000000; }

/* ================= DANH SÁCH BỘ ĐỀ ================= */
.top-header { background: #fff; padding: 15px; position: sticky; top: 0; z-index: 1000; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.nav-container { border: 1px solid #cbd5e1; border-radius: 4px; background: white; margin-bottom: 0px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }

/* Tools Base (Common) */
.nav-tools { display: flex; border: 1px solid #94a3b8; border-radius: 20px; overflow: hidden; background: white;}
.tool-btn { background: transparent; border: none; border-right: 1px solid #94a3b8; padding: 8px 12px; cursor: pointer; font-size: 13px; color: #475569; font-weight: bold; transition: 0.1s;}
.tool-btn:last-child { border-right: none; }
.tool-btn:hover { background: #f1f5f9; }

/* Desktop Defaults (>900px) */
@media (min-width: 900px) {
    .nav-container { display: flex; flex-direction: row; justify-content: space-between; align-items: stretch; }
    
    .nav-tabs { order: 1; flex: 1; display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .nav-tabs::-webkit-scrollbar { display: none; }
    .nav-tab { flex-shrink: 0; padding: 14px 14px; text-decoration: none; color: #475569; font-weight: 700; font-size: 15px; border-bottom: 3px solid transparent; white-space: nowrap; }
    .nav-tab:hover { background: #f8fafc; }
    .nav-tab.active { background-color: #0d6efd; color: white; border-bottom: 3px solid #0b5ed7; }
    
    .nav-top-row { order: 2; display: flex; align-items: center; padding-right: 15px; }
    .mobile-title { display: none; }
    .nav-tools-group { display: flex; align-items: center; }
    .hamburger-btn { display: none; }
}

/* Mobile Defaults (<899px) */
@media (max-width: 899px) {
    .nav-container { display: flex; flex-direction: column; }
    
    .nav-top-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; border-bottom: 1px solid #e2e8f0; }
    .mobile-title { font-size: 18px; font-weight: 700; color: #000000; margin: 0; }
    
    .nav-tools-group { display: flex; align-items: center; }
    .hamburger-btn { display: block; background: none; border: none; font-size: 24px; color: #475569; margin-left: 15px; cursor: pointer; }
    
    .nav-tabs { display: none; flex-direction: column; padding: 15px; gap: 8px; }
    .nav-tabs.show { display: flex; }
    .nav-tab { 
        display: block; width: 100%; text-align: center; 
        padding: 12px; background: #f8fafc; border-radius: 6px; 
        color: #000000; font-weight: 600; text-decoration: none; 
        border: 1px solid transparent; transition: 0.1s;
    }
    .nav-tab:hover { background: #e2e8f0; }
    .nav-tab.active { background: #0d6efd; color: white; border: 1px solid #0b5ed7; box-shadow: 0 2px 4px rgba(13,110,253,0.2);}
}

/* ================= BANNER ================= */
.blue-banner { background: linear-gradient(90deg, #1877f2 0%, #00d2ff 100%); padding: 25px 20px; text-align: center; border-radius: 4px; margin: 15px 15px 20px 15px; box-shadow: 0 4px 6px rgba(24,119,242,0.2); }
.blue-banner h1.banner-title { color: white; margin: 0; font-size: calc(26px * var(--app-font-scale)); font-weight: 900; text-transform: uppercase; }

/* ================= CONTENT CONTAINER ================= */
.content-container { padding: 0 15px; min-height: calc(100vh - 400px); }

/* ================= FOOTER ================= */
.main-footer { padding: 20px 15px; margin-top: 40px; }
@media (max-width: 899px) { .main-footer { padding-bottom: 130px; } }
.footer-box { border: 1px solid #3b82f6; border-radius: 4px; padding: 30px; text-align: center; background: white; }
.footer-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.circle-logo { width: 50px; height: 50px; background: #0d6efd; border-radius: 50%; position: relative; overflow: hidden; }
.circle-logo .logo-t { position: absolute; color: #ff4757; font-size: 32px; font-weight: 900; left: 8px; top: -5px; transform: italic; font-style: italic; }
.circle-logo .logo-s { position: absolute; color: white; font-size: 24px; font-weight: 900; right: 8px; bottom: 4px; font-style: italic; z-index: 2; }

.footer-links { margin-bottom: 15px; font-weight: 500; color: #64748b; }
.footer-links a { color: #0d6efd; text-decoration: none; font-weight: bold; }
.divider { margin: 0 10px; color: #94a3b8; }
.footer-address { color: #475569; margin-bottom: 8px; font-size: 14px; }
.footer-copyright { color: #475569; margin-bottom: 15px; font-size: 14px; }
.footer-copyright strong { color: #0d6efd; }
.footer-version { display: inline-block; background: #64748b; color: white; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: bold; margin-bottom: 30px; }

.footer-stats { display: flex; justify-content: center; border-top: 1px solid #e2e8f0; padding-top: 20px; max-width: 650px; margin: 0 auto; }
.stat-col { flex: 1; text-align: center; }
.line-right { border-right: 1px solid #e2e8f0; }
.stat-icon-green { color: #22c55e; font-size: 20px; margin-bottom: 5px; }
.stat-icon-blue { color: #3b82f6; font-size: 20px; margin-bottom: 5px; }
.stat-icon-red { color: #ef4444; font-size: 20px; margin-bottom: 5px; }
.stat-label { font-size: 13px; color: #64748b; margin-bottom: 5px; text-transform: uppercase; font-weight: bold; }
.stat-value { font-size: 22px; font-weight: 800; color: #0f172a; white-space: nowrap; }

/* Fix Odometer Styles/* ===============================
   BẢNG VINH DANH (LEADERBOARD)
   =============================== */
.lb-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 15px;
    border: 1px solid #93c5fd;
    border-radius: 4px;
    overflow: hidden;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}
.lb-tab {
    background: transparent;
    border: none;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #1d4ed8;
    cursor: pointer;
    border-right: 1px solid #93c5fd;
}
.lb-tab:last-child {
    border-right: none;
}
.lb-tab.active {
    background: #1d4ed8;
    color: white;
}
.donor-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
.donor-row:last-child {
    border-bottom: none;
}
.donor-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}
.donor-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.donor-date {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}
.donor-amount {
    background: #166534;
    color: white;
    font-weight: bold;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
}
.odometer .odometer-ribbon-inner { transition-duration: 800ms !important; }
.odometer { font-family: inherit; line-height: 1.1 !important; direction: ltr !important; }
.odometer-digit { vertical-align: middle !important; }
.seo-banner { 
    background: white; 
    border-radius: 8px; 
    margin-bottom: 25px; 
    border: 1px solid #bfdbfe; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); 
    overflow: hidden; 
}
.seo-flex { display: flex; align-items: stretch; }
.seo-left { flex: 0 0 38%; max-width: 450px; display: flex; }
.seo-left img { width: 100%; height: 100%; object-fit: contain; background: #e0f2fe; display: block; border-right: 1px solid #bfdbfe; }
.seo-right { flex: 1; padding: 25px 30px; font-size: calc(15px * var(--app-font-scale)); line-height: 1.6; color: #334155; }
.seo-right h2 { font-size: calc(20px * var(--app-font-scale)); color: #334155; margin-top: 0; margin-bottom: 15px; font-weight: bold; text-transform: uppercase; }
.seo-right p { margin-bottom: 15px; }
.seo-right ul { padding-left: 20px; list-style-type: disc; margin-bottom: 0; }
.seo-right li { margin-bottom: 8px; }

.content-box {
    background: white; 
    border-radius: 8px; 
    padding: 25px 20px; 
    margin-bottom: 25px; 
    border: 1px solid #e2e8f0; 
}

/* PVP Box */
.pvp-box {
    background: white;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    margin-bottom: 25px;
    overflow: hidden;
}
.pvp-header {
    background: #1d4ed8;
    color: white;
    font-size: calc(18px * var(--app-font-scale));
    font-weight: 800;
    text-align: center;
    padding: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pvp-body {
    background: #e0f2fe;
    padding: 25px 20px;
}
.pvp-desc {
    color: #475569;
    margin-bottom: 25px;
    font-size: calc(15px * var(--app-font-scale));
}
.pvp-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}
.pvp-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}
.pvp-card-title {
    font-size: calc(16px * var(--app-font-scale));
    font-weight: 700;
    color: #000000;
    margin-bottom: 8px;
}
.pvp-card-desc {
    font-size: calc(13px * var(--app-font-scale));
    color: #64748b;
    margin-bottom: 15px;
    flex: 1;
}
.btn-pvp-outline {
    background: white;
    border: 1px solid #1d4ed8;
    color: #1d4ed8;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
}
.btn-pvp-outline:hover {
    background: #eff6ff;
}

/* Utils box */
.utils-box {
    margin-bottom: 25px;
}
.utils-title {
    font-size: calc(20px * var(--app-font-scale));
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 20px;
}
.utils-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}
.btn-util {
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-weight: bold;
    font-size: calc(15px * var(--app-font-scale));
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.util-green { background: #d1fae5; color: #065f46; }
.util-green:hover { background: #a7f3d0; }
.util-green-light { background: #dcfce7; color: #166534; }
.util-green-light:hover { background: #bbf7d0; }
.util-gray { background: #e2e8f0; color: #0f172a; }
.util-gray:hover { background: #cbd5e1; }
.util-blue-light { background: #dbeafe; color: #1e3a8a; }
.util-blue-light:hover { background: #bfdbfe; }

/* Responsive overrides */
@media (max-width: 899px) {
    .utils-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .pvp-grid { grid-template-columns: 1fr; }
    .utils-grid { grid-template-columns: 1fr; }
}

.category-box {
    background: #e0f2fe; 
    border: 1px solid #bae6fd; 
    border-radius: 8px; 
    padding: 25px 20px;
    margin-bottom: 25px;
}
.text-center { text-align: center; }
.section-title { font-size: calc(24px * var(--app-font-scale)); font-weight: 800; color: #0f172a; margin-bottom: 15px; }
.section-desc { color: #475569; margin-bottom: 25px; font-size: calc(15px * var(--app-font-scale)); }

.exam-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; transition: 0.3s ease; }
.exam-grid.collapsed .exam-item:nth-child(n+5) { display: none; }

@media (max-width: 899px) {
    .exam-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 480px) {
    .exam-grid { grid-template-columns: 1fr; gap: 10px; }
    .exam-grid.collapsed .exam-item:nth-child(n+5) { display: none; }
}

.exam-item { border: 1px solid #e2e8f0; border-radius: 8px; padding: 25px 15px; text-align: center; background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.exam-item-title { font-size: calc(16px * var(--app-font-scale)); font-weight: 700; color: #000000; margin-bottom: 15px; line-height: 1.4; }
.exam-item-subtitle { font-size: calc(13px * var(--app-font-scale)); font-weight: 400; color: #64748b; }
.exam-item-actions { display: flex; gap: 10px; justify-content: center; }

.btn-hoc { background-color: white; border: 1px solid #1d4ed8; color: #1d4ed8; padding: 10px; border-radius: 6px; font-weight: bold; cursor: pointer; flex: 1; transition: 0.2s;}
.btn-thi { background-color: #0d6efd; border: none; color: white; padding: 10px; border-radius: 6px; font-weight: bold; cursor: pointer; flex: 1; transition: 0.2s; }
.btn-hoc:hover { background-color: #eff6ff; }
.btn-thi:hover { background-color: #0b5ed7; }

.btn-toggle-grid {
    background: white;
    border: 1px solid #94a3b8;
    color: #475569;
    padding: 6px 15px;
    border-radius: 4px;
    font-size: calc(14px * var(--app-font-scale));
    cursor: pointer;
    transition: 0.2s;
}
.btn-toggle-grid:hover {
    background: #f1f5f9;
}

/* ================= EXAM VIEW STYLES ================= */
/* ================= EXAM VIEW STYLES ================= */
/* ================= THIẾT KẾ BẢNG THI DESKTOP (EXAM BOARD) ================= */
.exam-board-desktop {
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    border-top: 4px solid #3b82f6;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

body.dark-mode .exam-board-desktop {
    background: #0f172a;
    border-color: #334155;
    border-top: 4px solid #3b82f6;
}

.exam-header { 
    display: block !important; 
    padding-bottom: 20px; 
    margin-bottom: 20px; 
    border-bottom: 3px solid #f1f5f9; 
}
.exam-layout-split { display: flex; gap: 20px; align-items: flex-start; }
.exam-main-panel { flex: 1; min-width: 0; }
.desktop-grid-title { font-size: 16px; font-weight: 700; color: #0f172a; padding: 20px 20px 5px 20px; border-bottom: 1px solid #f1f5f9; background: #f8fafc; border-radius: 8px 8px 0 0;}
.timer-wrapper { display: flex; align-items: center; justify-content: center; background: #ef4444; color: white; padding: 5px 15px; border-radius: 8px; font-weight: bold; font-variant-numeric: tabular-nums; }
.timer-wrapper .timer { color: white; font-size: 20px; font-variant-numeric: tabular-nums; min-width: 65px; text-align: center; }

/* ================= AUTHENTICATION STYLES ================= */
.auth-alert-box {
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 25px;
    font-size: calc(14px * var(--app-font-scale));
    color: #1e3a8a;
}
.auth-alert-box a { color: #0369a1; font-weight: bold; text-decoration: underline; }

.auth-login-box { 
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 20px 25px;
    margin-bottom: 25px; 
}
.auth-form-row { 
    display: flex; 
    flex-wrap: wrap; 
    align-items: center; 
    gap: 12px; 
    margin-bottom: 15px;
}
.auth-greeting { font-size: calc(15px * var(--app-font-scale)); color: #064e3b; white-space: nowrap; }
.auth-input.login-input { 
    flex: 1; 
    min-width: 200px; 
    padding: 10px 15px; 
    border: 1px solid #cbd5e1; 
    border-radius: 6px; 
    font-size: calc(15px * var(--app-font-scale));
    background: white;
    outline: none;
}
.auth-input.login-input:focus { border-color: #10b981; box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2); }
.password-wrapper { position: relative; flex: 1; min-width: 200px; display: flex; }
.password-wrapper .auth-input { width: 100%; padding-right: 40px; }
.toggle-password { 
    position: absolute; 
    right: 15px; 
    top: 50%; 
    transform: translateY(-50%); 
    cursor: pointer; 
    color: #64748b; 
}
.auth-btn-submit.btn-green-submit { 
    background-color: #047857; 
    color: white; 
    border: none; 
    padding: 10px 24px; 
    border-radius: 6px; 
    font-weight: 700; 
    font-size: calc(15px * var(--app-font-scale));
    cursor: pointer; 
    white-space: nowrap;
    transition: 0.2s;
}
.auth-btn-submit.btn-green-submit:hover { background-color: #064e3b; }
.auth-hints { 
    font-size: calc(13px * var(--app-font-scale)); 
    color: #475569; 
    line-height: 1.8;
}
.remember-label { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-top: 5px;}
.remember-label input { width: 16px; height: 16px; cursor: pointer; }

/* Profile Card Setup */
.profile-card { padding: 10px 0 20px 0; }
.profile-top { display: flex; align-items: center; gap: 20px; margin-bottom: 25px; }
.avatar-wrapper { position: relative; width: 80px; height: 80px; flex-shrink: 0; }
.avatar-wrapper img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid #e2e8f0; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.avatar-edit { position: absolute; bottom: 0; right: 0; background: #fff; border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.15); cursor: pointer; color: #64748b; border: 1px solid #f1f5f9; font-size: 12px; }
.avatar-edit:hover { color: #000000; background: #f8fafc; }
.profile-info-actions { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.profile-actions { display: flex; gap: 10px; margin-top: 12px; }

.btn-thoat-auth { padding: 8px 15px; border-radius: 6px; font-size: calc(14px * var(--app-font-scale)); font-weight: 600; cursor: pointer; border: none; }
.btn-logout { background: #f1f5f9; color: #dc2626; border: 1px solid #e2e8f0; }
.btn-logout:hover { background: #fee2e2; }
.btn-change-pass { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.btn-change-pass:hover { background: #e2e8f0; }

.xp-header { display: flex; justify-content: space-between; margin-bottom: 8px; align-items: flex-end; }
.xp-bar-container { width: 100%; height: 10px; background: #f1f5f9; border-radius: 8px; overflow: hidden; }
.xp-bar-fill { height: 100%; background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%); transition: width 0.6s ease-in-out; }

@media (max-width: 768px) {
    .auth-form-row { flex-direction: column; align-items: stretch; }
    .auth-greeting { text-align: center; margin-bottom: 5px; }
    .auth-btn-submit { width: 100%; }
    
    .seo-flex { flex-direction: column; }
    .seo-left { flex: auto; width: 100%; max-width: 100%; border-right: none; border-bottom: 1px solid #bfdbfe; aspect-ratio: 320 / 450; }
    .seo-right { padding: 20px; }
    
    .profile-top { flex-direction: column; text-align: center; }
    .profile-actions { justify-content: center; }
}
.exam-title-play { font-size: calc(18px * var(--app-font-scale)); color: #0d6efd; font-weight: bold; margin: 0; }
.timer { font-size: 24px; font-weight: 900; color: #ef4444; }

.btn { border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-size: 16px; font-weight: bold; }
.btn-nophai { background-color: #ef4444; color: white; }
.btn-nav { background-color: #22c55e; color: white; flex: 1; margin: 0 5px; }
.btn-secondary { background-color: #64748b; color: white; }
.btn-primary { background-color: #3b82f6; color: white; }
.btn-green { background-color: #047857; color: white; border: none; padding: 10px 20px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn-green:hover { background-color: #064e3b; }
.btn-green-dark { background-color: #064e3b; color: white; border: none; padding: 10px 20px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn-green-dark:hover { background-color: #022c22; }
.submit-big-btn { width: 100%; margin-top: 20px; padding: 15px; background-color: #166534; border-radius: 8px; font-weight: bold; text-transform: uppercase; font-size: 16px; border: none; color: white; cursor: pointer; transition: 0.2s;}
.submit-big-btn:hover { background-color: #14532d; }

.question-card { background: white; padding: 25px; border-radius: 8px; border: 1px solid #f1f5f9; min-height: 300px; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.question-title { font-size: calc(18px * var(--app-font-scale)); font-weight: bold; margin-bottom: 20px; color: #000000; line-height: 1.5; }
.badge-liet { background: #ef4444; color: white; padding: 2px 6px; border-radius: 4px; font-size: 11px; vertical-align: middle; margin-left: 5px;}
.question-image img { max-width: 100%; height: auto; display: block; margin: 0 auto 20px auto; border-radius: 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

.options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.option-label { display: flex; align-items: flex-start; padding: 15px 20px; background: white; border-radius: 8px; cursor: pointer; border: 1px solid #e2e8f0; transition: all 0.2s ease; }
.option-label input { margin-top: 3px; margin-right: 15px; transform: scale(1.3); flex-shrink: 0; }
.option-text { font-size: calc(16px * var(--app-font-scale)); color: #334155; line-height: 1.5; }

.option-label.selected { border-color: #0d6efd; background: #eff6ff; }
.option-label.correct { background: #22c55e; color: white; border-color: #22c55e; }
.option-label.correct .option-text { color: white; }
.option-label.wrong { background: #ef4444; color: white; border-color: #ef4444; }
.option-label.wrong .option-text { color: white; }

.nav-buttons { display: flex; justify-content: space-between; margin-top: 25px; }

.question-grid { padding: 25px 15px; display: grid; grid-template-columns: repeat(5, 45px); justify-content: center; gap: 12px; background: white; border-radius: 0 0 8px 8px; }

/* Grid Accordion overrides */
.question-grid.grid-accordion-mode { display: block; padding: 0; overflow-y: auto; overflow-x: hidden; }
.grid-accordion-item { border-bottom: 1px solid #e2e8f0; }
.grid-accordion-item:last-child { border-bottom: none; }
.grid-accordion-header {
    background: #eff6ff;
    padding: 14px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #1e3a8a;
    transition: background 0.2s;
    font-size: 15px;
}
.grid-accordion-header:hover { background: #dbeafe; }
.grid-accordion-header.active { background: #dbeafe; }
.accordion-icon { transition: transform 0.3s ease; color: #3b82f6; }
.accordion-icon.up { transform: rotate(180deg); }
.grid-accordion-body {
    padding: 20px 15px;
    display: grid;
    grid-template-columns: repeat(5, 45px);
    justify-content: center;
    gap: 12px;
    background: white;
}

.grid-btn { width: 45px; height: 45px; display: flex; align-items: center; justify-content: center; padding: 0; font-size: 16px; font-weight: bold; border-radius: 50%; border: 2px solid #e2e8f0; background: white; color: #475569; cursor: pointer; transition: all 0.2s; }
.grid-btn:hover { background: #f1f5f9; }
.grid-btn.active { background: #f59e0b; color: white; border-color: #f59e0b; transform: scale(1.1); box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4); }
.grid-btn.answered { background: #16a34a; color: white; border-color: #16a34a; }
.grid-btn.wrong-ans { background: #ef4444; color: white; }

.explanation { margin-top: 25px; padding: 20px; background: #fef9c3; border-left: 4px solid #eab308; border-radius: 0 8px 8px 0; font-size: calc(15px * var(--app-font-scale)); color: #854d0e; }

.overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.result-box { background: white; padding: 35px; border-radius: 12px; text-align: center; width: 90%; max-width: 420px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.result-box h2 { color: #000000; margin-bottom: 15px; font-size: 26px; }
.score-display { font-size: 32px; font-weight: 900; margin-bottom: 20px; color: #0d6efd; }
.result-message { font-size: 18px; margin-bottom: 30px; font-weight: 500; color: #475569; }
.result-box .btn-primary { background: #22c55e; color: white; width: 100%; border: none; padding: 12px; font-size: 16px; border-radius: 6px; cursor: pointer; font-weight: bold;}

/* DARK MODE */
body.dark-mode { background-color: #000000; }
body.dark-mode .main-wrapper { background: #0f172a; color: #f1f5f9; }
body.dark-mode .nav-container { background: #0f172a; border-color: #334155; }
body.dark-mode .nav-tab { color: #cbd5e1; }
body.dark-mode .nav-tab:hover { background: #334155; color: #f1f5f9;}
body.dark-mode .nav-tab.active { background-color: #3b82f6; border: none;}
body.dark-mode .nav-top-row { border-color: #334155; }
body.dark-mode .mobile-title { color: #f1f5f9; }
body.dark-mode .nav-top-row { border-bottom-color: #334155; }
body.dark-mode .nav-tools { border-color: #475569; background: #0f172a;}
body.dark-mode .tool-btn { background: #0f172a; border-color: #334155; color: #f1f5f9; }
body.dark-mode .tool-btn:hover { background: #334155; }
body.dark-mode .hamburger-btn { color: #cbd5e1; }

body.dark-mode .auth-box { background: transparent; border-color: transparent;}
body.dark-mode .seo-banner, body.dark-mode .exam-list-container, body.dark-mode .footer-box { background: #0f172a; border-color: #334155; color: #f1f5f9;}
body.dark-mode .seo-left img { background: #334155; border-color: #334155; opacity: 0.9; }
body.dark-mode .seo-right h2, body.dark-mode .seo-right h3 { color: #f1f5f9; }
body.dark-mode .seo-right { color: #cbd5e1; }
body.dark-mode .category-box { background: #0f172a !important; border-color: #334155 !important; }
body.dark-mode .section-desc { color: #cbd5e1; }
body.dark-mode #lbs-subtitle { color: #94a3b8 !important; }
body.dark-mode #quick-search-section input { background: #1e293b !important; color: #f8fafc !important; border-color: #334155 !important; }

/* Các Widget LMS, PVP, Utility và Form Đăng Ký */
body.dark-mode .lms-container, body.dark-mode .utils-box, body.dark-mode #reg-form-body, body.dark-mode .pvp-body { background-color: #0f172a !important; border-color: #334155 !important; }
body.dark-mode .lms-title, body.dark-mode .utils-title, body.dark-mode .lms-label, body.dark-mode .lms-val { color: #f1f5f9; }
body.dark-mode .lms-stat-box, body.dark-mode .pvp-card, body.dark-mode .hist-empty, body.dark-mode #registration-section { background-color: #1e293b !important; border-color: #334155 !important; }
body.dark-mode .lms-circle-inner, body.dark-mode .pvp-box { background-color: #0f172a !important; border-color: #334155 !important; }
body.dark-mode .lms-circle { background-color: #334155 !important; }
body.dark-mode .lms-pct-text { color: #f1f5f9 !important; }
body.dark-mode .lms-done-text, body.dark-mode .lms-frac-text, body.dark-mode .lms-suggestion, body.dark-mode .pvp-desc, body.dark-mode .pvp-card-desc, body.dark-mode .pvp-card-title { color: #cbd5e1 !important; }
body.dark-mode #reg-form-body input, body.dark-mode #reg-form-body select, body.dark-mode #reg-form-body textarea { background-color: #1e293b !important; color: #f8fafc !important; border-color: #475569 !important; }
body.dark-mode #reg-form-body label { color: #cbd5e1 !important; }
body.dark-mode #reg-form-body div[style*="background-color: #fef3c7"] { background-color: #451a03 !important; border-color: #78350f !important; color: #fcd34d !important; }
body.dark-mode #reg-form-body p { color: #94a3b8 !important; }
body.dark-mode .util-green { background: #064e3b !important; color: #a7f3d0 !important; }
body.dark-mode .util-green i { color: #34d399 !important; }
body.dark-mode .util-green-light { background: #14532d !important; color: #bbf7d0 !important; }
body.dark-mode .util-green-light i { color: #4ade80 !important; }
body.dark-mode .util-gray { background: #334155 !important; color: #f1f5f9 !important; }
body.dark-mode .util-gray i { color: #94a3b8 !important; }
body.dark-mode .util-blue-light { background: #1e3a8a !important; color: #bfdbfe !important; }
body.dark-mode .util-blue-light i { color: #60a5fa !important; }
:root { --lms-empty-track: #e2e8f0; }
body.dark-mode { --lms-empty-track: #334155; }
body.dark-mode .lms-stats-row { background: #1e293b !important; border-color: #334155 !important; }
body.dark-mode .lms-stat-box { background: transparent !important; border-color: transparent !important; }
body.dark-mode .lms-categories { background: #0f172a !important; border-color: #334155 !important; }
body.dark-mode .lms-cat-track { background: #334155 !important; }
body.dark-mode .lms-cat-header span { color: #f1f5f9 !important; }
body.dark-mode #quick-search-section div[style*="border"] { border-color: #475569 !important; box-shadow: none !important; }
body.dark-mode #quick-search-section button { background: #334155 !important; color: #f8fafc !important; border-color: #475569 !important; }
body.dark-mode .auth-alert-box { background: #0f172a; border-color: #334155; color: #cbd5e1; }
body.dark-mode .auth-alert-box a { color: #38bdf8; }
body.dark-mode .auth-login-box { background: #000000; border: 1px solid #334155; }
body.dark-mode .auth-hints { color: #94a3b8; }
body.dark-mode .profile-card { background: transparent; border-color: transparent; }
body.dark-mode .btn-change-pass { background: #334155; color: #f1f5f9; border-color: #475569; }
body.dark-mode .btn-logout { background: #334155; color: #f87171; border-color: #475569; }
body.dark-mode .logged-in-box { background: transparent; border-color: transparent; }
body.dark-mode .logged-user-greeting { color: #e2e8f0; }
body.dark-mode .logged-user-greeting span { color: #94a3b8 !important; }

/* Bắt chẹt tất cả Box Inline bằng cấu trúc CSS Đè mạnh nhất */
body.dark-mode div[style*="background: white"],
body.dark-mode div[style*="background: #fff"],
body.dark-mode div[style*="background-color: white"],
body.dark-mode div[style*="background: #e0f2fe"],
body.dark-mode div[style*="background: #f8fafc"],
body.dark-mode div[style*="background-color: #d1fae5"],
body.dark-mode div[style*="background-color: #f1f5f9"],
body.dark-mode .modal-content,
body.dark-mode #change-pass-box,
body.dark-mode #leaderboard-list,
body.dark-mode .donate-box,
body.dark-mode .guide-box,
body.dark-mode .content-box {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
    box-shadow: none !important;
}

body.dark-mode h2[style*="color"],
body.dark-mode h3[style*="color"],
body.dark-mode .content-box h2,
body.dark-mode .content-box h3,
body.dark-mode .guide-box h2,
body.dark-mode .donate-box h2,
body.dark-mode .modal-content h2 {
    color: #f1f5f9 !important;
}

body.dark-mode p[style*="color"],
body.dark-mode div[style*="color: #334155"],
body.dark-mode div[style*="color: #475569"],
body.dark-mode div[style*="color: #64748b"] {
    color: #cbd5e1 !important;
}

body.dark-mode #change-pass-box input {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

body.dark-mode .confirm-icon {
    background-color: #0f172a !important;
}

body.dark-mode #pvp-guest-avatar {
    background-color: #1e293b !important;
    border-color: #475569 !important;
}

body.dark-mode #btn-toggle-trinhtu,
body.dark-mode #btn-load-more-lb {
    background: #334155 !important;
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

body.dark-mode #cmt-login-placeholder {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #94a3b8 !important;
}
body.dark-mode #like-text-count { color: #f8fafc !important; }
body.dark-mode #btn-like-action { background: #334155 !important; border-color: #3b82f6 !important; color: #60a5fa !important; }

body.dark-mode #user-level-text { color: #f1f5f9 !important; }
body.dark-mode .xp-bar-container { background: #334155; }
body.dark-mode .avatar-edit { background: #0f172a; border-color: #334155; }
body.dark-mode .exam-item { background: #334155; border-color: #475569; }
body.dark-mode .exam-item-title, body.dark-mode .section-title { color: #f1f5f9; }
body.dark-mode .footer-logo, body.dark-mode .stat-value { color: #f1f5f9; }
body.dark-mode .stat-col.line-right { border-color: #475569; }
body.dark-mode .footer-stats { border-color: #475569; }
body.dark-mode .question-card, body.dark-mode .exam-header, body.dark-mode .question-grid { background: #0f172a; border-color: #334155; }
body.dark-mode .exam-header { border-bottom-color: #334155; }
body.dark-mode .question-title { color: #f8fafc; }
body.dark-mode .option-label { background: #334155; border-color: #475569; }
body.dark-mode .option-text { color: #e2e8f0; }
body.dark-mode .grid-btn { background: #334155; color: #cbd5e1; border-color: #475569; }
body.dark-mode .explanation { background: #422006; color: #fef08a; border-color: #ca8a04; }
body.dark-mode .desktop-grid-title { background: #0f172a; color: #f8fafc; border-color: #334155; }

/* Responsive Pills specifically for Mobile Dark Mode */
@media (max-width: 899px) {
    body.dark-mode .nav-tab { background: #334155; border: 1px solid transparent; }
    body.dark-mode .nav-tab:hover { background: #475569; }
    body.dark-mode .nav-tab.active { background: #3b82f6; border-color: #0b5ed7;}
}
/* ================= MOBILE EXAM LAYOUT ================= */
.desktop-only { display: block; }
.mobile-only { display: none; }
@media (max-width: 899px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block; }
    .exam-layout-split { flex-direction: column; }
    .question-grid-wrapper { flex: auto; width: 100%; }
}

.mobile-exam-header { background: white; padding: 15px 15px 10px 15px; border-bottom: 1px solid #e2e8f0; margin-bottom: 15px; }
.mobile-exam-header .exam-title { font-size: 18px; color: #0f172a; margin-bottom: 12px; }
.mobile-progress-wrapper { height: 10px; background: #e2e8f0; border-radius: 5px; overflow: hidden; width: 100%; }
.mobile-progress-fill { height: 100%; background: #2563eb; transition: width 0.3s ease; }

.mobile-bottom-bar { display: none; }
@media (max-width: 899px) {
    .mobile-bottom-bar {
        display: flex;
        position: fixed; bottom: 0; left: 0; right: 0;
        background: white; border-top: 1px solid #e2e8f0;
        padding: 12px 15px;
        align-items: center; justify-content: space-between; gap: 10px;
        z-index: 900; box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }
    .bottom-timer { font-variant-numeric: tabular-nums; letter-spacing: 1px; min-width: 80px; display: flex; justify-content: center; align-items: center; flex: 1; background: #ef4444; color: white; padding: 12px 10px; border-radius: 8px; font-weight: 800; font-size: 16px; }
    .bottom-grid-btn { color: #2563eb; font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: center; flex: 1.2; gap: 6px; cursor: pointer; background: white; padding: 12px 10px; border-radius: 8px; border: 1px solid #bfdbfe; }
    .bottom-submit-btn { display: flex; justify-content: center; align-items: center; flex: 1.2; background: #16a34a; color: white; border: none; padding: 12px 10px; border-radius: 8px; font-weight: 800; font-size: 16px; cursor: pointer; }
    .bottom-submit-btn:hover { background: #15803d; }
    #exam-container { padding-bottom: 90px; }
    
    /* Tối giản padding và border trên di động để mở rộng diện tích */
    .content-container { padding: 0; }
    .exam-board-desktop { padding: 15px 10px; border: none; border-radius: 0; box-shadow: none; margin-bottom: 10px; }
    .question-card { padding: 15px 10px; border: none; border-radius: 0; box-shadow: none; border-bottom: 1px solid #f1f5f9; }
    .options { gap: 8px; }
    .option-label { padding: 12px 10px; border-radius: 6px; }
    .mobile-exam-header { padding: 10px 10px 5px 10px; margin-bottom: 10px; border: none; }
}

/* Grid Bottom Sheet */
.grid-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 1000;
    opacity: 0; visibility: hidden; transition: 0.3s ease;
}
.question-grid-wrapper {
    background: white; border-radius: 8px; border: 1px solid #f1f5f9; flex: 0 0 320px; box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
@media (max-width: 899px) {
    .question-grid-wrapper {
        position: fixed; bottom: -100%; left: 0; right: 0;
        margin: 0; border: none; border-radius: 16px 16px 0 0;
        padding: 0; background: white; z-index: 1001;
        transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
        box-shadow: 0 -5px 20px rgba(0,0,0,0.15);
        max-height: 85vh; display: flex; flex-direction: column;
    }
    .grid-overlay.show-mobile { opacity: 1; visibility: visible; }
    .question-grid-wrapper.show-mobile { bottom: 0; }
    .grid-sheet-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid #e2e8f0; }
    .grid-sheet-header h3 { margin: 0; font-size: 18px; color: #000000; font-weight: 800;}
    .btn-close-grid { background: none; border: none; font-size: 20px; color: #64748b; cursor: pointer; }
    .question-grid { overflow-y: auto; padding: 25px 20px; border: none; justify-content: center; align-content: flex-start; gap: 18px;}
    .question-grid.grid-accordion-mode { padding: 0; }
}

/* Dark mode cho Mobile Tools */
body.dark-mode .mobile-exam-header { background: #0f172a; border-color: #334155; }
body.dark-mode .mobile-exam-header .exam-title { color: #f1f5f9; }
body.dark-mode .mobile-progress-wrapper { background: #334155; }
body.dark-mode .mobile-bottom-bar { background: #0f172a; border-color: #334155; }
body.dark-mode .bottom-grid-btn { background: #000000; border-color: #3b82f6; color: #60a5fa;}

/* ================= CHẾ ĐỘ HỌC TẬP TƯƠNG TÁC (STUDY MODE) ================= */
body.study-mode .timer-wrapper,
body.study-mode #grid-wrapper,
body.study-mode .grid-overlay,
body.study-mode .mobile-bottom-bar,
body.study-mode .mobile-exam-header,
body.study-mode .nav-buttons,
body.study-mode .submit-big-btn {
    display: none !important;
}

body.study-mode #active-exam-title {
    color: #0ea5e9;
    text-align: center;
    width: 100%;
    background-color: #e0f2fe;
    padding: 10px;
    border-radius: 8px;
    border: none;
    box-shadow: none;
}

body.dark-mode.study-mode #active-exam-title {
    background-color: #0f172a;
    color: #38bdf8;
    border: 1px solid #334155;
}

/* ================= CHẾ ĐỘ THI THỰC TẾ (EXAM MODE) ================= */
/* Khi bắt đầu thi (không phải study mode), tự động ẩn Chat và Widget Nhạc */
body.exam-in-progress #harmony-chat-container,
body.exam-in-progress #healing-widget-container {
    display: none !important;
}

/* ================= TỐI ƯU GIAO DIỆN DI ĐỘNG (MOBILE LAYOUT) ================= */
@media (max-width: 899px) {
    .content-container {
        padding: 5px 10px; /* Giảm padding tổng trên điện thoại */
    }
    .question-card { 
        padding: 15px 12px; /* Mở rộng thẻ câu hỏi ra gần sát viền */
        border-radius: 8px; 
    }
    .option-label {
        padding: 12px 10px; /* Giảm nhẹ padding thẻ đáp án để tiết kiệm ngang */
    }
    /* Giao diện Học trên Di động không cần margin-bottom lớn vì không có bottom bar */
    body.study-mode #exam-container { 
        padding-bottom: 20px !important; 
    }
}
body.dark-mode .question-grid-wrapper { background: #0f172a; border-color: #334155; }
body.dark-mode .grid-sheet-header { border-color: #334155; }
body.dark-mode .grid-sheet-header h3 { color: #f1f5f9; }

/* ================= CONFIRM MODAL ================= */
.confirm-box { background: white; padding: 40px 30px; border-radius: 12px; text-align: center; width: 90%; max-width: 400px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.confirm-icon { display: inline-flex; justify-content: center; align-items: center; width: 80px; height: 80px; border: 4px solid #fbd38d; border-radius: 50%; color: #f6ad55; font-size: 40px; margin-bottom: 20px; }
.confirm-box h2 { font-size: 22px; color: #0f172a; margin-bottom: 10px; }
.confirm-box p { color: #64748b; margin-bottom: 25px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.btn-confirm-yes { background: #3b82f6; color: white; border: none; padding: 12px 20px; border-radius: 6px; font-weight: bold; cursor: pointer; flex: 1; font-size: 16px; transition: 0.2s;}
.btn-confirm-yes:hover { background: #2563eb; }
.btn-confirm-no { background: #ef4444; color: white; border: none; padding: 12px 20px; border-radius: 6px; font-weight: bold; cursor: pointer; flex: 1; font-size: 16px; transition: 0.2s;}
.btn-confirm-no:hover { background: #dc2626; }

/* ================= RESULT VIEW ================= */
#result-details-container { background: white; border-radius: 8px; border: 1px solid #e2e8f0; padding: 30px; margin-bottom: 30px; }
.result-banner { padding: 15px; text-align: center; border-radius: 8px; font-size: 22px; font-weight: bold; margin-bottom: 20px; text-transform: uppercase; }
.result-banner.fail { background: #fecdd3; color: #881337; }
.result-banner.pass { background: #dcfce7; color: #14532d; }
.result-score-summary { text-align: center; font-size: 18px; color: #334155; margin-bottom: 20px; }
.result-advice { background: #e0f2fe; color: #0369a1; padding: 15px; border-radius: 6px; margin-bottom: 25px; border-left: 4px solid #3b82f6; }
.result-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.result-buttons .btn { flex: 1; min-width: 150px; font-size: 14px; text-align: center; padding: 12px; }
.btn-cyan { background: #06b6d4; color: white; transition: 0.2s;}
.btn-cyan:hover { background: #0891b2; }
.btn-yellow { background: #eab308; color: white; transition: 0.2s;}
.btn-yellow:hover { background: #ca8a04; }

.result-review-title { text-align: center; font-size: 24px; font-weight: bold; color: #0f172a; margin-bottom: 25px; border-top: 1px solid #e2e8f0; padding-top: 30px; }
.result-q-card { border: 1px solid #cbd5e1; border-radius: 8px; margin-bottom: 25px; overflow: hidden; background: white; }
.rq-header { padding: 15px 20px; color: white; display: block; font-size: 16px; line-height: 1.5; }
.rq-header.correct { background: #22c55e; }
.rq-header.wrong { background: #ef4444; }
.rq-badge-liet { background: white; color: #ef4444; padding: 2px 8px; border-radius: 4px; font-size: 12px; white-space: nowrap; font-weight: 800; border: 1px solid #fca5a5; display: inline-block; margin: 0 5px; vertical-align: top;}
.rq-body { padding: 20px; }
.rq-option { padding: 12px 15px; margin-bottom: 10px; border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc; font-size: 15px; color: #334155; display: flex; align-items: center; }
.rq-option.chosen-correct { background: #22c55e; color: white; border-color: #22c55e; font-weight: bold; }
.rq-option.chosen-wrong { background: #ef4444; color: white; border-color: #ef4444; font-weight: bold; }
.rq-option.true-correct { background: #dcfce7; border-color: #22c55e; color: #166534; font-weight: bold; }
.rq-icon { margin-left: auto; font-size: 18px; }
.rq-expl { margin-top: 20px; padding: 15px; background: #f1f5f9; border-radius: 6px; border-left: 4px solid #64748b; font-size: 14px; color: #475569; }
.rq-expl strong { color: #000000; }

/* Dark mode overrides for Result View */
body.dark-mode .confirm-box { background: #0f172a; }
body.dark-mode .confirm-box h2 { color: #f1f5f9; }
body.dark-mode #result-details-container { background: transparent; border-color: transparent; padding: 0;}
body.dark-mode .result-banner.fail { background: #7f1d1d; color: #fecdd3; }
body.dark-mode .result-banner.pass { background: #14532d; color: #bbf7d0; }
body.dark-mode .result-score-summary { color: #cbd5e1; }
body.dark-mode .result-advice { background: #0c4a6e; color: #bae6fd; border-left-color: #38bdf8; }
body.dark-mode .result-review-title { color: #f8fafc; border-top-color: #334155; }
body.dark-mode .result-q-card { background: #0f172a; border-color: #334155; }
body.dark-mode .rq-badge-liet { background: #7f1d1d; color: white; border-color: #991b1b; }
body.dark-mode .rq-option { background: #334155; border-color: #475569; color: #e2e8f0; }
body.dark-mode .rq-option.true-correct { background: #14532d; color: #bbf7d0; border-color: #22c55e; }
body.dark-mode .rq-expl { background: #000000; border-left-color: #94a3b8; color: #cbd5e1; }
body.dark-mode .rq-expl strong { color: #f8fafc; }

/* Tối giản border và padding trên thiết bị di động cho màn hình Kết Quả */
@media (max-width: 768px) {
    #result-details-container { padding: 15px 10px; border: none; border-radius: 0; background: transparent; }
    .result-banner { padding: 12px; font-size: 18px; text-transform: none; margin-bottom: 15px; }
    .result-buttons { flex-direction: column; gap: 8px; }
    .result-buttons .btn { width: 100%; min-width: 100%; font-size: 16px; padding: 12px; }
    .result-q-card { border: none; box-shadow: 0 1px 4px rgba(0,0,0,0.1); margin-bottom: 15px; border-radius: 8px; }
    .rq-header { padding: 12px 15px; font-size: 15px; display: block; }
    .rq-body { padding: 10px 10px 15px 10px; }
    .rq-option { padding: 10px; font-size: 14px; margin-bottom: 8px; }
    .rq-badge-liet { display: inline-block; margin: 0 5px; vertical-align: bottom;}
} 

/* LMS History Styling */
.hist-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.hist-row:last-child { border-bottom: none; }
.hist-time { color: #64748b; font-size: 14px; min-width: 140px; }
.hist-name { font-weight: 600; color: #334155; flex: 1; }
.hist-name span { color: #94a3b8; font-weight: 400; font-size: 13px; margin-left: 5px;}
.hist-badge { padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: bold; color: white; display: inline-block; white-space: nowrap; }
.hist-badge.pass { background: #22c55e; }
.hist-badge.fail { background: #ef4444; }

.hist-empty { text-align: center; padding: 40px 20px; border: 1px solid #e2e8f0; border-radius: 8px; margin: 20px 0; background: #fff;}
.hist-empty-icon { font-size: 40px; margin-bottom: 15px; }
.hist-empty h3 { font-size: 18px; color: #0f172a; margin-bottom: 10px; }
.hist-empty p { color: #64748b; font-size: 14px; line-height: 1.5; margin-bottom: 20px; max-width: 400px; margin-left: auto; margin-right: auto;}

.hist-modal { width: 340px; padding: 30px; text-align: center; }
.hist-icon-warning { font-size: 40px; color: #ea580c; border: 3px solid #ffedd5; width: 80px; height: 80px; border-radius: 50%; line-height: 74px; margin: 0 auto 20px; font-weight: bold; }
.hist-icon-success { width: 80px; height: 80px; margin: 0 auto 20px; }
.hist-icon-success svg { width: 100%; height: 100%; stroke: #22c55e; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.hist-icon-success svg circle { stroke: #bbf7d0; stroke-width: 4; }
.hist-modal h2 { font-size: 20px; color: #0f172a; margin-bottom: 10px; font-weight: bold;}
.hist-modal p { font-size: 14px; color: #64748b; margin-bottom: 20px; line-height:1.5;}

body.dark-mode .hist-row { border-bottom-color: #334155; }
body.dark-mode .hist-time { color: #94a3b8; }
body.dark-mode .hist-name { color: #e2e8f0; }
body.dark-mode .hist-empty { border-color: #0f172a; background: transparent; }
body.dark-mode .hist-empty h3 { color: #f1f5f9; }
body.dark-mode .hist-modal h2 { color: #f1f5f9; }
body.dark-mode .hist-icon-warning { color: #fb923c; border-color: #9a3412;}

@media (max-width: 480px) {
    .hist-row { flex-wrap: wrap; gap: 5px; justify-content: space-between; align-items: center;}
    .hist-time { min-width: auto; margin-bottom: 0px; font-size: 13px;}
    .hist-name { font-size: 13px;}
    .hist-badge { margin-left: auto; font-size: 11px;}
}

/* --- BÌNH LUẬN --- */
.comment-section { max-width: 1200px; margin: 40px auto; padding: 0 10px; border-top: 1px solid #e2e8f0; padding-top: 40px; }
.comment-title { text-align: center; margin-bottom: 20px; font-size: 22px; color: #0f172a;}
.comment-form-container { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px; margin-bottom: 30px;}
.comment-form { display: flex; gap: 15px; }
.comment-avatar img { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; }
.comment-input-area { flex: 1; }
.comment-input-area textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; padding: 12px; font-family: inherit; font-size: 14px; resize: vertical; box-sizing: border-box; outline: none; transition: border-color 0.2s;}
.comment-input-area textarea:focus { border-color: #3b82f6;}
.cmt-file-label { margin-top: 10px; display: inline-block; font-size: 13px; }
.cmt-status-text { font-size: 13px; color: #64748b; }
.cmt-status-text i { margin-right: 5px; }

.comment-list { display: flex; flex-direction: column; gap: 20px; }
.cmt-item { display: flex; gap: 15px; padding-bottom: 20px; border-bottom: 1px solid #f1f5f9; }
.cmt-item:last-child { border-bottom: none; }
.cmt-content-box { flex: 1; min-width: 0; }
.cmt-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 5px; margin-bottom: 5px;}
.cmt-username { font-weight: 600; color: #2563eb; font-size: 15px; display: flex; align-items: center; flex-wrap: wrap; gap: 5px;}
.cmt-badge { font-size: 11px; background: #e0f2fe; color: #0369a1; padding: 2px 6px; border-radius: 4px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center;}
.cmt-time { font-size: 12px; color: #475569; white-space: nowrap;}
.cmt-text { font-size: 14px; line-height: 1.5; color: #334155; margin-bottom: 5px; white-space: pre-wrap; word-wrap: break-word;}
.cmt-image { max-width: 100%; max-height: 300px; border-radius: 8px; cursor: zoom-in; object-fit: cover; border: 1px solid #e2e8f0; transition: opacity 0.2s; margin-bottom: 10px;}
.cmt-image:hover { opacity: 0.8; }

/* Các nút Like, Reply trong comment */
.cmt-actions { display: flex; align-items: center; gap: 15px; margin-top: 5px; }
.cmt-action-btn { background: none; border: none; font-size: 13px; font-weight: 600; color: #64748b; cursor: pointer; display: flex; align-items: center; gap: 5px; padding: 0; }
.cmt-action-btn:hover { text-decoration: underline; color: #3b82f6; }
.cmt-action-btn.active { color: #3b82f6; cursor: default; }
.cmt-action-btn.active:hover { text-decoration: none; }
.cmt-like-count { background: #e0f2fe; color: #0369a1; border-radius: 12px; padding: 2px 8px; font-size: 11px; margin-left: -5px; }

/* Bình luận cấp 2 (Reply) */
.cmt-replies { margin-top: 10px; border-left: 2px solid #e2e8f0; padding-left: 15px; display: none; flex-direction: column; gap: 15px; }
.cmt-replies.show { display: flex; }
.cmt-reply-toggle { background: none; border: none; font-size: 13px; font-weight: 600; color: #475569; cursor: pointer; margin-top: 8px; display: flex; align-items: center; gap: 5px; padding: 0; }
.cmt-reply-toggle:hover { text-decoration: underline; }

.cmt-reply-form { margin-top: 15px; display: none; }
.cmt-reply-form.show { display: block; }
.cmt-reply-form textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px; font-size: 13px; outline: none; margin-bottom: 8px; }
.cmt-reply-form .btn-submit-reply { background: #3b82f6; color: white; border: none; padding: 6px 12px; font-size: 13px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.cmt-reply-form .btn-cancel-reply { background: transparent; color: #64748b; border: none; padding: 6px; font-size: 13px; cursor: pointer; margin-left: 10px; }

/* Load More Button */
.btn-load-more-cmt { background: white; border: 1px solid #3b82f6; color: #3b82f6; font-size: 14px; font-weight: 600; padding: 10px 20px; border-radius: 20px; cursor: pointer; transition: 0.2s; display: inline-block; margin: 20px auto 0 auto; }
.btn-load-more-cmt:hover { background: #EFF6FF; }
.cmt-load-container { text-align: center; }

/* Lightbox */
.lightbox-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.85); z-index: 9999; display: flex; justify-content: center; align-items: center; cursor: zoom-out; }
.lightbox-overlay img { max-width: 95vw; max-height: 95vh; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); object-fit: contain;}

@media (max-width: 480px) {
    .comment-form { flex-direction: column; }
    .comment-avatar { display: none; }
    .comment-input-area > div[style] { flex-direction: column; gap: 10px; align-items: stretch !important;}
}

/* ================= CHẾ ĐỘ HỌC TẬP TƯƠNG TÁC ================= */
.learning-banner {
    background: linear-gradient(90deg, #187cf2, #00d2ff); 
    color: white; 
    border-radius: 8px; 
    text-align: center; 
    padding: 20px 15px; 
    margin-top: 10px;
    margin-bottom: 20px; 
    font-weight: 800; 
    font-size: calc(24px * var(--app-font-scale));
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(24,119,242,0.2); 
}
.learning-progress-box {
    background: white; 
    border: 1px solid #cbd5e1; 
    border-radius: 8px; 
    padding: 20px; 
    margin-bottom: 25px;
}
.learning-progress-text-row {
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 12px; 
    font-weight: 700; 
    font-size: calc(18px * var(--app-font-scale));
    color: #0f172a;
}
.learning-progress-bar-bg {
    height: 8px; 
    border-radius: 4px; 
    background: #e2e8f0;
    overflow: hidden;
}
.learning-progress-fill {
    height: 100%; 
    background: #2563eb; 
    width: 0%;
    transition: width 0.3s ease;
}

/* ================= LEADERBOARD WIDGET ================= */
.lbs-container {
    background-color: #eaf4ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.lbs-title {
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    color: #0f172a;
    margin-bottom: 15px;
    margin-top: 0;
}

.lbs-filter-group {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 20px;
}

.lbs-btn {
    background: transparent;
    border: 1px solid #93c5fd;
    color: #1d4ed8;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.lbs-btn:first-child {
    border-radius: 4px 0 0 4px;
}
.lbs-btn:not(:first-child) {
    border-left: none;
}
.lbs-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.lbs-btn.active {
    background: #1d4ed8;
    color: white;
    border-color: #1d4ed8;
}

.lbs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lbs-item {
    background: white;
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: 0.2s;
}

.lbs-item:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.lbs-rank-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 15px;
    flex-shrink: 0;
}

.lbs-rank-medal {
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #bfdbfe;
    background: #f8fafc;
}

.lbs-rank-1 { color: #f59e0b; border-color: #fcd34d; background: #fffbeb;}
.lbs-rank-2 { color: #94a3b8; border-color: #cbd5e1; background: #f8fafc;}
.lbs-rank-3 { color: #b45309; border-color: #fed7aa; background: #fff7ed;}

.lbs-rank-other {
    background-color: #94a3b8;
    color: white;
}

.lbs-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-left: 20px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}

.lbs-username {
    font-weight: 600;
    color: #000000;
    font-size: 15px;
    margin-left: 20px;
}

.lbs-score {
    margin-left: auto;
    font-weight: 800;
    color: #2563eb;
    font-size: 16px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .lbs-list { gap: 14px; }
    .lbs-item { padding: 14px 10px; gap: 8px; }
    .lbs-rank-circle, .lbs-rank-medal { width: 30px; height: 30px; font-size: 14px; }
    .lbs-avatar { margin-left: 0; width: 35px; height: 35px; }
    .lbs-username { margin-left: 0; font-size: 13px; flex: 1; min-width: 0; }
    .lbs-score { font-size: 14px; }
}

body.dark-mode .lbs-container {
    background-color: #0f172a;
    border-color: #334155;
}
body.dark-mode .lbs-title {
    color: #f8fafc;
}
body.dark-mode .lbs-item {
    background-color: #000000;
    border: 1px solid #334155;
}
body.dark-mode .lbs-username {
    color: #e2e8f0;
}
body.dark-mode .lbs-score {
    color: #60a5fa;
}
body.dark-mode .lbs-rank-medal {
    background-color: #0f172a;
    border-color: #475569;
}
body.dark-mode .lbs-btn {
    border-color: #475569;
}

/* Custom Lightweight Toast Notification */
.custom-toast {
    visibility: hidden;
    min-width: 250px;
    max-width: 80%;
    margin-left: -125px;
    background-color: #334155;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 999999;
    left: 50%;
    bottom: 30px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s, visibility 0.3s;
    transform: translateX(-50%);
    margin-left: 0;
}

.custom-toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 90px;
}

/* ================= RESPONSIVE YOUTUBE / IFRAME ================= */
iframe {
    max-width: 100%;
    border-radius: 8px;
}
.content-container iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

/* Nút Hướng dẫn sử dụng & Modal */
body.dark-mode .btn-guide { background-color: #1e293b !important; color: #f1f5f9 !important; border-color: #475569 !important; }
body.dark-mode .btn-guide-primary { border-color: #3b82f6 !important; color: #93c5fd !important; }
body.dark-mode .btn-guide-info { border-color: #0ea5e9 !important; color: #7dd3fc !important; }
body.dark-mode .btn-guide-warning { border-color: #eab308 !important; color: #fde047 !important; }
body.dark-mode .btn-guide-success { border-color: #22c55e !important; color: #86efac !important; }
body.dark-mode .btn-guide[style*="#b91c1c"] { border-color: #ef4444 !important; color: #fca5a5 !important; }

/* Bình luận, chứa text, reply và input file */
body.dark-mode .comment-form-container { background-color: #0f172a !important; border-color: #334155 !important; }
body.dark-mode #cmt-content, body.dark-mode .cmt-reply-form textarea { background-color: #1e293b !important; color: #f8fafc !important; border-color: #475569 !important; }
body.dark-mode .cmt-text { color: #cbd5e1 !important; }
body.dark-mode .cmt-time { color: #94a3b8 !important; }
body.dark-mode input[type="file"] { color: #f1f5f9 !important; }

/* Tin nhắn donate của người dùng trong Leaderboard */
body.dark-mode .donor-row div[style*="background:#f8fafc"] { background-color: #1e293b !important; color: #cbd5e1 !important; border-left-color: #3b82f6 !important; }

/* Các nút button xanh/trắng */
body.dark-mode .btn-blue { background-color: #3b82f6 !important; color: #ffffff !important; border-color: #3b82f6 !important; }
body.dark-mode .btn-outline { background-color: #1e293b !important; color: #3b82f6 !important; border-color: #3b82f6 !important; }
body.dark-mode .btn-outline:hover { background-color: #3b82f6 !important; color: #fff !important; }

/* Bảng vinh danh Leaderboard */
body.dark-mode .leaderboard-box,
body.dark-mode .leaderboard-box[style*="#ecfdf5"],
body.dark-mode #leaderboard-footer,
body.dark-mode #leaderboard-footer[style*="#ecfdf5"] { background-color: #0f172a !important; border-color: #334155 !important; }
body.dark-mode .lb-tab { background-color: transparent !important; color: #94a3b8 !important; border-color: #334155 !important; }
body.dark-mode .lb-tab.active { background-color: #2563eb !important; color: #fff !important; border-color: #2563eb !important; }
body.dark-mode .leaderboard-box p[style*="color"] { color: #94a3b8 !important; }

/* Footer SEO và Version Button */
body.dark-mode .seo-footer-section { background-color: #0f172a !important; border-color: #334155 !important; }
body.dark-mode .seo-desc { color: #cbd5e1 !important; }
body.dark-mode .seo-accordion-header { background-color: #1e293b !important; color: #f1f5f9 !important; border-bottom-color: #334155 !important; }
body.dark-mode .seo-accordion-header:hover { background-color: #334155 !important; }
body.dark-mode .seo-province-grid a { background-color: #1e293b !important; color: #cbd5e1 !important; border-color: #334155 !important; }
body.dark-mode .seo-province-grid a:hover { background-color: #2563eb !important; color: #ffffff !important; border-color: #2563eb !important; }
body.dark-mode .footer-version-btn { background-color: #1e293b !important; color: #cbd5e1 !important; }
body.dark-mode .footer-version-btn:hover { background-color: #334155 !important; }

/* Wrapper Thanh Header trên cùng */
body.dark-mode .top-header { background-color: #0f172a !important; border-bottom-color: #334155 !important; }
body.dark-mode .nav-container { background-color: #0f172a !important; border-color: #334155 !important; }

/* Wrapper Menu Mobile điều hướng bên dưới */
body.dark-mode .mobile-bottom-nav { background-color: #0f172a !important; border-top-color: #334155 !important; }
body.dark-mode .mobile-bottom-nav .nav-btn { color: #94a3b8 !important; background-color: transparent !important; }
body.dark-mode .mobile-bottom-nav .nav-btn:hover { color: #f1f5f9 !important; }
body.dark-mode #mobileMenuContainer > div { background-color: #1e293b !important; border-color: #334155 !important; }
body.dark-mode #mobileMenuContainer h3 { color: #f1f5f9 !important; }
body.dark-mode .qnav-item { color: #cbd5e1 !important; background-color: transparent !important; border-bottom-color: #1e293b !important; }
body.dark-mode .qnav-item:hover { background-color: #334155 !important; color: #f1f5f9 !important; }

/* Giao diện Lịch Sử Cập Nhật (Release Notes) */
body.dark-mode #releaseNotesModal > div { background-color: #0f172a !important; }
body.dark-mode #releaseNotesModal h3 { color: #f1f5f9 !important; }
body.dark-mode #releaseNotesModal button { background-color: #1e293b !important; color: #94a3b8 !important; }
body.dark-mode .rn-timeline-item { border-left-color: #334155 !important; }
body.dark-mode .rn-timeline-dot { background-color: #1e293b !important; border-color: #0f172a !important; }
body.dark-mode .rn-v-title { color: #f1f5f9 !important; }
body.dark-mode .rn-v-date { color: #94a3b8 !important; }
body.dark-mode .rn-v-features, body.dark-mode .rn-v-features li { color: #cbd5e1 !important; }
body.dark-mode .rn-badge-coming { background-color: #451a03 !important; color: #fcd34d !important; }
body.dark-mode .rn-badge-latest { background-color: #1e3a8a !important; color: #93c5fd !important; }

/* FENGSHUI CSS */
.fengshui-box {
    background: #fdfbf7;
    border: 2px solid #eab308;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(234, 179, 8, 0.1);
    position: relative;
    overflow: hidden;
}
.fengshui-title {
    font-size: 22px;
    font-weight: 800;
    color: #b45309;
    text-align: center;
    margin-bottom: 20px;
    text-transform: uppercase;
}
.fs-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}
.fs-tab-btn {
    background: white;
    border: 1px solid #fcd34d;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 700;
    color: #b45309;
    cursor: pointer;
    transition: 0.2s;
}
.fs-tab-btn.active {
    background: #b45309;
    color: white;
    border-color: #b45309;
}

/* Tab contents */
.fs-content { display: none; text-align: center; min-height: 350px; }
.fs-content.active { display: flex; flex-direction: column; justify-content: center; align-items: center; animation: fadeIn 0.4s; }
.fs-content > p { width: 100%; margin-top: 0; }

/* 1. Rút Quẻ */
.xam-container { display: inline-block; cursor: pointer; transition: 0.2s; }
.xam-container:hover { transform: scale(1.05); }
.xam-box { font-size: 80px; display: inline-block; }
.shaking { animation: shake 0.5s infinite; }
.que-result { margin-top: 20px; width: 100%; box-sizing: border-box; padding: 15px; border: 2px dashed #f59e0b; border-radius: 8px; background: #fffbeb; font-size: 16px; font-weight: 600; color: #92400e; display: none; }

/* 2. Vòng Quay */
.wheel-wrapper { position: relative; width: 250px; height: 250px; margin: 0 auto; border-radius: 50%; border: 4px solid #f59e0b; overflow: hidden; box-shadow: 0 0 15px rgba(245, 158, 11, 0.3); }
.wheel { width: 100%; height: 100%; border-radius: 50%; transition: transform 4s cubic-bezier(0.175, 0.885, 0.32, 1.1); transform: rotate(0deg); }
.wheel-pointer { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-size: 30px; color: #dc2626; z-index: 10; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.wheel-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 50px; height: 50px; background: white; border-radius: 50%; border: 3px solid #f59e0b; display: flex; align-items: center; justify-content: center; font-weight: bold; cursor: pointer; z-index: 5; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); color: #d97706; }
.wheel-center:hover { background: #fef3c7; }
.wheel-result { margin-top: 20px; font-weight: 700; color: #b45309; font-size: 18px; min-height: 25px; }

/* 3. Bói Giờ Tốt */
.boi-form { display: flex; gap: 10px; justify-content: center; margin-bottom: 15px; flex-wrap: wrap; width: 100%; }
.boi-form select { padding: 10px; border-radius: 6px; border: 1px solid #fcd34d; font-size: 15px; outline: none; }
.boi-btn { background: #d97706; color: white; padding: 10px 20px; border: none; border-radius: 6px; font-weight: 700; cursor: pointer; }
.boi-btn:hover { background: #b45309; }
.boi-result { width: 100%; box-sizing: border-box; background: #fefce8; border-left: 4px solid #eab308; padding: 15px; text-align: left; font-size: 15px; color: #78350f; line-height: 1.6; display: none; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shake { 0% { transform: rotate(0deg); } 25% { transform: rotate(-10deg); } 50% { transform: rotate(0deg); } 75% { transform: rotate(10deg); } 100% { transform: rotate(0deg); } }

/* Dark mode overrides */
body.dark-mode .fengshui-box { background: #1e293b; border-color: #475569; }
body.dark-mode .fengshui-title { color: #fef08a; }
body.dark-mode .fs-tab-btn { background: #334155; color: #cbd5e1; border-color: #475569; }
body.dark-mode .fs-tab-btn.active { background: #ca8a04; color: #1e293b; border-color: #ca8a04; }
body.dark-mode .que-result { background: #422006; color: #fde047; border-color: #b45309; }
body.dark-mode .wheel-wrapper { border-color: #ca8a04; }
body.dark-mode .wheel-center { background: #1e293b; color: #fde047; border-color: #ca8a04; }
body.dark-mode .boi-form select { background: #334155; color: #f1f5f9; border-color: #475569; }
body.dark-mode .boi-result { background: #422006; color: #fde047; border-color: #ca8a04; }

/* HEALING CSS */
/* healing.css */
#healing-widget-container {
    position: fixed;
    left: 20px;
    bottom: 20vh;
    z-index: 10000;
    font-family: inherit;
    transition: all 0.3s;
}

#healing-toggle-btn {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    outline: none;
}
#healing-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}
#healing-toggle-btn .music-note {
    animation: float-note 3s infinite ease-in-out;
}
#healing-toggle-btn.playing {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}
#healing-toggle-btn.playing .music-note {
    animation: spin-pulse 2s infinite linear;
}

@keyframes float-note {
    0% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}
@keyframes spin-pulse {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

#healing-menu {
    position: absolute;
    left: calc(100% + 15px);
    right: auto;
    bottom: 0px;
    background: white;
    border-radius: 12px;
    padding: 10px;
    width: 220px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border: 1px solid #e2e8f0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px) translateY(10px) scale(0.9);
    transform-origin: bottom left;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
#healing-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) translateY(0) scale(1);
    pointer-events: auto;
}

.healing-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #cbd5e1;
    text-align: center;
}

.healing-opt {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 600;
    font-size: 14px;
    color: #475569;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    margin-bottom: 5px;
}
.healing-opt:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.healing-opt.active {
    background: #ecfdf5;
    color: #059669;
}
.healing-opt.off.active {
    background: #fef2f2;
    color: #dc2626;
}

.healing-opt i {
    width: 20px;
    margin-right: 8px;
    text-align: center;
    font-size: 16px;
}

/* Audio waves visualizer */
.audio-waves {
    display: none;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    height: 15px;
    margin-left: auto;
}
.healing-opt.active .audio-waves {
    display: flex;
}
.wave-bar {
    width: 3px;
    background-color: #059669;
    border-radius: 2px;
    animation: wave-bounce 1s infinite ease;
}
.wave-bar:nth-child(1) { height: 60%; animation-delay: 0.1s; }
.wave-bar:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.wave-bar:nth-child(3) { height: 40%; animation-delay: 0.3s; }

@keyframes wave-bounce {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}

@media (max-width: 768px) {
    #healing-widget-container { left: 15px; bottom: 120px; } /* Đẩy lên tránh che Bottom Nav */
}
