:root {
    color-scheme: light;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-dark-primary: #0f172a;
    --bg-dark-secondary: #1e293b;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-dark-primary: #f1f5f9;
    --text-dark-secondary: #cbd5e1;
    --border-primary: #e2e8f0;
    --border-dark-primary: #334155;
}

.dark {
    color-scheme: dark;
}

html {
    background-color: #f8fafc !important;
    transition: background-color 0.3s ease;
}

html.dark {
    background-color: #0f172a !important;
}

body {
    color: var(--text-primary);
    background-color: #f8fafc !important;
}

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

*, ::before, ::after {
    box-sizing: border-box;
}
/* 
body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
        "Segoe UI Emoji";
}

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

.no-underline { text-decoration: none; }
.transition-colors { transition: background-color 0.15s ease, color 0.15s ease; }

.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.shrink-0 { flex-shrink: 0; }
.w-64 { width: 16rem; }
.mt-auto { margin-top: auto; }

.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-r { border-right-width: 1px; }
.border-dashed { border-style: dashed; }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-300 { border-color: #cbd5f5; }
.border-slate-700 { border-color: #334155; }
.border-slate-800 { border-color: #1e293b; }

.bg-white { background-color: #ffffff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-700 { background-color: #1d4ed8; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-slate-800 { background-color: #1e293b; }
.bg-slate-900 { background-color: #0f172a; }
.bg-slate-950 { background-color: #020617; }
.bg-white\/70 { background-color: rgba(255, 255, 255, 0.7); }
.bg-slate-950\/70 { background-color: rgba(2, 6, 23, 0.7); }

.text-slate-900 { color: #0f172a; }
.text-slate-600 { color: #475569; }
.text-slate-500 { color: #64748b; }
.text-slate-400 { color: #94a3b8; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-100 { color: #f1f5f9; }
.text-white { color: #ffffff; }
.text-blue-900 { color: #0f172a; }
.text-blue-800 { color: #1e3a8a; }
.text-blue-200 { color: #bfdbfe; }

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

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.tracking-tight { letter-spacing: -0.025em; }

.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-2 { padding: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.rounded-lg { border-radius: 0.5rem; }
.rounded-2xl { border-radius: 1rem; }

.shad1 { gap: 0.25rem; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.list-disc { list-style-type: disc; }
.pl-5 { padding-left: 1.25rem; }

.backdrop-blur { backdrop-filter: blur(10px); }

.grid { display: grid; }

.space-y-8 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 2rem;
} */

@media (min-width: 768px) {
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.dark .dark\:bg-slate-800 { background-color: #1e293b; }
.dark .dark\:bg-slate-900 { background-color: #0f172a; }
.dark .dark\:bg-slate-950 { background-color: #020617; }
.dark .dark\:bg-slate-950\/70 { background-color: rgba(2, 6, 23, 0.7); }
.dark .dark\:text-slate-100 { color: #f1f5f9; }
.dark .dark\:text-slate-300 { color: #cbd5e1; }
.dark .dark\:text-slate-400 { color: #94a3b8; }
.dark .dark\:border-slate-700 { border-color: #334155; }
.dark .dark\:border-slate-800 { border-color: #1e293b; }
.dark .dark\:bg-blue-900 { background-color: #0f172a; }
.dark .dark\:text-blue-200 { color: #bfdbfe; }

.hover\:bg-slate-50:hover { background-color: #f8fafc; }
.dark .dark\:hover\:bg-slate-800:hover { background-color: #1e293b; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }

/* Mobile menu styles */
.sidebar {
    position: relative;
    z-index: 40;
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 30;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

.menu-button {
    display: none;
}

@media (max-width: 1023px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 40;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .menu-button {
        display: block;
    }

    .lg-hidden {
        display: block;
    }
}

@media (min-width: 1024px) {
    .sidebar {
        transform: translateX(0) !important;
    }

    .menu-button {
        display: none !important;
    }

    .lg-hidden {
        display: none;
    }
}

/* ── Quiz tabs ─────────────────────────────────────────────────────────── */
.quiz-tab-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem 0.5rem 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    color: #64748b;
    background: transparent;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    position: relative;
    bottom: -1px;
    white-space: nowrap;
}
.quiz-tab-btn:hover {
    color: #1e293b;
    background: #f1f5f9;
}
.quiz-tab-btn.active {
    color: #2563eb;
    background: #ffffff;
    border-color: #e2e8f0;
    font-weight: 600;
}
.dark .quiz-tab-btn         { color: #94a3b8; }
.dark .quiz-tab-btn:hover   { color: #e2e8f0; background: #1e293b; }
.dark .quiz-tab-btn.active  { color: #60a5fa; background: #020617; border-color: #1e293b; }

/* ── Difficulty badges (table + section headers) ───────────────────────── */
.diff-badge {
    display: inline-block;
    padding: 0.125rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.4;
}
.diff-easy   { background: #dcfce7; color: #166534; }
.diff-medium { background: #fef9c3; color: #854d0e; }
.diff-hard   { background: #fee2e2; color: #991b1b; }

.dark .diff-easy   { background: rgba(21, 128, 61, 0.25);   color: #86efac; }
.dark .diff-medium { background: rgba(161, 98, 7, 0.25);    color: #fde047; }
.dark .diff-hard   { background: rgba(185, 28, 28, 0.25);   color: #fca5a5; }

/* Larger badge used as section header label */
.diff-badge-lg {
    display: inline-block;
    padding: 0.25rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Correct-answer highlight in options list */
.option-correct { color: #16a34a; font-weight: 600; }
.dark .option-correct { color: #4ade80; }

/* ── Quiz action buttons ────────────────────────────────────────────────── */
.quiz-btn-primary {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    background: #2563eb;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}
.quiz-btn-primary:hover { background: #1d4ed8; }

.quiz-btn-success {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    background: #059669;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}
.quiz-btn-success:hover { background: #047857; }

/* ── Seed success banner ────────────────────────────────────────────────── */
.quiz-success-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}
.dark .quiz-success-banner {
    background: rgba(21, 128, 61, 0.15);
    border-color: rgba(21, 128, 61, 0.4);
    color: #86efac;
}
.quiz-success-icon { width: 1rem; height: 1rem; flex-shrink: 0; margin-top: 0.125rem; }
.quiz-success-title { font-weight: 600; }
.quiz-success-body  { font-size: 0.875rem; margin-top: 0.125rem; }
