/* CSS VARIABLES & RESET */
:root {
    --magenta: #9A4A7A;
    --magenta-light: #B06A94;
    --sage: #A9B89C;
    --sage-dark: #4A5D42;
    --offwhite: #FAFAF8;
    --nearblack: #1E1E1E;
    --gray: #6B7280;
    --white: #fff;
    --font: Inter, system-ui, sans-serif;
    --radius: .75rem;
    --shadow: 0 2px 8px rgba(0,0,0,.06);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font);
    color: var(--nearblack);
    background: var(--offwhite);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: .2s ease;
}

img {
    max-width: 100%;
    display: block;
}

h1, h2, h3 {
    line-height: 1.25;
    margin-bottom: .5em;
}

p {
    margin-bottom: 1rem;
}

/* LAYOUT UTILITIES */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 3rem 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* BREADCRUMB*/
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem;
    font-size: .75rem;
    color: var(--sage);
    margin-bottom: 1.25rem;
}

.breadcrumb__link {
    color: var(--sage);
}

.breadcrumb__link:hover {
    text-decoration: underline;
}

.breadcrumb__separator {
    width: .75rem;
    height: .75rem;
    color: var(--sage);
}

.breadcrumb__current {
    color: var(--nearblack);
    font-weight: 500;
}

/* EXAM HEADER (Category Page) */
.exam-header {
    padding: 2rem 0;
    border-bottom: 1px solid #e6e6e2;
    background: var(--white);
}

.exam-header__brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}

.exam-header__logo {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: .5rem;
    background: var(--magenta);
    display: flex;
    align-items: center;
    justify-content: center;
}

.exam-header__logo span {
    color: var(--white);
    font-size: .75rem;
    font-weight: 700;
    font-family: var(--font);
}

.exam-header__name {
    font-size: .875rem;
    font-weight: 700;
    font-family: var(--font);
    color: var(--nearblack);
}

.exam-header__badge {
    font-size: .625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .125rem .5rem;
    border-radius: .25rem;
    background: rgba(169,184,156,.15);
    color: var(--sage);
    font-family: var(--font);
}

.exam-header__title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.02em;
    font-family: var(--font);
    color: var(--nearblack);
}

.exam-header__desc {
    font-size: .875rem;
    color: #6b6b6b;
    max-width: 48rem;
    margin-top: .5rem;
}

/* SUBJECTS GRID (Category Page) */
.subjects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.subject-card {
    background: var(--white);
    border: 1px solid #e6e6e2;
    border-radius: 1rem;
    padding: 1.25rem;
}

.subject-card__header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
}

.subject-card__icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: .75rem;
    background: rgba(154,74,122,.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.subject-card__icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--magenta);
}

.subject-card__title {
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font);
    color: var(--nearblack);
}

/* TEST LINKS (Category Page) */
.test-list {
    display: grid;
    gap: .5rem;
}

.test-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    border-radius: .75rem;
    border: 1px solid #e6e6e2;
    background: var(--white);
    transition: .15s ease;
}

.test-link:hover {
    transform: translateX(-2px);
    border-color: var(--magenta);
}

.test-link--active {
    background: rgba(154,74,122,.03);
    border-color: var(--magenta);
}

.test-link__left {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.test-link__num {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: .375rem;
    background: var(--offwhite);
    color: var(--sage);
    font-size: .75rem;
    font-weight: 700;
    font-family: var(--font);
    display: flex;
    align-items: center;
    justify-content: center;
}

.test-link__info {
    display: flex;
    flex-direction: column;
}

.test-link__title {
    font-size: .875rem;
    font-weight: 500;
    font-family: var(--font);
    color: var(--nearblack);
}

.test-link__meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .25rem;
}

.test-link__badge {
    font-size: .625rem;
    font-weight: 600;
    padding: .125rem .5rem;
    border-radius: .25rem;
    background: rgba(154,74,122,.1);
    color: var(--magenta);
    font-family: var(--font);
}

.test-link__count {
    font-size: .625rem;
    color: var(--sage);
    font-family: var(--font);
}

.test-link__arrow {
    width: 1rem;
    height: 1rem;
    color: var(--sage);
    transition: color .15s;
}

.test-link:hover .test-link__arrow {
    color: var(--magenta);
}

/* QUESTION PAGE STYLES (NEW) */
.question-page {
    padding: 1.5rem 0;
}

