:root {
    --primary: #0f2444;
    --primary-dark: #0a172c;
    --accent: #0284c7;
    --accent2: #6366f1;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --pink: #db2777;
    --gradient: linear-gradient(135deg, #0284c7 0%, #6366f1 100%);
    --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --bg-soft: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #334155;
    --border-soft: #cbd5e1;
    --card-shadow: 0 4px 20px rgba(15, 23, 42, .06);
    --card-shadow-hover: 0 10px 30px rgba(15, 23, 42, .12);
}

[data-bs-theme="dark"] {
    --primary: #93c5fd;
    --primary-dark: #030712;
    --accent: #38bdf8;
    --accent2: #a78bfa;
    --success: #4ade80;
    --danger: #f87171;
    --warning: #fbbf24;
    --pink: #f472b6;
    --bg-soft: #080d1a;
    --bg-card: #131c2e;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --border-soft: #24344d;
    --gradient-dark: linear-gradient(135deg, #090e1a 0%, #172338 100%);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, .45);
    --card-shadow-hover: 0 10px 30px rgba(0, 0, 0, .65);
}

html, body {
    height: 100%;
}

body {
    font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-soft);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color .25s ease, color .25s ease;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.3px;
}

.text-muted {
    color: var(--text-muted) !important;
}

main {
    flex: 1;
}

/* Custom modern scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.7);
}

/* ---------- Navbar ---------- */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 1040 !important;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.main-nav .dropdown-menu {
    z-index: 1050 !important;
}

.main-nav .navbar-brand .brand-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--gradient);
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 4px 14px rgba(1, 180, 255, 0.35);
}

