@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* === HIDE ALL SCROLLBARS GLOBALLY === */
html,
body,
*,
*::before,
*::after {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

::-webkit-scrollbar,
*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* Ẩn navbar HUITQuiz và footer khi vào chế độ làm bài kiểm tra */
body.quiz-mode-active .navbar,
body.quiz-mode-active .footer,
body.quiz-mode-active footer,
body.quiz-body .navbar,
body.quiz-body .footer,
body.quiz-body footer {
    display: none !important;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: #f5f7fb;
    color: #1a1a2e;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* === NAVBAR === */
.navbar {
    background: #fff;
    border-bottom: 2px solid #1a3a7a;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 16px;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.navbar-logo:hover {
    opacity: 0.95;
}

.navbar-logo img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.08));
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.navbar-logo:hover img {
    transform: scale(1.05) rotate(-3deg);
}

.navbar-logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.navbar-logo span,
.navbar-logo .logo-brand {
    font-weight: 800;
    font-size: 1.15rem;
    color: #1a3a7a;
    line-height: 1.1;
    letter-spacing: -0.2px;
}

.navbar-logo small,
.navbar-logo .logo-author {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1;
    white-space: nowrap;
    margin-top: 1px;
}

.navbar-logo .author-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #3b82f6;
    display: inline-block;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.7);
    flex-shrink: 0;
}

.navbar-logo .author-name,
.navbar-logo small strong {
    font-weight: 600;
    color: #1a3a7a;
    background: rgba(26, 58, 122, 0.07);
    padding: 1.5px 6px;
    border-radius: 4px;
    border: 1px solid rgba(26, 58, 122, 0.1);
    letter-spacing: 0.1px;
    transition: all 0.2s ease;
}

.navbar-logo:hover .author-name,
.navbar-logo:hover small strong {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.25);
    color: #1d4ed8;
}

.navbar-links {
    display: flex;
    list-style: none;
    gap: 4px;
    margin-left: auto;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
}

.navbar-links::-webkit-scrollbar {
    display: none;
}

.navbar-links li {
    flex-shrink: 0;
    white-space: nowrap;
}

.navbar-links a {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #444;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.navbar-links a svg.nav-icon {
    flex-shrink: 0;
    opacity: 0.85;
}

.navbar-links a:hover {
    background: #eef2ff;
    color: #1a3a7a;
}

.navbar-links a.active {
    background: #1a3a7a;
    color: #fff;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: #e2e8f0;
    transform: scale(1.05);
}

/* Navbar Donate Button */
.btn-navbar-donate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 50px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1.5px solid #fde68a;
    color: #b45309;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-navbar-donate svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.btn-navbar-donate:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    color: #92400e;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.btn-navbar-donate:hover svg {
    transform: rotate(-10deg) scale(1.15);
}

.btn-navbar-donate:active {
    transform: translateY(0);
    box-shadow: none;
}