.question-page__header {
    margin-bottom: 2rem;
}

.question-page__title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--nearblack);
    margin-bottom: 0.5rem;
    font-family: var(--font);
}

.question-page__meta {
    font-size: 0.875rem;
    color: var(--gray);
}

/* Main Grid Layout */
.question-page__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* Question Card */
.question-card {
    background: var(--white);
    border: 1px solid #e6e6e2;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.question-card__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.question-card__badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--magenta);
    background: rgba(154, 74, 122, 0.1);
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-family: var(--font);
}

.question-card__counter {
    font-size: 0.75rem;
    color: var(--gray);
}

.question-card__text {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--nearblack);
    font-family: var(--font);
}

/* Choices List */
.choices-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.choice-button {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid #e6e6e2;
    background: var(--white);
    cursor: pointer;
    transition: all 0.15s ease;
}

.choice-button:hover {
    border-color: var(--magenta);
    transform: scale(1.01);
}

.choice-button[aria-pressed="true"] {
    border-color: var(--magenta);
    background: rgba(154, 74, 122, 0.05);
}

.choice__letter {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    border: 2px solid #e6e6e2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray);
    font-family: var(--font);
}

.choice-button[aria-pressed="true"] .choice__letter {
    border-color: var(--magenta);
    color: var(--magenta);
}

.choice__text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--nearblack);
}

/* Navigation Buttons */
.question-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e6e6e2;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
}

.nav-button:hover:not(:disabled) {
    color: var(--nearblack);
    background: rgba(0, 0, 0, 0.03);
}

.nav-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-button svg {
    width: 1rem;
    height: 1rem;
}

/* Question Indicators */
.question-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.5rem 0 0.75rem;
}

.question-indicator {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font);
    border: 1px solid #e6e6e2;
    background: var(--offwhite);
    color: var(--gray);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.question-indicator:hover {
    border-color: var(--magenta);
    color: var(--magenta);
}

.question-indicator--active {
    background: var(--magenta);
    color: var(--white);
    border-color: var(--magenta);
}

.question-indicator--answered {
    background: var(--sage);
    color: var(--white);
    border-color: var(--sage);
}

.question-progress {
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray);
}

/* Rationale Card */
.rationale-card {
    display: none;
    background: rgba(169, 184, 156, 0.1);
    border: 1px solid var(--sage);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.rationale-card.is-visible {
    display: block;
}

.rationale-card__heading {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--sage-dark);
    margin-bottom: 0.75rem;
    font-family: var(--font);
}

.rationale-card__content {
    font-size: 0.9rem;
    color: var(--gray);
    line-height: 1.6;
}

/* Sidebar */
.sidebar {
    display: none;
}

.sidebar__section {
    background: var(--white);
    border: 1px solid #e6e6e2;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.sidebar__title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray);
    margin-bottom: 0.75rem;
    font-family: var(--font);
}

.sidebar__list {
    display: grid;
    gap: 0.25rem;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray);
    transition: all 0.15s ease;
    text-decoration: none;
}

.sidebar__link:hover {
    background: var(--offwhite);
    color: var(--nearblack);
}

.sidebar__link--active {
    background: rgba(154, 74, 122, 0.1);
    color: var(--magenta);
    font-weight: 600;
}

.sidebar__link svg {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
}

.sidebar__link--with-chevron {
    justify-content: space-between;
}

/* Timer */
.exam-timer {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--nearblack);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-family: monospace;
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 90;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* RESPONSIVE BREAKPOINTS */

/* Tablet: 768px */
@media (min-width: 768px) {
    .exam-header__title {
        font-size: 1.875rem;
    }
    
    .subjects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .question-card {
        padding: 2rem;
    }
    
    .question-card__text {
        font-size: 1.25rem;
    }
}

/* Desktop: 1024px */
@media (min-width: 1024px) {
    .header__inner {
        padding: 0 2rem;
    }
    
    .nav__desktop {
        display: flex;
    }
    
    .nav__mobile-toggle {
        display: none;
    }
    
    .question-page__grid {
        grid-template-columns: 2fr 1fr;
    }
    
    .sidebar {
        display: block;
        position: sticky;
        top: 1.5rem;
    }
    
    .exam-timer {
        top: 1.5rem;
        right: 2rem;
    }
}

