/* ====================================================
   NEB Archive — Global Styles & Quiz Page Additions
   ==================================================== */

/* ---------- Design System / Variables ---------- */
/* ====================================================
   DESIGN SYSTEM & THEME VARIABLES
   ==================================================== */
:root {
    /* Light Mode (Default) */
    --bg: #FAFAFA;
    --bg-alt: #FFFFFF;
    --text: #1A1A1A;
    --text-muted: #6B7280;
    --accent: #4F46E5;          /* Deep indigo */
    --accent-hover: #4338CA;
    --accent-light: #EEF2FF;
    --border: #E5E7EB;
    --success: #10B981;
    --success-light: #ECFDF5;
    --error: #EF4444;
    --error-light: #FEF2F2;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
    --navbar-bg: rgba(250, 250, 250, 0.85);

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing & layout */
    --container: 1140px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Theme */
[data-theme="dark"] {
    --bg: #0F172A;            /* Slate 900 */
    --bg-alt: #1E293B;        /* Slate 800 */
    --text: #F1F5F9;          /* Slate 100 */
    --text-muted: #94A3B8;    /* Slate 400 */
    --accent: #818CF8;        /* Indigo 400 (Brighter for dark mode) */
    --accent-hover: #6366F1;  /* Indigo 500 */
    --accent-light: #312E81;  /* Indigo 900 */
    --border: #334155;        /* Slate 700 */
    --success: #34D399;
    --success-light: #064E3B;
    --error: #F87171;
    --error-light: #7F1D1D;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.2);
    --card-shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.5), 0 4px 10px rgba(0, 0, 0, 0.3);
    --navbar-bg: rgba(15, 23, 42, 0.85);
}

/* ====================================================
   DARK MODE TOGGLE BUTTON STYLES
   ==================================================== */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition);
    margin-left: 16px; /* Spacing from nav links */
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-light);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* Show sun in light mode, hide moon */
.icon-sun { display: block; }
.icon-moon { display: none; }

/* Show moon in dark mode, hide sun */
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ====================================================
   DARK MODE SPECIFIC TWEAKS
   ==================================================== */

