:root {
    --primary: #2dd4bf;
    --primary-hover: #14b8a6;
    --secondary: #f97316;
    --accent: #38bdf8;
    --dark: #0b1020;
    --light: #f8fafc;
    --glass: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(148, 163, 184, 0.16);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --surface: rgba(15, 23, 42, 0.72);
    --surface-strong: rgba(15, 23, 42, 0.92);
}

* {
    box-sizing: border-box;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(148, 163, 184, 0.4);
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--dark);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-image: radial-gradient(circle at 20% 10%, rgba(45, 212, 191, 0.18) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(56, 189, 248, 0.16) 0%, transparent 45%),
        radial-gradient(circle at 70% 80%, rgba(249, 115, 22, 0.12) 0%, transparent 35%),
        linear-gradient(180deg, #0b1020 0%, #0f172a 60%, #111827 100%);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(120deg, rgba(14, 165, 233, 0.05), transparent 60%),
        repeating-linear-gradient(0deg, rgba(148, 163, 184, 0.05) 0, rgba(148, 163, 184, 0.05) 1px, transparent 1px, transparent 70px),
        repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.04) 0, rgba(148, 163, 184, 0.04) 1px, transparent 1px, transparent 80px);
    pointer-events: none;
    z-index: -1;
}

.brand {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-mark {
    width: 36px;
    height: 36px;
}

.brand-text {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
}

.brand-text span {
    color: var(--text-main);
    opacity: 0.7;
}

.is-hidden {
    display: none !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.4);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -12px rgba(45, 212, 191, 0.75);
}

.btn-ghost {
    background: transparent;
    color: var(--text-main);
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 10px 20px -12px rgba(45, 212, 191, 0.5);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -12px rgba(239, 68, 68, 0.6);
}

.btn-block {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

h1,
h2,
h3 {
    font-weight: 700;
    margin-top: 0;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 3rem;
    background: linear-gradient(to right, #38bdf8, #2dd4bf);
    /* Sky to Emerald */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Loading Animation */
.loader {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Quiz UI */
.quiz-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    height: calc(100vh - 220px);
}

.quiz-shell {
    margin-top: 2rem;
    padding: 1.5rem;
}

.sidebar {
    height: 100%;
    overflow-y: auto;
    padding-right: 4px;
    /* Slight gutter for scrollbar */
}

.sidebar-card {
    padding: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.08);
    background: var(--surface-strong);
}

.sidebar-title {
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding-bottom: 2rem;
}

.q-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    box-sizing: border-box;
    overflow: hidden;
    transition: all 0.2s;
}

.q-btn:hover {
    background: rgba(45, 212, 191, 0.12);
    border-color: rgba(45, 212, 191, 0.5);
    color: var(--text-main);
}

.q-btn.active {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.9), rgba(56, 189, 248, 0.7));
    color: #0b1020;
    border-color: transparent;
    font-weight: 700;
}

.q-btn.answered {
    background: rgba(45, 212, 191, 0.18);
    border-color: rgba(45, 212, 191, 0.5);
    color: var(--text-main);
}

.quiz-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.quiz-progress {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(45, 212, 191, 0.35);
    color: var(--primary);
    background: rgba(45, 212, 191, 0.1);
}

.quiz-timer {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 1rem;
    padding: 0.5rem 0.9rem;
    border-radius: 0.8rem;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-main);
}

.question-card {
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    display: block;
    background: rgba(15, 23, 42, 0.6);
}

.question-text {
    font-size: 1.4rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-item {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.16);
    padding: 1.2rem 1.4rem;
    border-radius: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.option-item:hover {
    background: rgba(45, 212, 191, 0.08);
    border-color: rgba(45, 212, 191, 0.4);
    transform: translateY(-1px);
}

.option-item.selected {
    border-color: rgba(45, 212, 191, 0.6);
    background: rgba(45, 212, 191, 0.16);
    box-shadow: 0 10px 20px -18px rgba(45, 212, 191, 0.6);
}

.option-letter {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(45, 212, 191, 0.3);
    background: rgba(45, 212, 191, 0.12);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.option-text {
    flex: 1;
    color: var(--text-main);
}

.option-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.7);
    transition: all 0.2s;
}

.option-item.selected .option-dot {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.18);
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    gap: 1rem;
}

