/* ExamVault v3 — Professional Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ─── Light Theme (Default) ─── */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --primary-glow: rgba(79,70,229,.1);
    --secondary: #0ea5e9;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;

    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-input: #ffffff;
    --text: #0f172a;
    --text-light: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(0,0,0,.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.05), 0 2px 4px -2px rgba(0,0,0,.03);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,.08), 0 4px 10px -5px rgba(0,0,0,.04);
    --transition: all .15s ease;

    --auth-gradient: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f8fafc 100%);
    --table-header-bg: #f8fafc;
    --admin-sidebar-bg: #0f172a;
    --admin-sidebar-text: #94a3b8;
    --admin-sidebar-active: #f1f5f9;
    --admin-sidebar-border: #1e293b;
}

/* ─── Dark Theme ─── */
[data-theme="dark"] {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --bg-input: #1e293b;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;

    --shadow: 0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.4), 0 2px 4px -2px rgba(0,0,0,.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.3);

    --primary-glow: rgba(99,102,241,.25);
    --auth-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #1e293b 100%);
    --table-header-bg: #334155;
    --admin-sidebar-bg: #0f172a;
    --admin-sidebar-border: #1e293b;

    color-scheme: dark;
}

/* Smooth transition on theme toggle */
html { transition: background .3s ease, color .3s ease; }
body, .card, .navbar, .form-input, .stat-card, .alert, .auth-card, .btn-secondary, .list-item {
    transition: background .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ─── Lucide Icon Utilities ─── */
.icon { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 28px; height: 28px; }
.icon-2xl { width: 36px; height: 36px; }
.icon-stat { width: 20px; height: 20px; padding: 8px; border-radius: 8px; box-sizing: content-box; }
.icon-primary { color: var(--primary); background: var(--primary-glow); }
.icon-success { color: var(--success); background: rgba(5,150,105,.1); }
.icon-warning { color: var(--warning); background: rgba(217,119,6,.1); }
.icon-danger { color: var(--danger); background: rgba(220,38,38,.1); }
.icon-sky { color: var(--secondary); background: rgba(14,165,233,.1); }

/* ─── Layout ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.container-sm { max-width: 480px; margin: 0 auto; padding: 0 1.25rem; }

/* ─── Cards ─── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: .875rem;
}
.card-body { padding: 1.25rem; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .875rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
    position: relative;
    overflow: hidden;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; box-shadow: 0 4px 12px var(--primary-glow); }
.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-gradient {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}
.btn-gradient:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(79,70,229,.25);
    color: #fff;
}

/* Button ripple effect */
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.35);
    transform: scale(0);
    animation: ripple-anim .5s ease-out;
    pointer-events: none;
}
@keyframes ripple-anim {
    to { transform: scale(4); opacity: 0; }
}