/* Mobile adjustments for question nav */
@media (max-width: 1023px) {
    .question-nav {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .nav-button {
        justify-content: center;
    }
}
/* QUESTION PAGE: NEW LAYOUT */

/* Card base styles */
.bg-card {
    background: var(--white);
}

.border-border {
    border-color: #e6e6e2;
}

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

/* Typography utilities */
.text-foreground {
    color: var(--nearblack);
}

.text-muted-foreground {
    color: var(--gray);
}

.text-primary {
    color: var(--magenta);
}

.bg-primary\/10 {
    background: rgba(154, 74, 122, 0.1);
}

.font-inter {
    font-family: var(--font);
}

/* Choice button states */
.choice-button {
    background: var(--white);
    border-color: #e6e6e2;
}

.choice-button:hover:not(:disabled) {
    border-color: var(--magenta);
    transform: scale(1.01);
}

.choice-button--correct {
    border-color: #4ade80 !important;
    background: #f0fdf4 !important;
}

.choice-button--correct .choice__letter {
    border-color: #22c55e !important;
    background: #22c55e !important;
    color: white !important;
}

.choice-button--incorrect {
    border-color: #f87171 !important;
    background: #fef2f2 !important;
}

.choice-button--incorrect .choice__letter {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

.choice-button:disabled {
    opacity: 1;
    cursor: default;
}

.choice-button:disabled:hover {
    transform: none;
    border-color: inherit;
}

/* Rationale card */
.rationale-card {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sidebar sticky positioning */
.sticky {
    position: sticky;
}

.top-24 {
    top: 6rem;
}

/* Grid utilities */
.grid {
    display: grid;
}

.gap-8 {
    gap: 2rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-2 {
    gap: 0.5rem;
}

.lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lg\:grid-cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.lg\:col-span-2 {
    grid-column: span 2 / span 2;
}

.lg\:col-span-3 {
    grid-column: span 3 / span 3;
}

/* Responsive: hide sidebar on mobile */
@media (max-width: 1023px) {
    .lg\:col-span-2,
    .lg\:col-span-3 {
        grid-column: 1 / -1;
    }
    
    .hidden.lg\:block {
        display: none !important;
    }
}

/* Utility classes for spacing */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.md\:p-8 { padding: 2rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.ml-2 { margin-left: 0.5rem; }

/* Text sizing */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-\[11px\] { font-size: 11px; }
.text-lg { font-size: 1.125rem; }
.md\:text-xl { font-size: 1.25rem; }

/* Font weights */
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* Flex utilities */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-3 { gap: 0.75rem; }
.flex-shrink-0 { flex-shrink: 0; }

/* Sizing utilities */
.w-7 { width: 1.75rem; }
.h-7 { height: 1.75rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-3\.5 { width: 0.875rem; }
.h-3\.5 { height: 0.875rem; }
.w-3 { width: 0.75rem; }
.h-3 { height: 0.75rem; }
.max-w-full { max-width: 100%; }
.h-auto { height: auto; }

/* Border radius */
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* Border utilities */
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-l-4 { border-left-width: 4px; }

/* Background utilities */
.bg-accent { background: var(--offwhite); }
.bg-offwhite { background: var(--offwhite); }

/* Transition utilities */
.transition-all { transition-property: all; }
.duration-150 { transition-duration: 150ms; }
.hover\:scale-\[1\.01\]:hover { transform: scale(1.01); }

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }

/* Letter spacing */
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }

/* Uppercase */
.uppercase { text-transform: uppercase; }

/* Line height */
.leading-relaxed { line-height: 1.625; }

/* Cursor */
.cursor-not-allowed { cursor: not-allowed; }

/* Opacity */
.disabled\:opacity-30:disabled { opacity: 0.3; }

/* Hover states */
.hover\:text-foreground:hover { color: var(--nearblack); }
.hover\:bg-accent:hover { background: var(--offwhite); }

/* Focus states for accessibility */
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--magenta); }

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


.w-full { 
    width: 100%; 
}
.transition-colors { 
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; 
}
.hover\:border-primary\/30:hover { 
    border-color: rgba(154, 74, 122, 0.3); 
}
.bg-primary { 
    background-color: var(--magenta); 
}
.text-primary-foreground { 
    color: var(--white); 
}
.flex-wrap {
    flex-wrap: wrap;
}

.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

@media (max-width: 1023px) {
    .lg\:grid-cols-5 { grid-template-columns: 1fr; }
    .lg\:grid-cols-3 { grid-template-columns: 1fr; }
}