body.dark-mode .btn-navbar-donate {
    background: rgba(245, 158, 11, 0.12);
    border: 1.5px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.dark-mode .btn-navbar-donate:hover {
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.55);
    color: #fef08a;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

@media (max-width: 768px) {
    .btn-navbar-donate {
        height: 32px;
        padding: 0 10px;
        font-size: 12px;
        gap: 4px;
    }
}

.menu-toggle {
    display: none;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.menu-toggle:hover {
    background: #e2e8f0;
    transform: scale(1.05);
}

/* === CONTAINER === */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === HERO === */
.hero {
    text-align: center;
    padding: 48px 0 32px;
}

.hero img {
    width: 100px;
    height: 100px;
    margin-bottom: 16px;
}

.hero h1 {
    font-size: 1.8rem;
    color: #1a3a7a;
    margin-bottom: 8px;
}

.hero p {
    color: #555;
    font-size: 1rem;
    max-width: 550px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f0f7ff;
    border: 1px solid #cce3ff;
    color: #1e3a8a;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    margin: 16px auto 0;
    max-width: 680px;
    line-height: 1.45;
    box-shadow: 0 2px 6px rgba(26, 58, 122, 0.05);
}

.hero-badge-icon {
    font-size: 0.95rem;
    flex-shrink: 0;
}

.hero-badge strong {
    color: #1a3a7a;
    font-weight: 600;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 24px;
}

.stat {
    text-align: center;
}

.stat-num {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a3a7a;
}

.stat-label {
    font-size: 0.8rem;
    color: #777;
}

/* === ADBLOCK BANNER (SUBJECT PAGES) === */
.adblock-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fefce8;
    border: 1px solid #fef08a;
    border-left: 4px solid #eab308;
    color: #713f12;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.83rem;
    margin-top: 16px;
    margin-bottom: 24px;
    line-height: 1.45;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.adblock-banner-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.adblock-banner strong {
    color: #854d0e;
    font-weight: 600;
}

/* === UPDATE BANNER & BADGES === */
.update-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #22c55e;
    color: #166534;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.83rem;
    margin-top: 12px;
    margin-bottom: 24px;
    line-height: 1.45;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.update-banner-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.update-banner strong {
    color: #15803d;
    font-weight: 600;
}

.badge-updated {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #15803d;
    background: #dcfce7;
    border: 1px solid #86efac;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

/* === SECTION === */
.section {
    padding: 40px 0;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a3a7a;
    margin-bottom: 8px;
}

.section-desc {
    color: #666;
    margin-bottom: 24px;
}

.divider {
    width: 50px;
    height: 3px;
    background: #1a3a7a;
    border-radius: 2px;
    margin-bottom: 24px;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.subject-card {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    height: 100%;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.subject-card:hover {
    border-color: #2563eb;
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.12);
    transform: translateY(-4px);
}

.card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.card-icon.triet,
.page-header .icon.triet {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.card-icon.ktct,
.page-header .icon.ktct {
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.card-icon.cnxh,
.page-header .icon.cnxh {
    background: #fff1f2;
    border: 1px solid #fecdd3;
}

.card-icon.tthcm,
.page-header .icon.tthcm {
    background: #fefce8;
    border: 1px solid #fef08a;
}

.card-icon.lsd,
.page-header .icon.lsd {
    background: #faf5ff;
    border: 1px solid #e9d5ff;
}

.card-icon.qp,
.card-icon.qpan1,
.card-icon.qpan2,
.page-header .icon.qp,
.page-header .icon.qpan1,
.page-header .icon.qpan2 {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.card-icon.quantri,
.card-icon.qth,
.card-icon.qtcl,
.card-icon.qtccu,
.page-header .icon.quantri,
.page-header .icon.qth,
.page-header .icon.qtcl,
.page-header .icon.qtccu {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
}

.card-icon.marketing,
.card-icon.mkt,
.page-header .icon.marketing,
.page-header .icon.mkt {
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.card-icon.kynang,
.card-icon.kngt,
.page-header .icon.kynang,
.page-header .icon.kngt {
    background: #fdf4ff;
    border: 1px solid #f5d0fe;
}

.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

.card-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    min-height: 2.7rem;
    margin-bottom: 6px;
}

.card-body p {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.45;
    min-height: 2.5rem;
    margin-bottom: 16px;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    border-top: 1px dashed #e2e8f0;
    padding-top: 12px;
}

.card-link {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1d4ed8;
    white-space: nowrap;
}

.card-link:hover {
    color: #1e40af;
    text-decoration: underline;
}

.card-count {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

/* === SUBJECT PAGE === */
.page-header {
    padding: 32px 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-header .icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.page-header h1 {
    font-size: 1.5rem;
    color: #1a3a7a;
}

.page-header p {
    font-size: 0.9rem;
    color: #666;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #1a3a7a;
    margin-top: 24px;
    padding: 6px 12px;
    border-radius: 6px;
}

.back-link:hover {
    background: #eef2ff;
}

/* === QUIZ LINKS === */
.quiz-group {
    margin-bottom: 32px;
}

.quiz-group-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a3a7a;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e4ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.chapter-count-tag {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.chapter-count-tag.exam-tag {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fca5a5;
}

.chapter-count-tag.random-tag {
    color: #6b21a8;
    background: #f3e8ff;
    border-color: #d8b4fe;
}

.quiz-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #e0e4ed;
    border-left: 4px solid #1a3a7a;
    border-radius: 8px;
    transition: background 0.15s;
}

.quiz-item:hover {
    background: #f0f4ff;
}

.quiz-item.exam {
    border-left-color: #dc2626;
    background: #fffbfb;
}

.quiz-item.exam:hover {
    background: #fef2f2;
}

.quiz-item.random {
    border-left-color: #8b5cf6;
    background: #faf5ff;
}

.quiz-item.random:hover {
    background: #f3e8ff;
}

.quiz-item-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.quiz-item-info {
    flex: 1;
}

.quiz-item-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.quiz-item-info span {
    font-size: 0.8rem;
    color: #888;
}

.quiz-item-arrow {
    color: #aaa;
    font-size: 1.1rem;
}

.quiz-item:hover .quiz-item-arrow {
    color: #1a3a7a;
}

/* === FEEDBACK (LỜI CẢM ƠN + GÓP Ý) === */
.feedback-title {
    font-size: 1.8rem;
    text-align: center;
    color: #1a3a7a;
}

.feedback-divider {
    margin: 12px auto 20px;
    width: 60px;
}

.feedback-desc {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 32px;
    color: #444;
    font-size: 0.95rem;
    line-height: 1.8;
}

.feedback-subtitle {
    font-style: italic;
    margin-bottom: 12px;
    color: #1a3a7a;
    font-weight: 500;
}

.feedback-form-wrapper {
    background: #fff;
    border: 1px solid #e0e4ed;
    border-radius: 12px;
    overflow: hidden;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* === FOOTER ULTRA ELEGANT DESIGN === */
.footer {
    text-align: center;
    padding: 36px 20px 28px;
    border-top: 1px solid #e2e8f0;
    margin-top: 48px;
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-main {
    color: #334155;
    font-weight: 500;
    margin-bottom: 6px;
}

.footer-main strong {
    color: #1a3a7a;
    font-weight: 700;
}

.footer-sub {
    color: #64748b;
    font-size: 0.82rem;
    margin-bottom: 10px;
}

.footer-meta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 0.76rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 5px 16px;
    border-radius: 20px;
    letter-spacing: 0.2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.footer-meta strong {
    color: #475569;
    font-weight: 600;
}

.footer-dot {
    color: #cbd5e1;
}




/* === RESPONSIVE === */
@media (max-width: 768px) {
    .navbar {
        padding: 0 12px;
        height: 60px;
    }

    .navbar-inner {
        height: 60px;
        gap: 6px;
    }

    .navbar-logo {
        gap: 8px;
        min-width: 0;
        flex-shrink: 1;
    }

    .navbar-logo img {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }

    .navbar-logo-text span,
    .navbar-logo-text .logo-brand {
        font-size: 1rem;
        font-weight: 800;
        white-space: nowrap;
    }

    .navbar-logo small,
    .navbar-logo .logo-author {
        display: inline-flex;
        font-size: 0.62rem;
        gap: 3px;
        white-space: nowrap;
    }

    .navbar-logo .author-name,
    .navbar-logo small strong {
        padding: 1px 4px;
        font-size: 0.62rem;
    }

    .navbar-actions {
        gap: 6px;
        flex-shrink: 0;
    }

    .btn-navbar-donate {
        height: 34px;
        padding: 0 10px;
        font-size: 12px;
        gap: 4px;
        flex-shrink: 0;
    }

    .theme-toggle {
        width: 34px;
        height: 34px;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .menu-toggle {
        display: flex;
        width: 34px;
        height: 34px;
        flex-shrink: 0;
    }

    /* Floating Luxury Dropdown Menu Card */
    .navbar-links {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        left: 12px;
        right: 12px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 8px;
        gap: 4px;
        border-radius: 16px;
        border: 1.5px solid #e2e8f0;
        box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.06);
        margin-left: 0;
        z-index: 1001;
        transform-origin: top center;
    }

    .navbar-links.open {
        display: flex;
        animation: navMenuDropdown 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    @keyframes navMenuDropdown {
        from {
            opacity: 0;
            transform: translateY(-8px) scale(0.98);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    .navbar-links li {
        width: 100%;
    }

    .navbar-links a {
        width: 100%;
        padding: 12px 14px;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 600;
        color: #334155;
        display: flex;
        align-items: center;
        gap: 10px;
        justify-content: flex-start;
        background: transparent;
        transition: all 0.18s ease;
    }

    .navbar-links a svg.nav-icon {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        color: #64748b;
        transition: color 0.18s ease;
    }

    .navbar-links a:hover {
        background: #f1f5f9;
        color: #1a3a7a;
        transform: translateX(3px);
    }

    .navbar-links a:hover svg.nav-icon {
        color: #1a3a7a;
    }

    .navbar-links a.active {
        background: linear-gradient(135deg, #1a3a7a 0%, #2563eb 100%);
        color: #ffffff;
        box-shadow: 0 4px 12px rgba(26, 58, 122, 0.25);
    }

    .navbar-links a.active svg.nav-icon {
        color: #ffffff;
    }

    .subjects-grid {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 16px;
    }

    .page-header {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   DARK MODE STYLES
   ========================================================================== */
body.dark-mode {
    background: #0f172a;
    color: #f1f5f9;
}

body.dark-mode .navbar {
    background: #1e293b;
    border-bottom-color: #3b82f6;
}

body.dark-mode .navbar-logo span,
body.dark-mode .navbar-logo .logo-brand {
    color: #ffffff;
}

body.dark-mode .navbar-logo small,
body.dark-mode .navbar-logo .logo-author {
    color: #94a3b8;
}

body.dark-mode .navbar-logo .author-dot {
    background: #60a5fa;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.8);
}

body.dark-mode .navbar-logo .author-name,
body.dark-mode .navbar-logo small strong {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

body.dark-mode .navbar-logo:hover .author-name,
body.dark-mode .navbar-logo:hover small strong {
    background: rgba(59, 130, 246, 0.25);
    color: #bfdbfe;
}

body.dark-mode .navbar-links a {
    color: #cbd5e1;
}

body.dark-mode .navbar-links a:hover {
    background: #334155;
    color: #93c5fd;
}

body.dark-mode .navbar-links a.active {
    background: #2563eb;
    color: #ffffff;
}

body.dark-mode .theme-toggle {
    background: #334155;
    border-color: #475569;
    color: #fbbf24;
}

body.dark-mode .theme-toggle:hover {
    background: #475569;
}

body.dark-mode .menu-toggle {
    background: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}

@media (max-width: 768px) {
    body.dark-mode .navbar-links {
        background: rgba(30, 41, 59, 0.98);
        border-color: rgba(51, 65, 85, 0.9);
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.25);
    }

    body.dark-mode .navbar-links a {
        color: #cbd5e1;
    }

    body.dark-mode .navbar-links a svg.nav-icon {
        color: #94a3b8;
    }

    body.dark-mode .navbar-links a:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #60a5fa;
        transform: translateX(3px);
    }

    body.dark-mode .navbar-links a:hover svg.nav-icon {
        color: #60a5fa;
    }

    body.dark-mode .navbar-links a.active {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        color: #ffffff;
        box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    }

    body.dark-mode .navbar-links a.active svg.nav-icon {
        color: #ffffff;
    }
}

body.dark-mode .hero h1 {
    color: #60a5fa;
}

body.dark-mode .hero p {
    color: #94a3b8;
}

body.dark-mode .stat-num {
    color: #60a5fa;
}

body.dark-mode .stat-label {
    color: #94a3b8;
}

body.dark-mode .hero-badge {
    background: rgba(30, 58, 138, 0.35);
    border-color: #1d4ed8;
    color: #93c5fd;
}

body.dark-mode .hero-badge strong {
    color: #bfdbfe;
}

body.dark-mode .section-title {
    color: #f8fafc;
}

body.dark-mode .section-desc {
    color: #94a3b8;
}

body.dark-mode .divider {
    background: #3b82f6;
}

body.dark-mode .subject-card {
    background: linear-gradient(150deg, #24324d 0%, #1e2c48 100%);
    border: 2px solid #3b82f6;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

body.dark-mode .subject-card:hover {
    background: linear-gradient(150deg, #283959 0%, #1d4ed8 100%);
    border-color: #60a5fa;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    transform: translateY(-4px);
}

body.dark-mode .card-body h3 {
    color: #ffffff;
    font-weight: 700;
}

body.dark-mode .card-body p {
    color: #e2e8f0;
}

body.dark-mode .card-link {
    color: #38bdf8;
    font-weight: 700;
    font-size: 0.98rem;
}

body.dark-mode .subject-card:hover .card-link {
    color: #7dd3fc;
}

body.dark-mode .card-count {
    color: #cbd5e1;
}

/* Subject Card Icons & Header Icons in dark mode */
body.dark-mode .card-icon.triet,
body.dark-mode .page-header .icon.triet,
body.dark-mode .icon.triet {
    background: rgba(37, 99, 235, 0.35) !important;
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

body.dark-mode .card-icon.ktct,
body.dark-mode .page-header .icon.ktct,
body.dark-mode .icon.ktct {
    background: rgba(234, 88, 12, 0.35) !important;
    border: 1px solid rgba(249, 115, 22, 0.4);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.2);
}

body.dark-mode .card-icon.cnxh,
body.dark-mode .page-header .icon.cnxh,
body.dark-mode .icon.cnxh {
    background: rgba(225, 29, 72, 0.35) !important;
    border: 1px solid rgba(244, 63, 94, 0.4);
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.2);
}

body.dark-mode .card-icon.tthcm,
body.dark-mode .page-header .icon.tthcm,
body.dark-mode .icon.tthcm {
    background: rgba(202, 138, 4, 0.35) !important;
    border: 1px solid rgba(234, 179, 8, 0.4);
    box-shadow: 0 4px 12px rgba(202, 138, 4, 0.2);
}

body.dark-mode .card-icon.lsd,
body.dark-mode .page-header .icon.lsd,
body.dark-mode .icon.lsd {
    background: rgba(147, 51, 234, 0.35) !important;
    border: 1px solid rgba(168, 85, 247, 0.4);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.2);
}

body.dark-mode .page-header h1 {
    color: #60a5fa;
}

body.dark-mode .page-header p {
    color: #94a3b8;
}

body.dark-mode .back-link {
    color: #60a5fa;
}

body.dark-mode .back-link:hover {
    background: #1e293b;
}

body.dark-mode .adblock-banner {
    background: rgba(113, 63, 18, 0.25);
    border-color: #854d0e;
    border-left-color: #eab308;
    color: #fef08a;
}

body.dark-mode .adblock-banner strong {
    color: #fef9c3;
}

body.dark-mode .update-banner {
    background: rgba(22, 101, 52, 0.25);
    border-color: #15803d;
    border-left-color: #22c55e;
    color: #bbf7d0;
}

body.dark-mode .update-banner strong {
    color: #86efac;
}

body.dark-mode .badge-updated {
    color: #4ade80;
    background: rgba(22, 101, 52, 0.4);
    border-color: #166534;
}

body.dark-mode .quiz-group-title {
    color: #f8fafc;
    border-bottom-color: #334155;
}

body.dark-mode .chapter-count-tag {
    background: rgba(30, 58, 138, 0.4);
    border-color: #1d4ed8;
    color: #93c5fd;
}

body.dark-mode .chapter-count-tag.exam-tag {
    background: rgba(153, 27, 27, 0.35);
    border-color: #991b1b;
    color: #fca5a5;
}

body.dark-mode .chapter-count-tag.random-tag {
    background: rgba(107, 33, 168, 0.35);
    border-color: #7e22ce;
    color: #d8b4fe;
}

body.dark-mode .quiz-item {
    background: #1e293b;
    border-color: #334155;
    border-left-color: #3b82f6;
}

body.dark-mode .quiz-item:hover {
    background: #334155;
}

body.dark-mode .quiz-item.exam {
    background: #2a1b1d;
    border-color: #451a1a;
    border-left-color: #ef4444;
}

body.dark-mode .quiz-item.exam:hover {
    background: #3b1d1e;
}

body.dark-mode .quiz-item.random {
    background: #241b35;
    border-color: #3b2354;
    border-left-color: #a855f7;
}

body.dark-mode .quiz-item.random:hover {
    background: #32224b;
}

body.dark-mode .quiz-item-info h4 {
    color: #f8fafc;
}

body.dark-mode .quiz-item-info span {
    color: #94a3b8;
}

body.dark-mode .quiz-item-arrow {
    color: #64748b;
}

body.dark-mode .quiz-item:hover .quiz-item-arrow {
    color: #60a5fa;
}

body.dark-mode .footer {
    border-top-color: #334155;
}

body.dark-mode .footer-main {
    color: #cbd5e1;
}

body.dark-mode .footer-main strong {
    color: #60a5fa;
}

body.dark-mode .footer-sub {
    color: #94a3b8;
}

body.dark-mode .footer-meta {
    background: #0f172a;
    border-color: #334155;
    color: #64748b;
}

body.dark-mode .footer-meta strong {
    color: #94a3b8;
}

body.dark-mode .footer-dot {
    color: #334155;
}

body.dark-mode .feedback-title {
    color: #60a5fa;
}

body.dark-mode .feedback-desc {
    color: #94a3b8;
}

body.dark-mode .feedback-subtitle {
    color: #93c5fd;
}

body.dark-mode .feedback-form-wrapper {
    background: #ffffff;
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode iframe {
    filter: none;
    background: #ffffff;
}

/* === ĐỀ CƯƠNG ON TAP STYLES === */
.de-cuong-icon {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.de-cuong-filter-wrapper {
    margin: 24px 0 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.de-cuong-search-box {
    position: relative;
    width: 100%;
}

.de-cuong-search-box .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: #64748b;
}

.de-cuong-search-box input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: #1e293b;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.de-cuong-search-box input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.de-cuong-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #94a3b8;
}

.filter-btn.active {
    background: #1a3a7a;
    color: #fff;
    border-color: #1a3a7a;
    box-shadow: 0 2px 8px rgba(26, 58, 122, 0.25);
}

/* Đề cương Cards Grid */
.de-cuong-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.de-cuong-card {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    position: relative;
    overflow: hidden;
}

.de-cuong-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.12);
    border-color: #6366f1;
}

.de-cuong-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.de-cuong-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.doc-badge {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

.doc-date {
    font-size: 0.75rem;
    color: #64748b;
}

.de-cuong-card h3 {
    font-size: 1.25rem;
    color: #1e293b;
    font-weight: 700;
    line-height: 1.3;
}

.doc-filename {
    font-size: 0.85rem;
    color: #475569;
}

.doc-filename code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #0f172a;
    font-family: monospace;
}

.doc-desc {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
}

.de-cuong-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.de-cuong-highlights span {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.78rem;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.de-cuong-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.de-cuong-actions .btn-download,
.de-cuong-actions .btn-quiz {
    width: 100%;
}

.btn-download,
.btn-preview,
.btn-quiz {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    border: none;
}

.btn-download {
    background: #2563eb;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-download:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-preview {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #cbd5e1;
}

.btn-preview:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-quiz {
    background: #ecfdf5;
    color: #047857 !important;
    border: 1px solid #a7f3d0;
}

.btn-quiz:hover {
    background: #d1fae5;
    color: #065f46 !important;
}

/* Đề cương Banner on Subject Pages & Index */
.de-cuong-banner {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #fff;
    border-radius: 16px;
    padding: 20px 24px;
    margin: 20px 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.25);
    flex-wrap: wrap;
}

.de-cuong-banner-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.de-cuong-banner-icon {
    font-size: 2.2rem;
    background: rgba(255, 255, 255, 0.15);
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.de-cuong-banner-text h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.de-cuong-banner-text p {
    font-size: 0.88rem;
    color: #dbeafe;
}

.de-cuong-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.banner-btn-dl {
    background: #ffffff;
    color: #1e3a8a !important;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.banner-btn-dl:hover {
    background: #f8fafc;
    transform: translateY(-2px);
}

.banner-btn-view {
    background: rgba(255, 255, 255, 0.18);
    color: #fff !important;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.banner-btn-view:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* === DOCUMENT MODAL === */
.doc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    padding: 16px;
}

.doc-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.doc-modal {
    background: #fff;
    width: 100%;
    max-width: 900px;
    height: 85vh;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.doc-modal-header {
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.doc-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-modal-title span {
    font-size: 1.8rem;
}

.doc-modal-title h3 {
    font-size: 1.1rem;
    color: #0f172a;
    font-weight: 700;
}

.doc-modal-title .sub-text {
    font-size: 0.8rem;
    color: #64748b;
}

.doc-modal-close {
    background: #e2e8f0;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.1rem;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.doc-modal-close:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.doc-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 24px;
    overflow: hidden;
    background: #f1f5f9;
}

.doc-view-options {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.view-opt-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-opt-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.doc-iframe-wrapper {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.doc-iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.doc-local-notice {
    text-align: center;
    padding: 48px 24px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #cbd5e1;
    max-width: 600px;
    margin: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.local-notice-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.doc-local-notice h4 {
    font-size: 1.2rem;
    color: #1e293b;
    margin-bottom: 8px;
}

.doc-local-notice p {
    font-size: 0.92rem;
    color: #64748b;
    margin-bottom: 12px;
    line-height: 1.5;
}

.btn-download-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: #2563eb;
    color: #fff !important;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
    margin-top: 8px;
}

.btn-download-large:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.doc-modal-footer {
    padding: 12px 24px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.btn-modal-action {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: #2563eb;
    color: #fff !important;
    transition: all 0.2s ease;
}

.btn-modal-action:hover {
    background: #1d4ed8;
}

.btn-modal-action.secondary {
    background: #f1f5f9;
    color: #334155 !important;
    border: 1px solid #cbd5e1;
}

.btn-modal-action.secondary:hover {
    background: #e2e8f0;
}

.btn-modal-action.close {
    background: #cbd5e1;
    color: #1e293b !important;
}

/* === DARK MODE OVERRIDES FOR ĐỀ CƯƠNG === */
body.dark-mode .de-cuong-search-box input {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

body.dark-mode .de-cuong-search-box .search-icon {
    color: #94a3b8;
}

body.dark-mode .filter-btn {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .filter-btn:hover {
    background: #334155;
    color: #fff;
}

body.dark-mode .filter-btn.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

body.dark-mode .de-cuong-card {
    background: linear-gradient(150deg, #24324d 0%, #252850 100%);
    border: 2px solid #818cf8;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

body.dark-mode .de-cuong-card:hover {
    background: linear-gradient(150deg, #2a3a5c 0%, #311b92 100%);
    border-color: #a5b4fc;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    transform: translateY(-4px);
}

body.dark-mode .de-cuong-card h3 {
    color: #ffffff;
    font-weight: 700;
}

body.dark-mode .doc-filename {
    color: #cbd5e1;
}

body.dark-mode .doc-filename code {
    background: rgba(30, 58, 138, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #bfdbfe;
    font-weight: 600;
}

body.dark-mode .doc-desc {
    color: #e2e8f0;
}

body.dark-mode .de-cuong-highlights span {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #c7d2fe;
    font-weight: 600;
}

body.dark-mode .de-cuong-actions {
    border-top: 1px solid rgba(99, 102, 241, 0.25);
}

body.dark-mode .btn-preview {
    background: rgba(34, 197, 94, 0.15);
    border: 1.5px solid #22c55e;
    color: #4ade80;
    font-weight: 700;
}

body.dark-mode .btn-preview:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: #4ade80;
    color: #86efac;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}

body.dark-mode .doc-badge {
    background: rgba(37, 99, 235, 0.35);
    border-color: #3b82f6;
    color: #bfdbfe;
    font-weight: 700;
}

body.dark-mode .doc-date {
    color: #cbd5e1;
}

body.dark-mode .de-cuong-banner {
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    border: 1px solid #1e40af;
}

body.dark-mode .doc-modal {
    background: #0f172a;
}

body.dark-mode .doc-modal-header {
    background: #1e293b;
    border-bottom-color: #334155;
}

body.dark-mode .doc-modal-title h3 {
    color: #f8fafc;
}

body.dark-mode .doc-modal-close {
    background: #334155;
    color: #cbd5e1;
}

body.dark-mode .doc-modal-body {
    background: #0f172a;
}

body.dark-mode .doc-local-notice {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .doc-local-notice h4 {
    color: #f8fafc;
}

body.dark-mode .doc-local-notice p {
    color: #cbd5e1;
}

body.dark-mode .doc-modal-footer {
    background: #1e293b;
    border-top-color: #334155;
}

body.dark-mode .btn-modal-action.secondary {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1 !important;
}

body.dark-mode .view-opt-btn {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .view-opt-btn.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

/* === PIN SUBJECTS HOMEPAGE STYLES === */
.subject-card-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.pin-subject-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.pin-subject-btn:hover {
    transform: scale(1.1);
    background: #fff;
}

.pin-subject-btn.pinned {
    background: #fef08a;
    border-color: #facc15;
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.4);
}

body.dark-mode .pin-subject-btn {
    background: rgba(30, 41, 59, 0.85);
    border-color: #334155;
    color: #fbbf24;
}

body.dark-mode .pin-subject-btn.pinned {
    background: #854d0e;
    border-color: #ca8a04;
}

.pinned-section {
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.7), rgba(243, 244, 246, 0.7));
    padding: 24px;
    border-radius: 16px;
    border: 1.5px dashed #bfdbfe;
    margin-bottom: 32px;
}

body.dark-mode .pinned-section {
    background: rgba(30, 41, 59, 0.4);
    border-color: #1e40af;
}

/* === PLATFORM CHOICE WRAPPER (HUITQuiz vs Azota) === */
.quiz-platform-wrapper {
    margin: 24px 0 32px;
}

.platform-choice-header h2 {
    font-size: 1.4rem;
    color: #1e293b;
    margin-bottom: 4px;
}

.platform-choice-header p {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.platform-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .platform-cards-grid {
        grid-template-columns: 1fr;
    }
}

.platform-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.platform-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.platform-card.native-card {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #ffffff, #f0f9ff);
}

.platform-card.azota-card {
    border-color: #cbd5e1;
    background: #ffffff;
}

.card-tag {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.card-tag.recommended {
    background: #dbeafe;
    color: #1d4ed8;
}

.card-tag.external {
    background: #f1f5f9;
    color: #475569;
}

.platform-card h3 {
    font-size: 1.25rem;
    color: #0f172a;
    margin-bottom: 8px;
}

.platform-card p {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 16px;
}

.native-btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-launch-btn {
    display: block;
    text-align: center;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.quiz-launch-btn.primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.quiz-launch-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.quiz-launch-btn.secondary {
    background: #ffffff;
    color: #2563eb !important;
    border: 1.5px solid #2563eb;
}

.quiz-launch-btn.secondary:hover {
    background: #eff6ff;
}

.azota-notice {
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
}

body.dark-mode .platform-choice-header h2 {
    color: #f8fafc;
}

body.dark-mode .platform-choice-header p {
    color: #94a3b8;
}

body.dark-mode .platform-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .platform-card.native-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-color: #3b82f6;
}

body.dark-mode .platform-card h3 {
    color: #f8fafc;
}

body.dark-mode .platform-card p {
    color: #cbd5e1;
}

body.dark-mode .quiz-launch-btn.secondary {
    background: #1e293b;
    color: #60a5fa !important;
    border-color: #3b82f6;
}

body.dark-mode .azota-notice {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

/* === INTERACTIVE DE CUONG MODULE STYLES === */
.interactive-de-cuong-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.de-cuong-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 16px 0 20px;
    flex-wrap: wrap;
}

.de-cuong-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-answers-btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-answers-btn.active {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.q-count-badge {
    font-size: 0.9rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 8px 14px;
    border-radius: 8px;
}

.de-cuong-questions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.de-cuong-q-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    transition: all 0.2s ease;
}

.de-cuong-q-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.de-cuong-q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.de-cuong-q-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.subj-badge {
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.ch-badge {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.copy-q-btn {
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-q-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.de-cuong-q-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.5;
    margin-bottom: 12px;
}

.de-cuong-q-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (max-width: 640px) {
    .de-cuong-q-options {
        grid-template-columns: 1fr;
    }
}

.de-cuong-option {
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #334155;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.de-cuong-option.is-correct-answer {
    background: #ecfdf5;
    border-color: #10b981;
    color: #047857;
    font-weight: 600;
}

.opt-bullet {
    font-weight: bold;
}

.de-cuong-q-exp {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f0f9ff;
    border-left: 3px solid #0284c7;
    border-radius: 0 8px 8px 0;
    font-size: 0.85rem;
    color: #0369a1;
}

body.dark-mode .interactive-de-cuong-section {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .toggle-answers-btn {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .q-count-badge {
    background: #0f172a;
    color: #94a3b8;
}

body.dark-mode .de-cuong-q-card {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .de-cuong-q-title {
    color: #f8fafc;
}

body.dark-mode .de-cuong-option {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .de-cuong-option.is-correct-answer {
    background: rgba(6, 78, 59, 0.4);
    border-color: #10b981;
    color: #34d399;
}

body.dark-mode .de-cuong-q-exp {
    background: rgba(12, 74, 110, 0.3);
    border-color: #0284c7;
    color: #7dd3fc;
}

/* === QUIZ PAGE (QUIZ.HTML) STYLES === */
.quiz-body {
    background: #f1f5f9;
    min-height: 100vh;
}

body.dark-mode.quiz-body {
    background: #0f172a;
}

.quiz-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quiz-subject-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1e293b;
}

.quiz-mode-badge {
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.quiz-timer-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #0f172a;
    color: #38bdf8;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: monospace;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.quiz-timer-box.warning {
    background: #7f1d1d;
    color: #fca5a5;
    animation: pulseTimer 1s infinite alternate;
}

@keyframes pulseTimer {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.6;
    }
}

.quiz-container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 16px;
}

.quiz-main-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

@media (max-width: 900px) {
    .quiz-main-layout {
        grid-template-columns: 1fr;
    }
}

.quiz-left-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quiz-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.quiz-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.quiz-card-meta {
    display: flex;
    gap: 10px;
}

.q-number-badge {
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 8px;
}

.q-chapter-badge {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 8px;
}

.flag-btn {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.flag-btn.active {
    background: #fff7ed;
    border-color: #f97316;
    color: #ea580c;
}

.quiz-question-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.6;
    margin-bottom: 24px;
}

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

.option-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    text-align: left;
    font-family: inherit;
    font-size: 1.05rem;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-item:hover {
    border-color: #93c5fd;
    background: #f0f9ff;
}

.option-radio {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
}

.option-item.selected {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1e40af;
    font-weight: 600;
}

.option-item.selected .option-radio {
    border-color: #2563eb;
    background: #2563eb;
    box-shadow: inset 0 0 0 3px #ffffff;
}

.option-item.correct {
    border-color: #10b981 !important;
    background: #ecfdf5 !important;
    color: #047857 !important;
    font-weight: 700;
}

.option-item.wrong {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    color: #b91c1c !important;
}

.option-item.disabled,
.option-item:disabled {
    cursor: default !important;
    pointer-events: none !important;
}

.quiz-explanation-box {
    margin-top: 20px;
    padding: 16px;
    background: #f0f9ff;
    border-radius: 10px;
    border-left: 4px solid #0284c7;
}

.exp-title {
    font-weight: 700;
    color: #0369a1;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.exp-content {
    font-size: 0.95rem;
    color: #0c4a6e;
    line-height: 1.5;
}

.quiz-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.quiz-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.quiz-btn.btn-primary {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.quiz-btn.btn-primary:hover {
    background: #1d4ed8;
}

.quiz-btn.btn-secondary {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #475569;
}

.quiz-btn.btn-secondary:hover {
    background: #f1f5f9;
}

.quiz-btn.btn-danger {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.quiz-btn.btn-danger:hover {
    background: #b91c1c;
}

.quiz-btn.btn-outline {
    background: transparent;
    border: 1.5px solid #cbd5e1;
    color: #64748b;
    width: 100%;
}

/* Question Grid Sidebar */
.grid-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.grid-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.grid-card-header h3 {
    font-size: 1.1rem;
    color: #0f172a;
}

.grid-progress-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2563eb;
}

.grid-legend {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.75rem;
    color: #64748b;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-box {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-box.unattempted {
    background: #e2e8f0;
}

.legend-box.attempted {
    background: #2563eb;
}

.legend-box.flagged {
    background: #f97316;
}

.question-grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 20px;
}

.grid-item {
    height: 40px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.grid-item:hover {
    border-color: #93c5fd;
    transform: scale(1.05);
}

.grid-item.attempted {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.grid-item.flagged {
    background: #f97316 !important;
    border-color: #ea580c !important;
    color: #ffffff !important;
}

.grid-item.active {
    box-shadow: 0 0 0 3px #60a5fa;
    transform: scale(1.05);
}

/* Submit Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header h3 {
    font-size: 1.2rem;
    color: #0f172a;
    margin-bottom: 12px;
}

.unanswered-warning {
    margin-top: 12px;
    padding: 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    color: #c2410c;
    font-size: 0.9rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Result Screen Styles */
.result-summary-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    border: 1px solid #e2e8f0;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.result-header h2 {
    font-size: 1.8rem;
    color: #0f172a;
    margin-bottom: 4px;
}

.result-header p {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.score-circle-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.score-val {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.score-max {
    font-size: 0.85rem;
    opacity: 0.85;
}

.score-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

@media (max-width: 640px) {
    .score-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-box {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.stat-box.correct {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.stat-box.wrong {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.stat-box.skipped {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.stat-box.time {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}

.stat-num {
    font-size: 1.6rem;
    font-weight: 800;
}

.stat-lbl {
    font-size: 0.85rem;
    opacity: 0.85;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Review Section */
.result-review-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px;
    border: 1px solid #e2e8f0;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.review-filters {
    display: flex;
    gap: 8px;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-card {
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.review-card.is-correct {
    border-left: 5px solid #10b981;
}

.review-card.is-wrong {
    border-left: 5px solid #ef4444;
}

.review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.q-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #0f172a;
}

.badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    flex-shrink: 0;
}

.badge-success {
    background: #d1fae5;
    color: #047857;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-warning {
    background: #ffedd5;
    color: #c2410c;
}

.review-options-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.review-option {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.review-option.correct-answer {
    background: #ecfdf5;
    border-color: #10b981;
    color: #047857;
    font-weight: 700;
}

.review-option.user-wrong {
    background: #fef2f2;
    border-color: #ef4444;
    color: #b91c1c;
}

.review-explanation {
    margin-top: 10px;
    padding: 10px 14px;
    background: #f0f9ff;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #0369a1;
}

body.dark-mode .quiz-subject-title {
    color: #f8fafc;
}

body.dark-mode .quiz-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .q-chapter-badge {
    background: #0f172a;
    color: #94a3b8;
}

body.dark-mode .flag-btn {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

body.dark-mode .quiz-question-text {
    color: #f8fafc;
}

body.dark-mode .option-item {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .grid-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .grid-card-header h3 {
    color: #f8fafc;
}

body.dark-mode .grid-item {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .modal-card {
    background: #1e293b;
    color: #f8fafc;
}

body.dark-mode .modal-header h3 {
    color: #f8fafc;
}

body.dark-mode .result-summary-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .result-header h2 {
    color: #f8fafc;
}

body.dark-mode .result-review-section {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .review-card {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .q-title {
    color: #f8fafc;
}

body.dark-mode .review-option {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

/* ==========================================================================
   STANDALONE APP STYLES (TRAC-NGHIEM.HTML - NLDK STYLE)
   ========================================================================== */
.tn-body {
    background: #f8fafc;
    min-height: 100vh;
}

body.dark-mode.tn-body {
    background: #0f172a;
}

.tn-app-container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* HERO SECTION */
.tn-hero {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border-radius: 20px;
    padding: 40px 28px;
    color: #ffffff;
    text-align: center;
    margin-bottom: 32px;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.25);
    position: relative;
    overflow: hidden;
}

.tn-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.tn-hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.tn-hero p {
    font-size: 1.05rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 24px;
    line-height: 1.5;
}

.tn-search-wrapper {
    position: relative;
    max-width: 520px;
    margin: 0 auto;
}

.tn-search-wrapper .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 1.1rem;
}

.tn-search-wrapper input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    border-radius: 30px;
    border: none;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    color: #0f172a;
    background: #ffffff;
    transition: all 0.2s ease;
}

.tn-search-wrapper input:focus {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* SECTIONS & GRID */
.tn-section {
    margin-bottom: 36px;
}

.tn-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.tn-section-header h2 {
    font-size: 1.35rem;
    color: #0f172a;
    font-weight: 700;
}

.tn-subj-count {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
}

.tn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.tn-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.25 ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tn-card:hover {
    transform: translateY(-4px);
    border-color: #3b82f6;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.tn-pin-star {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(241, 245, 249, 0.8);
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
}

.tn-pin-star.pinned {
    background: #fef08a;
    border-color: #eab308;
    color: #ca8a04;
}

.tn-card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.tn-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    background: #f1f5f9;
    color: #0f172a;
}

.tn-card-title h3 {
    font-size: 1.1rem;
    color: #0f172a;
    margin-bottom: 4px;
    line-height: 1.35;
}

.tn-card-title span {
    font-size: 0.85rem;
    color: #64748b;
}

.tn-card-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.tn-card-action {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2563eb;
}

body.dark-mode .tn-section-header h2 {
    color: #f8fafc;
}

body.dark-mode .tn-subj-count {
    background: #1e293b;
    color: #94a3b8;
}

body.dark-mode .tn-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .tn-card-title h3 {
    color: #f8fafc;
}

body.dark-mode .tn-card-title span {
    color: #94a3b8;
}

body.dark-mode .tn-card-footer {
    border-top-color: #334155;
}

/* SUBJECT MODAL */
.tn-subject-modal-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 32px;
    width: 90%;
    max-width: 560px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.tn-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    color: #64748b;
}

.tn-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e2e8f0;
}

.tn-modal-icon {
    font-size: 2.2rem;
    width: 60px;
    height: 60px;
    background: #eff6ff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tn-modal-header h2 {
    font-size: 1.35rem;
    color: #0f172a;
    margin-bottom: 4px;
}

.tn-modal-header p {
    font-size: 0.9rem;
    color: #64748b;
}

.tn-mode-choices {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tn-mode-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tn-mode-card:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    transform: translateX(4px);
}

.tn-mode-card .mode-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.tn-mode-card .mode-info {
    flex-grow: 1;
}

.tn-mode-card .mode-info h3 {
    font-size: 1.05rem;
    color: #0f172a;
    margin-bottom: 2px;
}

.tn-mode-card .mode-info p {
    font-size: 0.85rem;
    color: #64748b;
}

.tn-mode-card .mode-arrow {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2563eb;
}

.tn-chapter-select-box {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed #cbd5e1;
}

.ch-select-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ch-select-header h4 {
    font-size: 1rem;
    color: #0f172a;
}

.btn-back-modes {
    background: transparent;
    border: none;
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
}

.ch-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

.ch-list::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.ch-item-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.ch-item-btn:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
    color: #1d4ed8;
}

body.dark-mode .tn-subject-modal-card {
    background: #1e293b;
    color: #f8fafc;
}

body.dark-mode .tn-modal-close {
    background: #0f172a;
    color: #cbd5e1;
}

body.dark-mode .tn-modal-header {
    border-bottom-color: #334155;
}

body.dark-mode .tn-modal-header h2 {
    color: #f8fafc;
}

body.dark-mode .tn-modal-header p {
    color: #94a3b8;
}

body.dark-mode .tn-mode-card {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .tn-mode-card .mode-info h3 {
    color: #f8fafc;
}

body.dark-mode .ch-item-btn {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

/* QUIZ PLAYER VIEW */
.quiz-header-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    padding: 12px 20px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.tn-btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tn-btn-back:hover {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
    transform: translateY(-1px);
}

.quiz-info-center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quiz-subj-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

.quiz-mode-tag {
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 10px;
}

.quiz-timer-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #0f172a;
    color: #38bdf8;
    font-family: monospace;
    font-weight: 700;
    font-size: 1.15rem;
    padding: 6px 14px;
    border-radius: 20px;
}

.quiz-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
}

@media (max-width: 860px) {
    .quiz-layout {
        grid-template-columns: 1fr;
    }
}

.quiz-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.q-badge {
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 8px;
}

.ch-badge-tag {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 8px;
}

.flag-toggle-btn {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.flag-toggle-btn:hover {
    border-color: #94a3b8;
    color: #334155;
    background: #f1f5f9;
}

.flag-toggle-btn.active,
.flag-toggle-btn.flagged {
    background: #fff7ed;
    border-color: #f97316;
    color: #ea580c;
}

.q-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.6;
    margin-bottom: 24px;
}

.q-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.q-option-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.05rem;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.q-option-btn:hover {
    border-color: #93c5fd;
    background: #f0f9ff;
}

.opt-indicator {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    flex-shrink: 0;
}

.q-option-btn.selected {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1e40af;
    font-weight: 600;
}

.q-option-btn.selected .opt-indicator {
    background: #2563eb;
    border-color: #2563eb;
    box-shadow: inset 0 0 0 3px #ffffff;
}

.q-option-btn.correct {
    border-color: #10b981 !important;
    background: #ecfdf5 !important;
    color: #047857 !important;
    font-weight: 700;
}

.q-option-btn.wrong {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    color: #b91c1c !important;
}

.q-option-btn.disabled,
.q-option-btn:disabled {
    cursor: default !important;
    pointer-events: none !important;
}

.q-explanation-box {
    margin-top: 20px;
    padding: 16px;
    background: #f0f9ff;
    border-left: 4px solid #0284c7;
    border-radius: 8px;
}

.exp-head {
    font-weight: 700;
    color: #0369a1;
    margin-bottom: 4px;
}

.exp-body {
    font-size: 0.95rem;
    color: #0c4a6e;
    line-height: 1.5;
}

.quiz-action-buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

/* SIDEBAR GRID */
.sidebar-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.sidebar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.sidebar-head h3 {
    font-size: 1.1rem;
    color: #0f172a;
}

.progress-lbl {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2563eb;
}

.sidebar-legend {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.75rem;
    color: #64748b;
}

.sidebar-legend div {
    display: flex;
    align-items: center;
    gap: 4px;
}

.leg {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.leg.un {
    background: #e2e8f0;
}

.leg.done {
    background: #2563eb;
}

.leg.flg {
    background: #f97316;
}

.q-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
}

.q-grid-item {
    height: 40px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.q-grid-item.attempted {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.q-grid-item.flagged {
    background: #f97316 !important;
    border-color: #ea580c !important;
    color: #ffffff !important;
}

.q-grid-item.active {
    box-shadow: 0 0 0 3px #60a5fa;
    transform: scale(1.05);
}

body.dark-mode .quiz-header-bar {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .tn-btn-back {
    background: rgba(255, 255, 255, 0.05);
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .tn-btn-back:hover {
    background: rgba(37, 99, 235, 0.18);
    border-color: #3b82f6;
    color: #93c5fd;
}

body.dark-mode .quiz-subj-name {
    color: #f8fafc;
}

body.dark-mode .q-text {
    color: #f8fafc;
}

body.dark-mode .q-option-btn {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .sidebar-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .sidebar-head h3 {
    color: #f8fafc;
}

body.dark-mode .q-grid-item {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

/* RESULT SCREEN */
.result-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 36px;
    border: 1px solid #e2e8f0;
    text-align: center;
    margin-bottom: 32px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.result-title h2 {
    font-size: 1.8rem;
    color: #0f172a;
    margin-bottom: 4px;
}

.result-title p {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
}

.score-ring {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.35);
}

.big-score {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
}

.max-score {
    font-size: 0.9rem;
    opacity: 0.85;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 600px;
}

@media (max-width: 600px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.st-item {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.st-item.green {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.st-item.red {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.st-item.orange {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.st-item.blue {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}

.st-item strong {
    font-size: 1.6rem;
    font-weight: 800;
}

.st-item span {
    font-size: 0.85rem;
    opacity: 0.85;
}

.result-btn-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Nút Làm lại những câu sai */
.btn-retry-wrong {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
    font-weight: 700;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.btn-retry-wrong:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.45);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-retry-wrong:active {
    transform: translateY(0);
}

.btn-retry-wrong svg {
    transition: transform 0.3s ease;
}

.btn-retry-wrong:hover svg {
    transform: rotate(-45deg);
}

body.dark-mode .btn-retry-wrong {
    background: linear-gradient(135deg, #d97706, #b45309);
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.4);
}

body.dark-mode .btn-retry-wrong:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Banner chúc mừng khi hoàn thành hết câu sai */
.res-completion-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.08), rgba(34, 197, 94, 0.14));
    border: 1.5px solid rgba(22, 163, 74, 0.3);
    border-radius: 12px;
    padding: 14px 18px;
    margin: 20px auto 4px;
    max-width: 520px;
    text-align: left;
    animation: resBannerPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes resBannerPop {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.res-completion-banner .res-banner-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.res-completion-banner .res-banner-text h4 {
    font-size: 15px;
    font-weight: 700;
    color: #15803d;
    margin-bottom: 2px;
}

.res-completion-banner .res-banner-text p {
    font-size: 13px;
    color: #4b5563;
    margin: 0;
    line-height: 1.4;
}

body.dark-mode .res-completion-banner {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.16), rgba(34, 197, 94, 0.22));
    border-color: rgba(34, 197, 94, 0.4);
}

body.dark-mode .res-completion-banner .res-banner-text h4 {
    color: #86efac;
}

body.dark-mode .res-completion-banner .res-banner-text p {
    color: #cbd5e1;
}

.review-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 28px;
    border: 1px solid #e2e8f0;
}

.review-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.review-top-bar h3 {
    font-size: 1.2rem;
    color: #0f172a;
}

.review-filter-buttons {
    display: flex;
    gap: 8px;
}

.review-items-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-item-card {
    padding: 20px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.review-item-card.correct-card {
    border-left: 5px solid #10b981;
}

.review-item-card.wrong-card {
    border-left: 5px solid #ef4444;
}

.rev-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.rev-q-num {
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
}

.res-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}

.res-badge.success {
    background: #d1fae5;
    color: #047857;
}

.res-badge.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.res-badge.warning {
    background: #ffedd5;
    color: #c2410c;
}

.rev-options-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.rev-option {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.rev-option.ans-correct {
    background: #ecfdf5;
    border-color: #10b981;
    color: #047857;
    font-weight: 700;
}

.rev-option.ans-user-wrong {
    background: #fef2f2;
    border-color: #ef4444;
    color: #b91c1c;
}

.rev-exp {
    margin-top: 10px;
    padding: 10px 14px;
    background: #f0f9ff;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #0369a1;
}

body.dark-mode .result-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .result-title h2 {
    color: #f8fafc;
}

body.dark-mode .review-box {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .review-top-bar h3 {
    color: #f8fafc;
}

body.dark-mode .review-item-card {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .rev-q-num {
    color: #f8fafc;
}

body.dark-mode .rev-option {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

/* INTERACTIVE OUTLINE VIEW */
.outline-top-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    background: #ffffff;
    padding: 12px 20px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    gap: 16px;
}

.outline-top-header .tn-btn-back {
    justify-self: start;
}

.outline-title-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.outline-title-meta h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    margin: 0;
}

.out-count-tag {
    font-size: 0.8rem;
    color: #2563eb;
    background: #eff6ff;
    padding: 2px 10px;
    border-radius: 50px;
    font-weight: 600;
}

.toggle-ans-btn {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.toggle-ans-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.toggle-ans-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.15);
}

.toggle-ans-btn.active {
    background: #eff6ff;
    color: #2563eb;
    border-color: #93c5fd;
}

.toggle-ans-btn.active:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.toggle-ans-btn:active {
    transform: translateY(0);
}

.outline-toolbar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.outline-search-box {
    position: relative;
    width: 100%;
}

.outline-search-box .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

.outline-search-box input {
    width: 100%;
    padding: 12px 16px 12px 46px;
    border-radius: 12px;
    border: 1.5px solid #cbd5e1;
    font-size: 0.95rem;
    font-family: inherit;
    background: #ffffff;
    color: #0f172a;
    outline: none;
}

.outline-search-box input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.outline-ch-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.outline-q-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.out-q-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.out-q-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.out-ch-badge {
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.out-copy-btn {
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    color: #64748b;
    cursor: pointer;
}

.out-q-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.5;
    margin-bottom: 14px;
}

.out-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (max-width: 640px) {
    .out-options-grid {
        grid-template-columns: 1fr;
    }
}

.out-option {
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #334155;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.out-option.highlight-correct {
    background: #ecfdf5;
    border-color: #10b981;
    color: #047857;
    font-weight: 600;
}

.out-exp-note {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f0f9ff;
    border-left: 3px solid #0284c7;
    border-radius: 0 8px 8px 0;
    font-size: 0.85rem;
    color: #0369a1;
}

.out-empty-msg {
    padding: 40px;
    text-align: center;
    background: #ffffff;
    border-radius: 14px;
    color: #64748b;
    font-size: 1rem;
}

body.dark-mode .outline-top-header {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .outline-title-meta h2 {
    color: #f8fafc;
}

body.dark-mode .toggle-ans-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .toggle-ans-btn:hover {
    background: rgba(37, 99, 235, 0.18);
    border-color: #3b82f6;
    color: #93c5fd;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}

body.dark-mode .toggle-ans-btn.active {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

body.dark-mode .toggle-ans-btn.active:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

body.dark-mode .outline-search-box input {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

body.dark-mode .out-q-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .out-q-title {
    color: #f8fafc;
}

body.dark-mode .out-option {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .out-option.highlight-correct {
    background: rgba(6, 78, 59, 0.4);
    border-color: #10b981;
    color: #34d399;
}

body.dark-mode .out-empty-msg {
    background: #1e293b;
    color: #94a3b8;
}

/* Dark mode navbar styling */
body.dark-mode .navbar {
    background: #0f172a;
    border-bottom-color: #1e293b;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

body.dark-mode .navbar-logo span {
    color: #60a5fa;
}

body.dark-mode .navbar-links a {
    color: #cbd5e1;
}

body.dark-mode .navbar-links a:hover {
    background: #1e293b;
    color: #f8fafc;
}

body.dark-mode .navbar-links a.active {
    background: #2563eb;
    color: #ffffff;
}

/* === STUDY MODES SECTION (HOME PAGE) === */
.study-modes-section {
    margin: 40px 0;
}

.text-center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.study-modes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.mode-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 28px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.mode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.mode-web {
    border-color: #3b82f6;
    background: linear-gradient(180deg, #f0f7ff 0%, #ffffff 100%);
}

.mode-web:hover {
    border-color: #2563eb;
    box-shadow: 0 14px 35px rgba(37, 99, 235, 0.18);
}

.mode-azota {
    border-color: #6366f1;
    background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 100%);
}

.mode-azota:hover {
    border-color: #4f46e5;
    box-shadow: 0 14px 35px rgba(99, 102, 241, 0.18);
}

.mode-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.mode-icon {
    font-size: 30px;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.mode-web .mode-icon {
    background: #eff6ff;
    color: #2563eb;
}

.mode-azota .mode-icon {
    background: #e0e7ff;
    color: #4f46e5;
}

.mode-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 50px;
}

.badge-web {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-azota {
    background: #e0e7ff;
    color: #4338ca;
}

.mode-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.mode-sub {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.5;
}

.mode-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.mode-features li {
    font-size: 0.92rem;
    color: #334155;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.mode-features .f-icon {
    color: #16a34a;
    font-weight: 700;
    font-size: 14px;
    background: #dcfce7;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-web {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-web:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.btn-azota {
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.btn-azota:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.4);
}

/* Dark Mode Overrides for Study Modes */
body.dark-mode .mode-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .mode-web {
    background: linear-gradient(160deg, #1e2942 0%, #172554 100%);
    border: 2px solid #3b82f6;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

body.dark-mode .mode-web:hover {
    border-color: #60a5fa;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    transform: translateY(-4px);
}

body.dark-mode .mode-azota {
    background: linear-gradient(160deg, #1e2942 0%, #2e1065 100%);
    border: 2px solid #818cf8;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

body.dark-mode .mode-azota:hover {
    border-color: #a5b4fc;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    transform: translateY(-4px);
}

body.dark-mode .mode-card h3 {
    color: #ffffff;
    font-weight: 700;
}

body.dark-mode .mode-sub {
    color: #cbd5e1;
}

body.dark-mode .mode-features li {
    color: #e2e8f0;
}

body.dark-mode .mode-features li strong {
    color: #ffffff;
}

body.dark-mode .mode-web .mode-icon {
    background: rgba(37, 99, 235, 0.35);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

body.dark-mode .mode-azota .mode-icon {
    background: rgba(99, 102, 241, 0.35);
    color: #c7d2fe;
    border: 1px solid rgba(129, 140, 248, 0.4);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

body.dark-mode .badge-web {
    background: rgba(37, 99, 235, 0.35);
    color: #bfdbfe;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

body.dark-mode .badge-azota {
    background: rgba(99, 102, 241, 0.35);
    color: #e0e7ff;
    border: 1px solid rgba(129, 140, 248, 0.35);
}

body.dark-mode .mode-features .f-icon {
    background: rgba(34, 197, 94, 0.25);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

@media (max-width: 768px) {
    .study-modes-grid {
        grid-template-columns: 1fr;
    }

    .mode-card {
        padding: 20px;
    }
}

.hist-del-btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1.5px solid #fecdd3;
    background: #fff1f2;
    color: #e11d48;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hist-del-btn:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
}

body.dark-mode .hist-del-btn {
    background: rgba(225, 29, 72, 0.15);
    border-color: rgba(225, 29, 72, 0.4);
    color: #fda4af;
}

body.dark-mode .hist-del-btn:hover {
    background: #e11d48;
    color: #ffffff;
    border-color: #e11d48;
}

/* ============================================================
   HUITQUIZ SUPPORT & FEEDBACK DUAL-CARD SECTION
   ============================================================ */
.huit-support-section {
    max-width: 1120px;
    margin: 48px auto 28px;
    padding: 0 16px;
}

.huit-support-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    align-items: stretch;
}

.huit-support-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 30px 28px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
    position: relative;
}

.huit-support-card:hover {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.support-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    width: fit-content;
    margin-bottom: 14px;
}

.badge-coffee {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-feedback {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.support-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.3;
}

.support-card-desc {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-muted);
    margin-bottom: 22px;
}

/* Donate Card specifics */
.support-qr-wrapper {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 18px;
    padding: 10px;
    width: 175px;
    height: 175px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.support-qr-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.support-qr-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 50px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    font-size: 12.5px;
    font-weight: 600;
    margin: 0 auto 16px;
    width: fit-content;
}

.support-info-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px dashed var(--border);
    padding-top: 16px;
    margin-top: auto;
}

.support-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
}

.support-info-label {
    color: var(--text-muted);
    font-weight: 500;
}

.support-info-val {
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.2px;
}

.support-info-val.accent {
    color: var(--primary);
}

/* Feedback Card specifics */
.support-callout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 14px;
    background: var(--surface2, #f8fafc);
    border: 1.5px solid var(--border);
    margin-top: auto;
    margin-bottom: 20px;
}

.support-callout-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}

.support-callout-text {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

.btn-support-feedback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    border-radius: 12px;
    background: #2563eb;
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.btn-support-feedback:hover {
    background: #1d4ed8;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-support-feedback:active {
    transform: translateY(0);
}

/* Dark Mode support */
body.dark-mode .huit-support-card {
    background: #131d2e;
    border-color: #1e2d4a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

body.dark-mode .huit-support-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

body.dark-mode .badge-coffee {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

body.dark-mode .badge-feedback {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border-color: rgba(14, 165, 233, 0.3);
}

body.dark-mode .support-qr-tag {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
}

body.dark-mode .support-info-table {
    border-color: #1e2d4a;
}

body.dark-mode .support-info-val.accent {
    color: #60a5fa;
}

body.dark-mode .support-callout {
    background: rgba(255, 255, 255, 0.03);
    border-color: #1e2d4a;
}

@media (max-width: 768px) {
    .huit-support-section {
        margin: 32px auto 20px;
        padding: 0 12px;
    }

    .huit-support-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .huit-support-card {
        padding: 22px 18px;
    }
}