/* ─── Forms ─── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    font-weight: 500;
    font-size: .875rem;
    color: var(--text);
    margin-bottom: .4rem;
}
.form-input {
    width: 100%;
    padding: .75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-input);
    color: var(--text);
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ─── Alerts ─── */
.alert {
    padding: .875rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
[data-theme="dark"] .alert-error { background: rgba(239,68,68,.15); color: #fca5a5; border-color: rgba(239,68,68,.3); }
[data-theme="dark"] .alert-success { background: rgba(16,185,129,.15); color: #6ee7b7; border-color: rgba(16,185,129,.3); }

/* ─── Toast Notifications ─── */
.toast-container {
    position: fixed; top: 1rem; right: 1rem; z-index: 9999;
    display: flex; flex-direction: column; gap: .5rem;
    pointer-events: none;
}
.toast {
    padding: .875rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: .85rem; font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toast-in .4s cubic-bezier(.21,1.02,.73,1) forwards;
    pointer-events: auto;
    display: flex; align-items: center; gap: .5rem;
    max-width: 360px;
    backdrop-filter: blur(10px);
}
.toast.success { background: rgba(16,185,129,.95); color: #fff; }
.toast.error { background: rgba(239,68,68,.95); color: #fff; }
.toast.info { background: rgba(99,102,241,.95); color: #fff; }
.toast.out { animation: toast-out .3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(80px) scale(.9); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(80px) scale(.9); } }

/* ─── Navbar ─── */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
[data-theme="dark"] .navbar { background: rgba(15,23,42,.88); }
.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.navbar-brand {
    font-weight: 800;
    font-size: 1.125rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: .5rem;
    letter-spacing: -.025em;
}
.navbar-brand svg,
.navbar-brand .brand-icon { color: var(--primary); }
.navbar-links { display: flex; align-items: center; gap: .125rem; height: 100%; }
.navbar-links a {
    padding: .5rem .75rem;
    border-radius: var(--radius-sm);
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: .375rem;
    position: relative;
    height: 56px;
    border-radius: 0;
}
.navbar-links a:hover {
    color: var(--text);
    background: transparent;
}
.navbar-links a.active {
    color: var(--primary);
    background: transparent;
    font-weight: 600;
}
.navbar-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: .75rem;
    right: .75rem;
    height: 2px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
}
.navbar-user {
    display: flex;
    align-items: center;
    gap: .625rem;
}
.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .75rem;
}

/* Theme toggle */
.theme-toggle {
    background: none; border: none; cursor: pointer;
    font-size: 1.125rem; padding: .375rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
}
.theme-toggle:hover { background: var(--bg-hover); color: var(--text); }

/* Mobile menu */
.mobile-toggle { display: none; background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--text); padding: .375rem; }
@media (max-width: 768px) {
    .mobile-toggle { display: block; }
    .navbar-links { display: none; flex-direction: column; align-items: stretch; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-card); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: .5rem; z-index: 100; }
    .navbar-links a { height: auto; border-radius: var(--radius-sm); }
    .navbar-links a.active::after { display: none; }
    .navbar-links a.active { background: var(--primary-glow); }
    .navbar-links.open { display: flex; }
    .navbar-user .avatar-name { display: none; }
}

/* ─── Stats Grid ─── */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .875rem; margin-bottom: 1.5rem; }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.125rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: .625rem;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon { display: flex; }
.stat-value { font-size: 1.375rem; font-weight: 700; color: var(--text); letter-spacing: -.025em; }
.stat-label { font-size: .7rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }

/* ─── Action Cards ─── */
.action-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    color: #fff;
    text-decoration: none;
    transition: all .2s ease;
    margin-bottom: 0;
}
.action-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: #fff; }
.action-card h3 { font-size: .9375rem; font-weight: 600; }
.action-card p { font-size: .7rem; opacity: .8; margin-top: .125rem; }
.action-card .arrow { font-size: 1.125rem; transition: transform .2s; opacity: .7; }
.action-card:hover .arrow { transform: translateX(4px); opacity: 1; }
.gradient-primary { background: var(--primary); }
.gradient-primary:hover { background: var(--primary-dark); }
.gradient-amber { background: #d97706; }
.gradient-amber:hover { background: #b45309; }
.gradient-emerald { background: #059669; }
.gradient-emerald:hover { background: #047857; }

/* ─── Auth Pages ─── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--auth-gradient);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    border: 1px solid var(--border);
}
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.auth-logo p { color: var(--text-muted); font-size: .875rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .875rem; color: var(--text-light); }

/* ─── Utilities ─── */
.text-center { text-align: center; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-amber { color: var(--secondary); }
.fw-bold { font-weight: 700; }
.fw-black { font-weight: 900; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.flex-1 { flex: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 768px) {
    .grid-3 { grid-template-columns: 1fr; }
}

/* ─── Page Content ─── */
.page-header { padding: 1.25rem 0 .5rem; }
.page-header h2 { font-size: 1.125rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.page-content { padding: 1rem 0 3rem; }

/* ─── Welcome Page ─── */
.welcome-page {
    min-height: 100vh;
    background: var(--bg);
    overflow: hidden;
}
.welcome-nav {
    display: flex; justify-content: space-between; align-items: center;
    max-width: 1200px; margin: 0 auto; padding: 1.25rem 2rem;
}
.welcome-nav-brand { font-size: 1.25rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: .5rem; letter-spacing: -.025em; }
.welcome-nav-actions { display: flex; gap: .75rem; align-items: center; }

.hero {
    text-align: center;
    padding: 5rem 2rem 3rem;
    position: relative;
}
.hero h1 {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 60%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -.03em;
}
.hero .subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 560px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}
.hero-buttons { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* Floating icons animation */
.floating-icons {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none; overflow: hidden;
}
.floating-icon {
    position: absolute;
    font-size: 2rem;
    opacity: .12;
    animation: float-around 15s infinite ease-in-out;
}
.floating-icon:nth-child(1) { left: 8%; top: 15%; animation-delay: 0s; }
.floating-icon:nth-child(2) { right: 12%; top: 10%; animation-delay: -3s; font-size: 1.5rem; }
.floating-icon:nth-child(3) { left: 15%; bottom: 20%; animation-delay: -6s; font-size: 2.5rem; }
.floating-icon:nth-child(4) { right: 8%; bottom: 15%; animation-delay: -9s; }
.floating-icon:nth-child(5) { left: 45%; top: 8%; animation-delay: -12s; font-size: 1.75rem; }
.floating-icon:nth-child(6) { right: 25%; top: 35%; animation-delay: -2s; font-size: 1.5rem; }

@keyframes float-around {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(5deg); }
    50% { transform: translateY(-8px) rotate(-3deg); }
    75% { transform: translateY(-25px) rotate(3deg); }
}

/* Stats counter section */
.stats-counter-section {
    padding: 3rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}
.stats-counter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: center;
}
.stats-counter-item .count-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}
.stats-counter-item .count-label {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: .375rem;
}

/* Feature cards */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    padding: 2rem 2rem 4rem;
    max-width: 1100px;
    margin: 0 auto;
}
.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    text-align: center;
    transition: all .3s cubic-bezier(.21,1.02,.73,1);
    position: relative;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.feature-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.feature-card h3 { font-weight: 700; margin-bottom: .5rem; font-size: 1rem; }
.feature-card p { font-size: .8125rem; color: var(--text-light); line-height: 1.6; }

/* Welcome footer */
.welcome-footer {
    text-align: center; padding: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted); font-size: .8rem;
}

/* ─── Lists ─── */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}
.list-item:hover { background: var(--bg-hover); }
.list-item:last-child { border-bottom: none; }

/* ─── Page Load Animations ─── */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp .5s ease forwards;
}
.fade-in-up:nth-child(1) { animation-delay: 0s; }
.fade-in-up:nth-child(2) { animation-delay: .08s; }
.fade-in-up:nth-child(3) { animation-delay: .16s; }
.fade-in-up:nth-child(4) { animation-delay: .24s; }
.fade-in-up:nth-child(5) { animation-delay: .32s; }
.fade-in-up:nth-child(6) { animation-delay: .4s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

.page-content > *,
.page-content .stats-grid .stat-card,
.page-content .grid-3 > *,
.page-content .card {
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInUp .45s ease forwards;
}
.page-content > *:nth-child(1) { animation-delay: .05s; }
.page-content > *:nth-child(2) { animation-delay: .1s; }
.page-content > *:nth-child(3) { animation-delay: .15s; }
.page-content > *:nth-child(4) { animation-delay: .2s; }
.page-content > *:nth-child(5) { animation-delay: .25s; }

.page-content .stats-grid .stat-card:nth-child(1) { animation-delay: .05s; }
.page-content .stats-grid .stat-card:nth-child(2) { animation-delay: .1s; }
.page-content .stats-grid .stat-card:nth-child(3) { animation-delay: .15s; }
.page-content .stats-grid .stat-card:nth-child(4) { animation-delay: .2s; }

/* ─── Count Up Animation ─── */
.count-up { display: inline-block; }

/* ─── Table Dark Mode Fix ─── */
[data-theme="dark"] table thead tr { background: var(--table-header-bg) !important; }
[data-theme="dark"] table tbody tr { border-color: var(--border); }

/* ═══════════════════════════════════════════════
   CUSTOM CONFIRM MODAL
   ═══════════════════════════════════════════════ */
.exam-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .25s ease;
    padding: 1rem;
}
.exam-modal-overlay.active {
    opacity: 1;
}
.exam-modal-overlay.closing {
    opacity: 0;
}
.exam-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .15);
    padding: 1.75rem 1.75rem 1.5rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    transform: scale(0.95) translateY(10px);
    transition: transform .25s cubic-bezier(.21,1.02,.73,1), opacity .2s ease;
    opacity: 0;
}
.exam-modal-overlay.active .exam-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}
.exam-modal-overlay.closing .exam-modal {
    transform: scale(0.95) translateY(8px);
    opacity: 0;
}
.exam-modal-icon {
    font-size: 2.25rem;
    margin-bottom: .625rem;
    line-height: 1;
    animation: modalIconPop .35s cubic-bezier(.21,1.02,.73,1) .1s both;
}
@keyframes modalIconPop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.exam-modal-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .375rem;
    letter-spacing: -.01em;
}
.exam-modal-message {
    font-size: .8125rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}