.finish-row {
    margin-top: 2rem;
    text-align: right;
}

.site-footer {
    margin-top: 3rem;
    padding: 2.5rem 1.5rem 3rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.55);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 0.75rem;
    text-align: center;
}

.footer-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.footer-link:hover {
    color: var(--accent);
}

.footer-note {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Result Styles */
.score-card {
    text-align: center;
    margin-bottom: 3rem;
}

.score-huge {
    font-size: 5rem;
    font-weight: 800;
    color: var(--secondary);
}

.result-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.correct-ans {
    color: #4ade80;
}

.wrong-ans {
    color: #f87171;
}

/* Homepage Styles */
.hero-split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 3rem;
    align-items: center;
    padding: 2rem 0 3rem;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.gradient-text {
    background: linear-gradient(to right, #38bdf8, #2dd4bf);
    /* Sky to Emerald */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.badge-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-stats {
    display: flex;
    justify-content: flex-start;
    gap: 3rem;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    padding: 0 1rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-card {
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.card-header {
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.start-panel p {
    margin: 0 0 1rem;
    color: var(--text-muted);
}

.captcha-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.captcha-question {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
}

.captcha-input {
    padding: 0.8rem 1rem;
    border-radius: 0.8rem;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
}

.captcha-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.form-error {
    color: #f87171;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.card-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 1.5rem 0;
}

.quick-list {
    display: grid;
    gap: 0.6rem;
    color: var(--text-muted);
}

.quick-list i {
    color: var(--secondary);
    margin-right: 0.5rem;
}

.features-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.feature-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 1.5rem;
    transition: transform 0.3s;
}

.feature-accent {
    position: relative;
    overflow: hidden;
}

.feature-accent::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    right: -60px;
    top: -60px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.35), transparent 70%);
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
    background: rgba(14, 165, 233, 0.1);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
}

.feature-icon svg {
    width: 30px;
    height: 30px;
    color: inherit;
}

.btn-lg {
    padding: 18px 48px;
    font-size: 1.2rem;
    border-radius: 50px;
}

.flow-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    padding-bottom: 4rem;
}

.flow-card h2 {
    margin-bottom: 1.5rem;
}

.flow-steps {
    display: grid;
    gap: 1.5rem;
}

.flow-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.flow-step span {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(45, 212, 191, 0.2);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.flow-step h4 {
    margin: 0 0 0.3rem;
}

.flow-step p {
    margin: 0;
    color: var(--text-muted);
}

.subject-panel {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2rem;
}

.subject-panel h3 {
    margin-bottom: 1rem;
}

.subject-groups {
    display: grid;
    gap: 1.5rem;
}

.subject-group h4 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: var(--text-main);
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.subject-grid span {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--glass-border);
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--text-main);
}

.subject-grid strong {
    color: var(--secondary);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    /* Navbar */
    nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem !important;
    }

    /* Hero Section */
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-split {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-stats {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        box-sizing: border-box;
    }

    .stat-item {
        border-bottom: 1px solid var(--glass-border);
        padding-bottom: 0.5rem;
    }

    .stat-item:last-child {
        border-bottom: none;
    }

    /* Quiz Layout */
    .quiz-layout {
        grid-template-columns: 1fr;
        height: auto;
        display: flex;
        flex-direction: column-reverse;
        /* Question on top, palette on bottom (or vice versa? usually palette is secondary) */
    }

    /* Let's put palette ON TOP for easy navigation but collapsed or small */
    .sidebar {
        height: auto;
        max-height: 200px;
        overflow-y: auto;
        border-bottom: 1px solid var(--glass-border);
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .question-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    }

    .q-btn {
        font-size: 0.8rem;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .option-item {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .quiz-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .finish-row {
        text-align: center;
    }

    /* Fix Features Grid */
    .features-section {
        grid-template-columns: 1fr;
    }

    .flow-section {
        grid-template-columns: 1fr;
    }

    .subject-grid {
        grid-template-columns: 1fr;
    }

    .btn-primary,
    .btn-ghost,
    .btn-danger,
    .btn-lg {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .btn-block {
        width: 100%;
    }
}
/* Nav Links */
.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 0.8rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(45, 212, 191, 0.1);
    font-weight: 700;
}