/* Fix tag colors for dark mode (PYQs page) */
[data-theme="dark"] .tag.science { background: #064E3B; color: #34D399; }
[data-theme="dark"] .tag.management { background: #78350F; color: #FBBF24; }
[data-theme="dark"] .tag.humanities { background: #831843; color: #F472B6; }

/* Fix quiz feedback text colors for dark mode */
[data-theme="dark"] .quiz-option.correct { color: #6EE7B7; }
[data-theme="dark"] .quiz-option.incorrect { color: #FCA5A5; }

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ---------- Layout Helpers ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 12px 24px; font-family: inherit;
    font-size: 15px; font-weight: 600; border-radius: var(--radius-sm);
    border: 2px solid transparent; cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 16px; }

/* ====================================================
   NAVBAR (Shared)
   ==================================================== */
.navbar {
    position: sticky; top: 0; z-index: 1000;
    background: var(--navbar-bg);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-container { max-width: var(--container); margin: 0 auto; padding: 0 24px; height: 68px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 20px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; letter-spacing: -0.5px; }
.logo-mark { color: var(--accent); font-size: 18px; }
.logo-accent { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-link { font-size: 15px; font-weight: 500; color: var(--text-muted); transition: color var(--transition); position: relative; }
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link.active::after { content: ''; position: absolute; bottom: -6px; left: 0; right: 0; height: 2px; background: var(--accent); border-radius: 2px; }

.hamburger { display: none; flex-direction: column; justify-content: space-between; width: 26px; height: 20px; background: transparent; border: none; cursor: pointer; padding: 0; }
.hamburger span { display: block; height: 2.5px; width: 100%; background: var(--text); border-radius: 2px; transition: all var(--transition); }
.hamburger.active span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* ====================================================
   PAGE HEADER (Shared)
   ==================================================== */
.page-header {
    padding: 64px 0 32px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg) 0%, var(--accent-light) 100%);
}

.badge {
    display: inline-block; background: var(--bg-alt); color: var(--accent);
    font-size: 13px; font-weight: 600; padding: 6px 14px;
    border-radius: 50px; border: 1px solid var(--border); margin-bottom: 20px;
}

.page-title {
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 800; line-height: 1.1; letter-spacing: -1.5px;
    margin-bottom: 16px;
}

.page-subtitle {
    font-size: 1.1rem; color: var(--text-muted);
    max-width: 560px; margin: 0 auto;
}

/* ====================================================
   QUIZ SECTION (Quiz Page Specific)
   ==================================================== */
.quiz-section {
    padding: 48px 0 96px;
}

.quiz-box {
    max-width: 720px;
    margin: 0 auto;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

/* Progress Bar */
.quiz-progress-container {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 50px;
    margin-bottom: 32px;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 50px;
    width: 0%;
    transition: width 0.4s ease;
}

/* Quiz Header Info */
.quiz-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.quiz-question-num {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    padding: 6px 12px;
    border-radius: 50px;
}

.quiz-score {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.quiz-score span {
    color: var(--text);
    font-weight: 700;
}

/* Question Text */
.quiz-question {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 28px;
    color: var(--text);
}

/* Options */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 16px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
}

.quiz-option:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateX(4px);
}

/* Disable hover effect after answered */
.quiz-options.answered .quiz-option {
    cursor: not-allowed;
}

.quiz-options.answered .quiz-option:hover {
    transform: none;
    border-color: var(--border);
    background: var(--bg);
}

/* Feedback States */
.quiz-option.correct {
    background: var(--success-light);
    border-color: var(--success);
    color: #065F46;
    font-weight: 600;
}

.quiz-option.incorrect {
    background: var(--error-light);
    border-color: var(--error);
    color: #991B1B;
    font-weight: 600;
}

/* Next/Retry Button Container */
.quiz-actions {
    margin-top: 32px;
    text-align: right;
    display: none; /* Hidden until an answer is selected */
}

.quiz-actions.show {
    display: block;
}

/* Result Screen */
.quiz-result {
    text-align: center;
    padding: 24px 0;
}

.result-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.quiz-result h3 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text);
}

.quiz-result .score-text {
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 24px;
}

.quiz-result p {
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* ====================================================
   FOOTER (Shared)
   ==================================================== */
.footer { background: var(--bg); border-top: 1px solid var(--border); padding: 48px 0 24px; }
.footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 24px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.footer-tagline { color: var(--text-muted); font-size: 14px; margin-top: 8px; }
.footer-links { display: flex; gap: 28px; }
.footer-links a { color: var(--text-muted); font-size: 14px; font-weight: 500; transition: color var(--transition); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { text-align: center; padding-top: 24px; color: var(--text-muted); font-size: 13.5px; }

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-width: 640px) {
    /* Mobile Nav */
    .nav-links {
        position: fixed; top: 68px; left: 0; right: 0; flex-direction: column;
        background: var(--bg-alt); padding: 24px; gap: 8px;
        border-bottom: 1px solid var(--border); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
        transform: translateY(-120%); opacity: 0; visibility: hidden;
        transition: all 0.35s ease; align-items: stretch;
    }
    .nav-links.open { transform: translateY(0); opacity: 1; visibility: visible; }
    .nav-link { padding: 12px 8px; font-size: 16px; border-radius: var(--radius-sm); }
    .nav-link.active::after { display: none; }
    .nav-link.active { background: var(--accent-light); color: var(--accent); }
    .nav-cta { margin-top: 8px; text-align: center; }
    .hamburger { display: flex; }

    .quiz-box { padding: 24px 20px; }
    .quiz-question { font-size: 1.2rem; }
    .footer-content { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; flex-wrap: wrap; }
}