.exam-modal-actions {
    display: flex;
    gap: .625rem;
    justify-content: center;
}
.exam-modal-actions .btn {
    flex: 1;
    padding: .625rem 1rem;
    font-size: .8125rem;
    border-radius: var(--radius-sm);
    min-height: 40px;
}
[data-theme="dark"] .exam-modal {
    box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
@media (max-width: 480px) {
    .exam-modal {
        padding: 1.5rem 1.25rem 1.25rem;
        border-radius: 14px;
        margin: 0 .5rem;
    }
    .exam-modal-icon { font-size: 2rem; }
    .exam-modal-actions .btn { font-size: .8rem; padding: .6rem .875rem; }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.25rem; }
    .stats-counter-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .features { grid-template-columns: 1fr; padding: 1rem 1rem 3rem; }
}

/* --- Pagination --- */
.pagination { display: flex; align-items: center; gap: .375rem; flex-wrap: wrap; font-size: .8rem; }
.page-btn { padding: .375rem .75rem; border-radius: 8px; background: var(--bg-hover); color: var(--text); text-decoration: none; font-weight: 500; transition: all .15s; border: 1px solid transparent; }
.page-btn:hover { background: var(--primary-glow); border-color: var(--primary-light); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; font-weight: 700; pointer-events: none; }
.page-dots { padding: 0 .25rem; color: var(--text-muted); }
.page-info { margin-left: auto; color: var(--text-muted); font-size: .75rem; }

/* ═══════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION BAR
   ═══════════════════════════════════════════════ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0,0,0,.08);
    padding: .25rem 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    backdrop-filter: blur(16px);
}
[data-theme="dark"] .mobile-bottom-nav {
    background: rgba(30, 41, 59, .92);
    box-shadow: 0 -4px 20px rgba(0,0,0,.3);
}
.mobile-bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
}
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .125rem;
    padding: .375rem .5rem;
    min-width: 56px;
    min-height: 48px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: .6rem;
    font-weight: 600;
    transition: all .2s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.mobile-nav-item .mobile-nav-icon {
    font-size: 1.25rem;
    line-height: 1;
    transition: transform .2s ease;
}
.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: var(--primary);
}
.mobile-nav-item.active .mobile-nav-icon {
    transform: scale(1.15);
}
.mobile-nav-item.active::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    border-radius: 3px;
    background: var(--primary);
}

@media (max-width: 768px) {
    .mobile-bottom-nav { display: block; }
    /* Add padding to body so content isn't hidden behind bottom nav */
    body.has-bottom-nav { padding-bottom: 70px; }
    /* Hide the hamburger menu links on mobile since we have bottom nav  */
    .navbar-links a { font-size: .8rem; }
}