.badge-pro {
    background: linear-gradient(135deg, #01b4ff 0%, #7c4dff 100%);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(124, 77, 255, 0.35);
}

.badge-vip {
    background: linear-gradient(135deg, #ffe082 0%, #ffb300 100%);
    color: #4a3400;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(255, 179, 0, 0.3);
    border: 1px solid rgba(255, 235, 153, 0.6);
    font-size: 0.75rem;
}

.badge-free {
    background: rgba(1, 180, 255, 0.15);
    color: #0284c7;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
}

[data-bs-theme="dark"] .badge-free {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
}

.main-nav .navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.main-nav .nav-item {
    white-space: nowrap;
}

.main-nav .nav-link {
    color: rgba(255, 255, 255, .85);
    font-weight: 500;
    border-radius: 8px;
    padding: .42rem .75rem;
    transition: all .2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    font-size: .93rem;
}

.main-nav .nav-link:hover,
.main-nav .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.btn-user {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: .35rem .85rem .35rem .5rem;
    font-weight: 500;
    transition: all .2s ease;
    white-space: nowrap;
}

.btn-user:hover {
    background: rgba(255, 255, 255, .22);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-user .user-name {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gradient);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: .85rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ---------- Buttons ---------- */
.btn-primary-custom {
    background: var(--gradient);
    border: none;
    color: #fff;
    padding: .55rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 4px 15px rgba(1, 180, 255, .25);
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 77, 255, .35);
    color: #fff;
}

.btn-outline-custom {
    border: 1.5px solid var(--accent);
    color: #0284c7;
    background: transparent;
    border-radius: 30px;
    font-weight: 600;
    padding: .5rem 1.4rem;
    transition: all .2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-outline-custom:hover {
    background: var(--gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(1, 180, 255, .3);
}

[data-bs-theme="dark"] .btn-outline-custom {
    color: #38bdf8;
    border-color: #38bdf8;
}

[data-bs-theme="dark"] .btn-outline-custom:hover {
    color: #fff;
}

/* Rieng nut outline ben trong Hero nen toi */
.hero .btn-outline-custom {
    border: 2px solid rgba(255, 255, 255, .75);
    color: #fff;
}

.hero .btn-outline-custom:hover {
    background: #fff;
    color: var(--primary);
    border-color: #fff;
    box-shadow: 0 6px 20px rgba(255, 255, 255, .25);
}

/* Nut VIP bi khoa: hien thi tuong phan ro rang o ca Light va Dark Mode */
.btn-locked-vip {
    background: rgba(245, 158, 11, 0.1);
    border: 1.5px solid rgba(245, 158, 11, 0.45);
    color: #b45309;
    border-radius: 30px;
    font-weight: 600;
    padding: .5rem 1.4rem;
    transition: all .2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-locked-vip:hover {
    background: linear-gradient(135deg, #ffe082 0%, #ffb300 100%);
    color: #4a3400;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

[data-bs-theme="dark"] .btn-locked-vip {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(251, 191, 36, 0.5);
    color: #fcd34d;
}

[data-bs-theme="dark"] .btn-locked-vip:hover {
    background: linear-gradient(135deg, #ffe082 0%, #ffb300 100%);
    color: #3e2723;
}

/* Nut vien chinh trong the bai */
.btn-outline-primary-custom {
    border: 1.5px solid var(--accent);
    color: #0284c7;
    background: transparent;
    border-radius: 30px;
    font-weight: 600;
    padding: .5rem 1.4rem;
    transition: all .2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-outline-primary-custom:hover {
    background: var(--gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(1, 180, 255, .3);
}

[data-bs-theme="dark"] .btn-outline-primary-custom {
    color: #38bdf8;
    border-color: #38bdf8;
}

[data-bs-theme="dark"] .btn-outline-primary-custom:hover {
    color: #fff;
}

/* Nut dang nhap Google chuan phong cach Google */
.btn-google-login {
    background: #ffffff;
    border: 1px solid #dadce0;
    color: #3c4043 !important;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-google-login:hover {
    background: #f8fafd;
    border-color: #c2e7ff;
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.15);
    color: #1f1f1f !important;
}

[data-bs-theme="dark"] .btn-google-login {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .btn-google-login:hover {
    background: #334155;
    color: #ffffff !important;
}

/* ---------- Hero ---------- */
.hero {
    background: radial-gradient(circle at 85% 15%, rgba(1, 180, 255, .2) 0%, transparent 45%),
                radial-gradient(circle at 10% 85%, rgba(124, 77, 255, .2) 0%, transparent 45%),
                linear-gradient(135deg, #0b132b 0%, #172445 60%, #111a33 100%);
    color: #fff;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero .badge-gradient {
    background: var(--gradient);
    padding: .5rem 1.25rem;
    border-radius: 30px;
    font-size: .85rem;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(1, 180, 255, .3);
    letter-spacing: 0.3px;
}

.hero h1, .hero-title {
    font-size: clamp(1.85rem, 2.5vw, 2.35rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.5px;
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

@media (min-width: 992px) {
    .hero h1, .hero-title {
        white-space: nowrap;
    }
}

.hero p, .hero-lead {
    color: #e2e8f0 !important;
    font-size: 1.1rem;
    line-height: 1.7;
}

.hero-social-pill {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    color: #f8fafc;
    font-weight: 500;
}

.hero .text-white-50, .hero-stat-label {
    color: #cbd5e1 !important;
    font-weight: 500;
    font-size: 0.85rem;
}

/* ---------- Cards ---------- */
.card-exam {
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    background: var(--bg-card);
    box-shadow: 0 4px 20px rgba(15, 23, 42, .05);
    transition: transform .25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .25s cubic-bezier(0.16, 1, 0.3, 1), border-color .25s ease;
    overflow: hidden;
    position: relative;
}

.card-exam::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
    opacity: 0.8;
}

.card-exam:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 35px -8px rgba(15, 23, 42, .12), 0 0 0 1px rgba(1, 180, 255, 0.25);
    border-color: rgba(1, 180, 255, 0.3);
}

.card-exam .subject-badge {
    background: rgba(1, 180, 255, .12);
    color: #0275a8;
    font-weight: 600;
    font-size: .75rem;
    padding: .3rem .8rem;
    border-radius: 20px;
}

.stat-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(27, 42, 78, .06);
    transition: transform .2s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
}

.stat-card h3 {
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0;
}

.stat-card .stat-label {
    color: #6c7693;
    font-size: .85rem;
    font-weight: 500;
}

/* ---------- Auth pages ---------- */
.auth-section {
    min-height: calc(100vh - 180px);
    display: flex;
    align-items: center;
    background: var(--bg-soft);
}

.auth-card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(27, 42, 78, .1);
    overflow: hidden;
}

.auth-card .auth-side {
    background: var(--gradient-dark);
    color: #fff;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-card .auth-form {
    padding: 3rem 2.5rem;
}

.auth-logo {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: var(--gradient);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
}

.form-control {
    border-radius: 12px;
    padding: .65rem 1rem;
    border: 1px solid var(--border-soft);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem rgba(1, 180, 255, .15);
}

/* ---------- Exam taking ---------- */
.exam-header {
    background: var(--gradient-dark);
    color: #fff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.exam-counter {
    background: var(--gradient);
    border-radius: 12px;
    padding: .4rem 1.2rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

.timer-box {
    background: rgba(255, 255, 255, .15);
    border-radius: 12px;
    padding: .45rem 1.25rem;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.15);
}

.timer-box.critical {
    background: var(--danger);
    color: #fff;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .75; transform: scale(1.03); }
}

/* Exam Sticky Progress & Header */
.exam-header {
    background: var(--gradient-dark);
    color: #fff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 4px 15px rgba(0,0,0,.15);
    backdrop-filter: blur(8px);
}

.exam-progress-bar-wrap {
    height: 6px;
    background: rgba(255, 255, 255, .2);
    border-radius: 3px;
    overflow: hidden;
    width: 140px;
}

.exam-progress-bar-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width .3s ease;
}

/* Question Card Modern Polish */
.question-card {
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(27, 42, 78, .05);
    overflow: hidden;
    transition: box-shadow .2s ease, border-color .2s ease;
    background: #fff;
}

.question-card:hover {
    box-shadow: 0 8px 28px rgba(27, 42, 78, .09);
}

.question-card.flagged {
    border-color: #ffd166;
    background: #fffdf5;
}

.question-card .question-head {
    background: var(--bg-soft);
    padding: .9rem 1.5rem;
    border-bottom: 1px solid var(--border-soft);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.question-card.flagged .question-head {
    background: #fff9e6;
    border-bottom-color: #ffe899;
}

.btn-flag-q {
    border: 1px solid #dee2e6;
    background: #fff;
    color: #6c757d;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
    padding: .25rem .75rem;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    cursor: pointer;
    transition: all .2s ease;
}

.btn-flag-q:hover {
    border-color: #f59f00;
    color: #f59f00;
    background: #fffdf5;
}

.btn-flag-q.active {
    background: #fff3bf;
    border-color: #f59f00;
    color: #d9480f;
}

.option-item {
    border: 2px solid var(--border-soft);
    border-radius: 14px;
    padding: .95rem 1.25rem;
    cursor: pointer;
    transition: all .2s cubic-bezier(.4, 0, .2, 1);
    display: flex;
    align-items: center;
    gap: .85rem;
    background: #fff;
    user-select: none;
}

.option-item:hover {
    border-color: var(--accent);
    background: rgba(1, 180, 255, .04);
    transform: translateY(-1px);
}

.option-item.selected {
    border-color: var(--accent);
    background: rgba(1, 180, 255, .08);
    box-shadow: 0 2px 8px rgba(1, 180, 255, .15);
}

.option-item .option-label {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .95rem;
    transition: all .2s ease;
}

.option-item.selected .option-label {
    background: var(--gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(1, 180, 255, .3);
}

/* Palette Card Modern & States */
.answer-palette {
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 4px 24px rgba(27, 42, 78, .07);
}

.answer-palette .num-btn {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    border: 2px solid var(--border-soft);
    background: #fff;
    color: #4a5470;
    font-weight: 600;
    font-size: .9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s ease;
    text-decoration: none;
    position: relative;
}

.answer-palette .num-btn:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,.08);
}

.answer-palette .num-btn.answered {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(1, 180, 255, .3);
}

.answer-palette .num-btn.flagged::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59f00;
    border: 1.5px solid #fff;
}

.answer-palette .num-btn.active-q {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 42, 78, .2);
}

.save-pill-badge {
    background: #e8f5e9;
    color: #2e7d32;
    padding: .35rem .8rem;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    transition: all .3s ease;
}

/* Zen mode indicator */
body.zen-mode .main-nav,
body.zen-mode .site-footer {
    display: none !important;
}

/* ---------- Result page ---------- */
.result-hero {
    background: var(--gradient-dark);
    color: #fff;
    padding: 3rem 0;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 8px solid rgba(255, 255, 255, .25);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .08);
}

.score-circle .score-val {
    font-size: 2.4rem;
    font-weight: 800;
}

.score-badge {
    padding: .75rem 1.5rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

/* ---------- Table ---------- */
.table-exam {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(27, 42, 78, .06);
}

.table-exam thead th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    border: none;
    padding: .85rem 1rem;
}

.table-exam td {
    vertical-align: middle;
    padding: .9rem 1rem;
    border-color: var(--border-soft);
}

/* ---------- Misc ---------- */
.section-title {
    font-weight: 800;
    font-size: clamp(1.5rem, 2.2vw, 1.85rem);
    color: var(--text-main);
    letter-spacing: -0.4px;
}

.section-subtitle {
    color: var(--text-muted) !important;
    font-size: 1.02rem;
    font-weight: 500;
    line-height: 1.55;
}

.badge-status {
    padding: .4rem .9rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* Bo badge trang thai thong nhat — thay the cac inline style rgba roi rac */
.badge-status-success {
    background: rgba(22, 163, 74, .14);
    color: #15803d;
}

.badge-status-warn {
    background: rgba(217, 119, 6, .14);
    color: #b45309;
}

.badge-status-muted {
    background: rgba(100, 116, 139, .15);
    color: #334155;
}

.badge-status-info {
    background: rgba(2, 132, 199, .14);
    color: #0369a1;
}

.badge-status-danger {
    background: rgba(220, 38, 38, .14);
    color: #b91c1c;
}

.badge-status-purple {
    background: rgba(99, 102, 241, .14);
    color: #4f46e5;
}

/* Footer mau thuong hieu (thay cho inline style trong _Layout) */
.site-footer {
    background-color: #0b1528;
    color: #cbd5e1;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer h5, .site-footer h6 {
    color: #ffffff;
}

.site-footer p, .site-footer .text-white-50, .site-footer small, .site-footer li {
    color: #cbd5e1 !important;
}

/* Menu dang mo duoc to dam vien duoi */
.navbar .nav-link.active {
    font-weight: 700;
    position: relative;
}

.navbar .nav-link.active::after {
    content: "";
    position: absolute;
    left: .5rem;
    right: .5rem;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}

/* Minh hoa SVG o hero trang chu */
.hero-art {
    width: 100%;
    max-width: 460px;
    height: auto;
    filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .35));
}

.list-group-item.clickable {
    cursor: pointer;
    transition: background .15s ease;
}

.list-group-item.clickable:hover {
    background: var(--bg-soft);
}

.result-correct {
    background: rgba(40, 167, 69, .08);
}

.result-wrong {
    background: rgba(220, 53, 69, .08);
}

.footer-link {
    color: rgba(255, 255, 255, .75);
    text-decoration: none;
    transition: color .15s ease;
}

.footer-link:hover {
    color: #fff;
    text-decoration: underline;
}

@media (max-width: 992px) {
    .hero h1, .hero-title {
        font-size: 1.85rem;
    }
    .hero {
        padding: 3rem 0;
    }
    .auth-side {
        display: none !important;
    }
}

/* Anh cua cau hoi / phuong an */
.question-images {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    margin: 1rem 0 1.5rem 0;
    width: 100%;
}

.question-images:empty {
    display: none;
}

.question-image {
    margin: 0 auto;
    max-width: 100%;
    text-align: center;
}

.question-image img {
    max-width: 100%;
    max-height: 360px;
    height: auto;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: #fff;
    padding: .35rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: block;
    margin: 0 auto;
}

.question-image figcaption {
    font-size: .82rem;
    color: #6c757d;
    margin-top: .4rem;
    text-align: center;
    font-style: italic;
}

/* Anh nam trong phuong an: can chieu rong het option-item */
.option-item .question-images {
    flex-basis: 100%;
    margin-bottom: 0;
}

.option-item .question-image img {
    max-height: 200px;
}

/* Cong thuc LaTeX (KaTeX / MathJax) */
.katex {
    font-size: 1.05em;
}

.katex-display {
    margin: .75rem 0;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Cong thuc inline khong duoc lam vo dong khi keu dai */
.option-item .katex-display,
p .katex-display {
    text-align: left;
}

/* Loi render: giu nguyen chu lieu de doc vi du loi */
.katex-error {
    color: #c0392b !important;
    background: #fdf2f0;
    padding: 0 .2rem;
    border-radius: 4px;
}

/* Anh nhung truc tiep trong noi dung cau hoi / phuong an:
   LUON hien thi block doc lap, xuong dong rieng biet o duoi text, khong lam rach dong chu */
.question-card img,
.question-content img,
p img,
.option-item img,
.question-card span img {
    display: block !important;
    margin: 0.85rem auto !important;
    max-width: 100%;
    max-height: 360px;
    height: auto;
    clear: both;
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* MathJax fallback: can giong kich thuoc voi KaTeX de dong deu */
mjx-container[jax="CHTML"] {
    font-size: 105% !important;
}

mjx-container[jax="CHTML"][display="true"] {
    margin: .75rem 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
}
/* ---------- Kho de (tham khao pattern DOL THPT, bien tau theo nhan dien navy/cyan) ---------- */

/* Chip chon mon du navbar */
.subject-chipbar {
    position: sticky;
    top: 66px;
    z-index: 1020;
    scrollbar-width: thin;
}

.subject-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .95rem;
    border-radius: 30px;
    background: var(--bg-soft);
    color: #4a5470;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: all .15s ease;
}

.subject-chip:hover {
    border-color: var(--accent);
    color: var(--primary);
}

.subject-chip.active {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(1, 180, 255, .35);
}

/* O icon lon o header mon hoc */
.kho-de-icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 20px;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    box-shadow: 0 8px 20px rgba(1, 180, 255, .3);
}

.bg-soft-stat {
    background: var(--bg-soft);
}

/* Bo loc doc */
.filter-panel {
    position: sticky;
    top: 135px;
    z-index: 1000;
}

@media (max-width: 991.98px) {
    .filter-panel {
        position: static;
    }
}

.filter-panel .form-check-label {
    font-size: .88rem;
}

/* Bia de tu sinh — 6 palette pastel */
.exam-cover {
    position: relative;
    height: 170px;
    border-radius: 16px 16px 0 0;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.exam-cover::before {
    content: '';
    position: absolute;
    right: -46px;
    top: -46px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
}

.exam-cover::after {
    content: '';
    position: absolute;
    left: -30px;
    bottom: -60px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .35);
}

.cover-0 { background: linear-gradient(135deg, #ffe3ea 0%, #ffd3dd 100%); }
.cover-1 { background: linear-gradient(135deg, #e2ecff 0%, #d0e4ff 100%); }
.cover-2 { background: linear-gradient(135deg, #fff3d1 0%, #ffe8b0 100%); }
.cover-3 { background: linear-gradient(135deg, #dcf7ec 0%, #c9efe0 100%); }
.cover-4 { background: linear-gradient(135deg, #eee2ff 0%, #e0d0ff 100%); }
.cover-5 { background: linear-gradient(135deg, #ffe9d6 0%, #ffdcb8 100%); }

.exam-cover .cover-year {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    background: rgba(255, 255, 255, .95);
    color: #0f172a !important;
    font-size: .72rem;
    font-weight: 800;
    padding: .2rem .7rem;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

.exam-cover .cover-bookmark {
    position: absolute;
    z-index: 1;
    top: 12px;
    right: 14px;
    color: rgba(15, 23, 42, .45) !important;
    font-size: 1.1rem;
}

.exam-cover .cover-title {
    position: relative;
    z-index: 1;
    flex: 1;
    color: #0f172a !important; /* Luon dam sac net de doc tren nen pastel ke ca dark mode */
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.exam-cover .cover-meta {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .76rem;
    font-weight: 700;
    color: rgba(15, 23, 42, .8) !important;
}

.exam-cover .cover-meta .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(15, 23, 42, .4) !important;
}

.exam-cover-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(27, 42, 78, .06);
    transition: transform .18s ease, box-shadow .18s ease;
    overflow: hidden;
}

.exam-cover-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(27, 42, 78, .12);
}

.exam-cover-card .badge-status,
.exam-cover-card .badge-vip {
    padding: .2rem .55rem !important;
    font-size: .72rem !important;
    letter-spacing: 0;
}

.cover-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.cover-card-stats {
    border-top: 1px dashed var(--border-soft);
    padding-top: .6rem;
}

/* Toggle thong ke Cong dong / Cua ban */
.stats-toggle .nav-link {
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
    color: #4a5470;
    padding: .35rem 1rem;
}

.stats-toggle .nav-link.active {
    background: var(--primary);
    color: #fff;
}

/* ---------- Section "Hoc vien noi gi" (quote card xep chong) ---------- */
.quote-stack {
    position: relative;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 8px 26px rgba(27, 42, 78, .09);
    padding: 1.6rem 1.6rem 1.3rem;
    height: 100%;
}

.quote-stack::before,
.quote-stack::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 8px 26px rgba(27, 42, 78, .09);
    z-index: -1;
}

.quote-stack::before {
    transform: rotate(2deg) translateX(8px);
    opacity: .75;
}

.quote-stack::after {
    transform: rotate(-2deg) translateX(-8px);
    opacity: .55;
}

.quote-mark {
    font-size: 2rem;
    line-height: 1;
    color: var(--accent);
    opacity: .55;
}

.quote-text {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--primary);
    font-weight: 500;
}

.quote-author {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-top: 1rem;
}

.quote-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    background: var(--gradient);
    flex-shrink: 0;
}

.quote-score-chip {
    margin-left: auto;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    padding: .25rem .8rem;
    font-size: .8rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

/* Social-proof pill trong hero trang chu */
.hero-social-pill {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 30px;
    padding: .45rem 1.1rem .45rem .5rem;
    font-size: .9rem;
    color: rgba(255, 255, 255, .92);
}

.avatar-stack {
    display: inline-flex;
}

.mini-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient);
    border: 2px solid rgba(255, 255, 255, .85);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    color: #fff;
    margin-left: -8px;
}

.mini-avatar:first-child {
    margin-left: 0;
}

/* ==========================================================================
   Dark Mode Component Styles
   ========================================================================== */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .card-exam,
[data-bs-theme="dark"] .stat-card,
[data-bs-theme="dark"] .question-card,
[data-bs-theme="dark"] .answer-palette,
[data-bs-theme="dark"] .quote-stack,
[data-bs-theme="dark"] .exam-cover,
[data-bs-theme="dark"] .bg-white {
    background-color: var(--bg-card) !important;
    border-color: var(--border-soft) !important;
    color: var(--text-main);
}

[data-bs-theme="dark"] .card-header.bg-white,
[data-bs-theme="dark"] .card-header {
    background-color: #1e293b !important;
    border-bottom-color: var(--border-soft) !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .home-stats-section,
[data-bs-theme="dark"] .home-features-section {
    background-color: #0f172a !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #151e2e !important;
    color: var(--text-main) !important;
}

[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark"] .section-title,
[data-bs-theme="dark"] .quote-text,
[data-bs-theme="dark"] .card-title,
[data-bs-theme="dark"] .fw-bold,
[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6 {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .section-subtitle,
[data-bs-theme="dark"] .stat-label,
[data-bs-theme="dark"] .small.text-muted,
[data-bs-theme="dark"] p.text-muted,
[data-bs-theme="dark"] .text-white-50 {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .text-secondary {
    color: #cbd5e1 !important;
}

/* Badge Dark Mode Overrides (đảm bảo độ tương phản cao) */
[data-bs-theme="dark"] .badge.bg-warning,
[data-bs-theme="dark"] .badge.bg-warning *,
[data-bs-theme="dark"] .badge-status.bg-warning,
[data-bs-theme="dark"] .badge-vip,
[data-bs-theme="dark"] .badge-vip *,
[data-bs-theme="dark"] .btn-warning,
[data-bs-theme="dark"] .btn-warning * {
    color: #1c1917 !important;
}

[data-bs-theme="dark"] .badge.bg-light,
[data-bs-theme="dark"] .badge-status-muted {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

[data-bs-theme="dark"] .badge.bg-primary.bg-opacity-10,
[data-bs-theme="dark"] .badge-status-info {
    background-color: rgba(56, 189, 248, .2) !important;
    color: #38bdf8 !important;
}

[data-bs-theme="dark"] .badge.bg-secondary.bg-opacity-10 {
    background-color: rgba(148, 163, 184, .2) !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .badge-status-success {
    background-color: rgba(34, 197, 94, .2) !important;
    color: #4ade80 !important;
}

[data-bs-theme="dark"] .badge-status-warn {
    background-color: rgba(245, 159, 0, .2) !important;
    color: #fbbf24 !important;
}

[data-bs-theme="dark"] .badge-status-danger {
    background-color: rgba(239, 68, 68, .2) !important;
    color: #f87171 !important;
}

[data-bs-theme="dark"] .badge-status-purple {
    background-color: rgba(167, 139, 250, .2) !important;
    color: #c084fc !important;
}

[data-bs-theme="dark"] .subject-badge {
    background-color: rgba(56, 189, 248, .15) !important;
    color: #38bdf8 !important;
}

/* Question Header & Palette */
[data-bs-theme="dark"] .question-card .question-head,
[data-bs-theme="dark"] .bg-soft-stat,
[data-bs-theme="dark"] .subject-chipbar {
    background-color: #151e2e !important;
    border-color: var(--border-soft) !important;
}

[data-bs-theme="dark"] .ds-y-row {
    background-color: #1a2234 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .option-item {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .option-item:hover {
    background-color: rgba(56, 189, 248, .12);
    border-color: var(--accent);
}

[data-bs-theme="dark"] .option-item.selected {
    background-color: rgba(56, 189, 248, .2);
    border-color: var(--accent);
}

[data-bs-theme="dark"] .option-item .option-label {
    background-color: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

[data-bs-theme="dark"] .answer-palette .num-btn {
    background-color: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

[data-bs-theme="dark"] .answer-palette .num-btn:hover {
    border-color: var(--accent);
    color: #fff;
}

[data-bs-theme="dark"] .answer-palette .num-btn.answered {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #0f172a;
    font-weight: 700;
}

[data-bs-theme="dark"] .answer-palette .num-btn.active-q {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, .3);
}

[data-bs-theme="dark"] .save-pill-badge {
    background-color: rgba(34, 197, 94, .15);
    color: #4ade80;
}

[data-bs-theme="dark"] .question-card.flagged {
    background-color: #272317;
    border-color: #d97706;
}

[data-bs-theme="dark"] .question-card.flagged .question-head {
    background-color: #362f1b;
    border-bottom-color: #d97706;
}

[data-bs-theme="dark"] .btn-flag-q {
    background-color: #1e293b;
    border-color: #475569;
    color: #94a3b8;
}

[data-bs-theme="dark"] .btn-flag-q.active {
    background-color: #451a03;
    border-color: #d97706;
    color: #fcd34d;
}

[data-bs-theme="dark"] .subject-chip {
    background-color: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

[data-bs-theme="dark"] .subject-chip:hover,
[data-bs-theme="dark"] .subject-chip.active {
    background-color: #2563eb;
    color: #fff;
}

/* List Groups & Timeline */
[data-bs-theme="dark"] .list-group-item {
    background-color: var(--bg-card);
    border-color: var(--border-soft);
    color: var(--text-main);
}

[data-bs-theme="dark"] .list-group-item.bg-success {
    background-color: rgba(34, 197, 94, .15) !important;
}

/* Tables */
[data-bs-theme="dark"] .table-exam {
    background-color: #1e293b;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .table-exam thead th {
    background-color: #0f172a;
    color: #f8fafc;
}

[data-bs-theme="dark"] .table-exam tbody tr:hover {
    background-color: rgba(255, 255, 255, .04);
}

[data-bs-theme="dark"] .table-exam td,
[data-bs-theme="dark"] .table-exam th {
    border-color: #334155;
}

/* Inputs, Selects & Modals */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-control[readonly] {
    background-color: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #1e293b;
    border-color: var(--accent);
    color: #f8fafc;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #151e2e !important;
    border-color: #334155;
    color: #94a3b8;
}

[data-bs-theme="dark"] .quote-stack::before,
[data-bs-theme="dark"] .quote-stack::after {
    background-color: #1e293b;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1e293b;
    border: 1px solid #334155;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

[data-bs-theme="dark"] .dropdown-item {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: #334155;
    color: #fff;
}

[data-bs-theme="dark"] .dropdown-divider {
    border-color: #334155;
}

/* Exam Result Card Reviews */
[data-bs-theme="dark"] .result-correct {
    background-color: rgba(34, 197, 94, .12);
}

[data-bs-theme="dark"] .result-wrong {
    background-color: rgba(239, 68, 68, .12);
}

/* Stats Pill in KhoDe */
[data-bs-theme="dark"] .stats-toggle .nav-link {
    color: #94a3b8;
}

[data-bs-theme="dark"] .stats-toggle .nav-link.active {
    background-color: #2563eb;
    color: #fff;
}



/* ==========================================================================
   MODERN VISUAL EFFECTS: ANIMATED GRADIENTS, GLOW, GLASSMORPHISM & REVEAL
   ========================================================================== */

/* ---------- 1. Sticky Navbar + Glassmorphism ---------- */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 1040 !important;
    background: rgba(15, 23, 42, 0.82) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.main-nav.nav-scrolled {
    background: rgba(10, 18, 36, 0.94) !important;
    backdrop-filter: blur(24px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(200%) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    border-bottom-color: rgba(99, 102, 241, 0.3) !important;
    padding-top: 0.35rem !important;
    padding-bottom: 0.35rem !important;
}

[data-bs-theme="dark"] .main-nav {
    background: rgba(8, 13, 26, 0.85) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .main-nav.nav-scrolled {
    background: rgba(6, 10, 20, 0.96) !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(56, 189, 248, 0.08) !important;
    border-bottom-color: rgba(56, 189, 248, 0.25) !important;
}

.main-nav .nav-link {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    border-radius: 999px;
}

.main-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

.main-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 0 18px rgba(2, 132, 199, 0.45);
}

.main-nav .navbar-brand .brand-icon {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}

.main-nav .navbar-brand:hover .brand-icon {
    transform: scale(1.12) rotate(-8deg);
    box-shadow: 0 6px 22px rgba(2, 132, 199, 0.65), 0 0 18px rgba(99, 102, 241, 0.55);
}

/* Glassmorphism dropdown */
.main-nav .dropdown-menu {
    background: rgba(15, 23, 42, 0.92) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.45), 0 0 20px rgba(99, 102, 241, 0.15);
    padding: 0.5rem;
}

.main-nav .dropdown-menu .dropdown-item:not(.text-danger) {
    color: #e2e8f0;
}

.main-nav .dropdown-menu .dropdown-item:hover,
.main-nav .dropdown-menu .dropdown-item:focus {
    background-color: #334155;
}

.main-nav .dropdown-menu .dropdown-item:not(.text-danger):hover,
.main-nav .dropdown-menu .dropdown-item:not(.text-danger):focus {
    color: #fff;
}

/* ---------- 2. Animated Gradient + Glow ---------- */

/* Animated Hero background */
.hero {
    background: radial-gradient(circle at 85% 15%, rgba(2, 132, 199, .28) 0%, transparent 45%),
                radial-gradient(circle at 12% 85%, rgba(99, 102, 241, .28) 0%, transparent 45%),
                radial-gradient(circle at 50% 50%, rgba(219, 39, 119, .1) 0%, transparent 55%),
                linear-gradient(135deg, #090e1a 0%, #111e3b 50%, #0c1428 100%) !important;
    background-size: 200% 200% !important;
    animation: heroGradientShift 14s ease infinite;
    position: relative;
    overflow: hidden;
}

@keyframes heroGradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Hero Art gentle floating */
.hero-art {
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.45));
    animation: heroFloating 6s ease-in-out infinite;
    will-change: transform;
}

@keyframes heroFloating {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(0.8deg); }
}

/* Flowing gradient badges & buttons */
.badge-gradient {
    background: linear-gradient(135deg, #0284c7 0%, #6366f1 50%, #0284c7 100%) !important;
    background-size: 200% auto !important;
    animation: gradientFlow 4s linear infinite;
    box-shadow: 0 4px 18px rgba(99, 102, 241, .45), 0 0 12px rgba(2, 132, 199, .3) !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.badge-pro {
    background: linear-gradient(135deg, #0284c7 0%, #a855f7 50%, #0284c7 100%) !important;
    background-size: 200% auto !important;
    animation: gradientFlow 3s linear infinite;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.6) !important;
}

.badge-vip {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #f59e0b 100%) !important;
    background-size: 200% auto !important;
    animation: gradientFlow 4s linear infinite;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.5) !important;
    border: 1px solid rgba(254, 243, 199, 0.7) !important;
}

@keyframes gradientFlow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Pulsing Glow Effect */
.glow-pulse {
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.4), 0 0 5px rgba(2, 132, 199, 0.25);
    }
    50% {
        box-shadow: 0 0 28px rgba(99, 102, 241, 0.7), 0 0 14px rgba(2, 132, 199, 0.5);
    }
}

/* Button Shimmer + Glow */
.btn-primary-custom {
    background: linear-gradient(135deg, #0284c7 0%, #6366f1 50%, #0284c7 100%) !important;
    background-size: 200% auto !important;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 4px 18px rgba(2, 132, 199, .35), 0 0 10px rgba(99, 102, 241, .2) !important;
}

.btn-primary-custom::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -75%;
    width: 50%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: rotate(25deg);
    pointer-events: none;
    transition: none;
}

.btn-primary-custom:hover::after {
    left: 130%;
    transition: left 0.7s ease-in-out;
}

.btn-primary-custom:hover {
    background-position: right center !important;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 28px rgba(99, 102, 241, .55), 0 0 20px rgba(2, 132, 199, .4) !important;
}

/* Stat card & Exam card Glow hover */
.card-exam, .stat-card, .exam-cover-card {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease !important;
}

.card-exam:hover, .exam-cover-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12), 0 0 25px rgba(2, 132, 199, 0.18) !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
}

.stat-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 18px 35px rgba(2, 132, 199, 0.15), 0 0 20px rgba(99, 102, 241, 0.12) !important;
}

[data-bs-theme="dark"] .card-exam:hover,
[data-bs-theme="dark"] .exam-cover-card:hover {
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.22) !important;
    border-color: rgba(167, 139, 250, 0.5) !important;
}

[data-bs-theme="dark"] .stat-card:hover {
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.65), 0 0 25px rgba(56, 189, 248, 0.18) !important;
}

/* Stat icons reactive hover */
.stat-icon {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease !important;
}

.card-exam:hover .stat-icon, 
.stat-card:hover .stat-icon,
.home-shortcuts-section .card:hover .stat-icon {
    transform: scale(1.14) rotate(6deg) !important;
    box-shadow: 0 8px 25px rgba(2, 132, 199, 0.5) !important;
}

/* Glassmorphism Social Pill */
.hero-social-pill {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 15px rgba(2, 132, 199, 0.2);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.hero-social-pill:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 25px rgba(99, 102, 241, 0.35);
}

/* ---------- 3. Scroll Reveal + Stagger Animation ---------- */
.reveal, .reveal-up {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.93) translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.stagger-group .stagger-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.revealed, 
.reveal-up.revealed, 
.reveal-scale.revealed, 
.stagger-group .stagger-item.revealed {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

@media (prefers-reduced-motion: reduce) {
    .reveal, .reveal-up, .reveal-scale, .stagger-item {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .hero {
        animation: none !important;
    }
    .hero-art {
        animation: none !important;
    }
}


/* ---------- 4. Scroll Progress Bar & Floating Back to Top ---------- */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #0284c7, #6366f1, #db2777, #0284c7);
    background-size: 300% 100%;
    animation: gradientFlow 5s linear infinite;
    z-index: 2050;
    transition: width 0.15s ease-out;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.7);
    pointer-events: none;
}

.btn-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #6366f1 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 1030;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.85);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 25px rgba(2, 132, 199, 0.4), 0 0 15px rgba(99, 102, 241, 0.3);
}

.btn-back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.btn-back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 14px 35px rgba(99, 102, 241, 0.6), 0 0 25px rgba(2, 132, 199, 0.5);
    color: #fff;
}

/* ---------- 5. Mouse Spotlight on Interactive Cards ---------- */
.card-exam, .stat-card, .exam-cover-card, .home-shortcuts-section .card {
    position: relative;
    overflow: hidden;
}

.card-exam::after, .stat-card::after, .exam-cover-card::after, .home-shortcuts-section .card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: radial-gradient(400px circle at var(--mouse-x, -500px) var(--mouse-y, -500px), rgba(99, 102, 241, 0.12), transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 1;
}

[data-bs-theme="dark"] .card-exam::after, 
[data-bs-theme="dark"] .stat-card::after, 
[data-bs-theme="dark"] .exam-cover-card::after, 
[data-bs-theme="dark"] .home-shortcuts-section .card::after {
    background: radial-gradient(400px circle at var(--mouse-x, -500px) var(--mouse-y, -500px), rgba(56, 189, 248, 0.16), transparent 70%);
}

.card-exam:hover::after, .stat-card:hover::after, .exam-cover-card:hover::after, .home-shortcuts-section .card:hover::after {
    opacity: 1;
}

/* ---------- 6. Ambient Aurora Orbs (Hero Section) ---------- */
.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: 0.32;
    will-change: transform;
}

.orb-1 {
    width: 340px;
    height: 340px;
    background: #0284c7;
    top: -50px;
    right: 5%;
    animation: orbFloat1 18s ease-in-out infinite alternate;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: #7c4dff;
    bottom: -60px;
    left: 5%;
    animation: orbFloat2 22s ease-in-out infinite alternate;
}

.orb-3 {
    width: 240px;
    height: 240px;
    background: #db2777;
    top: 40%;
    left: 45%;
    animation: orbFloat3 16s ease-in-out infinite alternate;
}

@keyframes orbFloat1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-45px, 55px) scale(1.15); }
}

@keyframes orbFloat2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(55px, -45px) scale(1.2); }
}

@keyframes orbFloat3 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-35px, -35px) scale(0.9); }
}

/* ---------- 7. Button Ripple Animation ---------- */
.btn-primary-custom, .btn-outline-custom, .btn-user, .subject-chip {
    position: relative;
    overflow: hidden;
}

.btn-ripple {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%) scale(0);
    animation: rippleWave 0.65s linear forwards;
    pointer-events: none;
}

@keyframes rippleWave {
    to {
        transform: translate(-50%, -50%) scale(26);
        opacity: 0;
    }
}

/* ---------- 8. Glass Shine Reflection on Book Covers ---------- */
.exam-cover {
    position: relative;
    overflow: hidden;
}

.exam-cover::after {
    content: '';
    position: absolute;
    top: -120%;
    left: -120%;
    width: 70%;
    height: 340%;
    background: linear-gradient(55deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
    transform: rotate(25deg);
    transition: none;
    pointer-events: none;
}

.exam-cover-card:hover .exam-cover::after {
    left: 220%;
    transition: left 0.95s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 9. Live Status Pulsing Indicator ---------- */
.pulse-dot-green {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #22c55e;
    position: relative;
    margin-right: 6px;
    vertical-align: middle;
}

.pulse-dot-green::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #22c55e;
    opacity: 0.75;
    animation: pulseRing 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes pulseRing {
    0% { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* ---------- 10. Reading Passage Styling for English & Literature ---------- */
.reading-passage {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--accent, #4f46e5);
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 18px;
    line-height: 1.75;
    font-size: 0.96rem;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-bs-theme="dark"] .reading-passage {
    background-color: #1e293b;
    border-color: #334155;
    border-left-color: #6366f1;
    color: #f1f5f9;
}

.reading-passage p:last-child {
    margin-bottom: 0;
}

.reading-passage .passage-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent, #4f46e5);
    margin-bottom: 10px;
}

.question-text {
    line-height: 1.7;
    font-size: 0.96rem;
}