/* ═══════════════════════════════════════════════
   TOUCH-OPTIMIZED QUIZ INTERFACE
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Larger option buttons for touch */
    .option-btn {
        padding: 1rem 1.125rem;
        margin-bottom: .625rem;
        font-size: .95rem;
        min-height: 52px;
        border-radius: 12px;
    }
    .option-label {
        width: 34px;
        height: 34px;
        font-size: .85rem;
    }
    /* Bigger True/False toggle buttons */
    .tf-btn {
        padding: 1.25rem;
        font-size: 1.2rem;
        min-height: 56px;
        border-radius: 12px;
    }
    /* Question card adjustments */
    .question-header {
        padding: .75rem 1rem;
    }
    .question-body {
        padding: 1rem;
    }
    .question-text {
        font-size: 1rem;
        line-height: 1.65;
    }
    /* Touch-friendly flag/hint buttons */
    .flag-btn {
        font-size: 1.2rem;
        padding: .5rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .hint-btn {
        padding: .5rem .875rem;
        font-size: .8rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    /* Submit button */
    .btn-lg {
        padding: 1.125rem 2rem;
        font-size: 1.05rem;
        min-height: 52px;
    }
    /* Navigator dots - bigger for touch */
    .nav-dot {
        font-size: .8rem;
        border-radius: 10px;
        min-width: 38px;
        min-height: 38px;
    }
    /* Quiz config mode cards - touch friendly */
    .mode-content {
        padding: 1.25rem .75rem;
    }
    /* Topic chips - bigger tap targets */
    .topic-chip {
        padding: .625rem 1rem !important;
        font-size: .9rem !important;
        min-height: 44px;
    }
    /* Tag filter chips */
    .tag-filter-chip {
        padding: .5rem 1rem !important;
        font-size: .85rem !important;
        min-height: 40px;
    }
    /* Quiz progress bar area */
    .quiz-progress {
        padding: .625rem 0;
    }
    .timer {
        font-size: 1.05rem;
    }
}

/* ═══════════════════════════════════════════════
   ADMIN MOBILE RESPONSIVE — CARD VIEWS
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* ---- Admin Questions Table → Cards ---- */
    .admin-questions-table thead { display: none; }
    .admin-questions-table tbody tr {
        display: block;
        padding: .875rem 1rem;
        border-bottom: 1px solid var(--border);
        position: relative;
    }
    .admin-questions-table tbody td {
        display: block;
        padding: .125rem 0;
        text-align: left !important;
        border: none;
    }
    /* Hide checkbox column on mobile */
    .admin-questions-table td.aq-check-col { 
        position: absolute;
        top: .875rem;
        right: 1rem;
    }
    .admin-questions-table td.aq-question-col {
        padding-right: 2.5rem;
    }
    .admin-questions-table td.aq-question-col > div {
        white-space: normal !important;
        overflow: visible !important;
        font-size: .9rem;
    }
    .admin-questions-table td.aq-topic-col {
        margin-top: .25rem;
    }
    .admin-questions-table td.aq-meta-col {
        display: inline-block;
        margin-right: .5rem;
        padding: .125rem 0;
    }
    .admin-questions-table td.aq-actions-col {
        margin-top: .5rem;
        text-align: left !important;
    }
    .admin-questions-table td.aq-actions-col .btn {
        padding: .375rem .75rem;
        font-size: .75rem;
        min-height: 36px;
    }

    /* ---- Admin Users Table → Cards ---- */
    .admin-users-table thead { display: none; }
    .admin-users-table tbody tr {
        display: block;
        padding: .875rem 1rem;
        border-bottom: 1px solid var(--border);
    }
    .admin-users-table tbody td {
        display: block;
        padding: .125rem 0;
        text-align: left !important;
        border: none;
    }
    .admin-users-table td.au-user-col {
        margin-bottom: .375rem;
    }
    .admin-users-table td.au-meta-col {
        display: inline-block;
        margin-right: .625rem;
        padding: .125rem 0;
        font-size: .8rem;
    }
    .admin-users-table td.au-meta-col::before {
        font-size: .65rem;
        color: var(--text-muted);
        display: block;
        font-weight: 500;
    }
    .admin-users-table td.au-level::before { content: 'Level'; }
    .admin-users-table td.au-xp::before { content: 'XP'; }
    .admin-users-table td.au-quizzes::before { content: 'Quizzes'; }
    .admin-users-table td.au-streak::before { content: 'Streak'; }
    .admin-users-table td.au-last-active {
        font-size: .75rem;
        margin-top: .25rem;
    }
    .admin-users-table td.au-last-active::before {
        content: 'Last Active: ';
        font-weight: 600;
        color: var(--text-muted);
    }
    .admin-users-table td.au-actions-col {
        margin-top: .5rem;
        display: flex;
        flex-wrap: wrap;
        gap: .375rem;
    }
    .admin-users-table td.au-actions-col .btn {
        padding: .375rem .75rem;
        font-size: .75rem;
        min-height: 36px;
    }
    .admin-users-table td.au-actions-col form {
        display: inline-flex;
    }

    /* Admin general mobile improvements */
    .admin-main { padding: .75rem !important; }
    .admin-main h2 { font-size: 1.1rem !important; }
    .admin-header-bar { margin-bottom: .5rem; }

    /* Admin filter/actions bar stacking */
    .admin-top-actions {
        flex-direction: column;
        gap: .5rem;
    }
    .admin-top-actions > * {
        width: 100%;
    }
    .admin-filter-form {
        flex-direction: column;
    }
    .admin-filter-form .form-group {
        min-width: 100% !important;
    }
}
