/* =============================================
   SUMMIT THE SCORE — MCAT MATH PRACTICE
   Shared Styles
   ============================================= */

/* Reset & Variables */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --teal-primary: #2C5F7C;
    --teal-light: #3D5A80;
    --terracotta: #C1704F;
    --sage: #8B9E7D;
    --cream: #F7F3ED;
    --warm-white: #FAF8F5;
    --charcoal: #2B2D42;
    --light-blue: #E8F1F5;
    --heading-font: 'Manrope', sans-serif;
    --body-font: 'Inter', sans-serif;
    --accent-font: 'Crimson Pro', serif;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 16px;
    --radius-pill: 100px;
    --shadow-sm: 0 2px 8px rgba(44, 95, 124, 0.06);
    --shadow-md: 0 4px 20px rgba(44, 95, 124, 0.08);
    --shadow-lg: 0 8px 32px rgba(44, 95, 124, 0.1);
}

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

/* =============================================
   PAGE HEADER
   ============================================= */
.page-header {
    background: linear-gradient(135deg, var(--teal-primary) 0%, var(--teal-light) 100%);
    color: white;
    padding: 48px 40px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200%;
    height: 60px;
    background: var(--cream);
    border-radius: 50% 50% 0 0;
}
.page-header h1 {
    font-family: var(--heading-font);
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}
.page-header p {
    font-family: var(--accent-font);
    font-size: 1.15rem;
    opacity: 0.9;
    font-style: italic;
    position: relative;
    z-index: 1;
}

/* Breadcrumb */
.breadcrumb {
    position: relative;
    z-index: 1;
    margin-bottom: 12px;
}
.breadcrumb a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
}
.breadcrumb a:hover { color: white; }
.breadcrumb span { color: rgba(255, 255, 255, 0.5); margin: 0 6px; font-size: 0.8rem; }

/* =============================================
   CONTAINER
   ============================================= */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}

/* =============================================
   REFERENCE CARD
   ============================================= */
.ref-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--teal-primary);
}
.ref-card h2 {
    font-family: var(--heading-font);
    font-size: 1.05rem;
    color: var(--teal-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.ref-card h2 .toggle-arrow {
    transition: transform 0.25s;
    font-size: 0.7rem;
}
.ref-card h2 .toggle-arrow.open { transform: rotate(90deg); }

.ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}
.ref-grid.collapsed { max-height: 0; opacity: 0; margin-top: 0; }
.ref-grid.expanded { max-height: 800px; opacity: 1; }

.ref-item {
    background: var(--cream);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.88rem;
}
.ref-item .rule-name {
    font-weight: 700;
    color: var(--teal-primary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}
.ref-item .rule-formula {
    font-family: var(--accent-font);
    font-size: 1rem;
    line-height: 1.4;
}

/* =============================================
   MODE SELECTOR
   ============================================= */
.mode-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.mode-btn {
    font-family: var(--body-font);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: var(--radius-pill);
    border: 2px solid var(--teal-primary);
    background: transparent;
    color: var(--teal-primary);
    cursor: pointer;
    transition: all 0.2s;
}
.mode-btn:hover { background: rgba(44, 95, 124, 0.06); }
.mode-btn.active {
    background: var(--teal-primary);
    color: white;
}

/* =============================================
   PROGRESS BAR
   ============================================= */
.progress-text {
    font-size: 0.8rem;
    color: var(--teal-light);
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}
.progress-bar-container {
    background: rgba(44, 95, 124, 0.1);
    border-radius: var(--radius-pill);
    height: 7px;
    margin-bottom: 24px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sage), var(--teal-primary));
    border-radius: var(--radius-pill);
    transition: width 0.4s ease;
}

/* =============================================
   QUESTION CARD
   ============================================= */
.question-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.q-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--terracotta);
    margin-bottom: 10px;
}
.q-context {
    font-size: 0.9rem;
    color: var(--teal-light);
    margin-bottom: 12px;
    padding: 12px 16px;
    background: var(--light-blue);
    border-radius: var(--radius-sm);
    line-height: 1.6;
}
.q-text {
    font-family: var(--accent-font);
    font-size: 1.35rem;
    line-height: 1.5;
    margin-bottom: 24px;
    color: var(--charcoal);
}

/* =============================================
   ANSWER CHOICES
   ============================================= */
.choices {
    display: grid;
    gap: 10px;
}
.choice-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 13px 18px;
    border: 2px solid rgba(44, 95, 124, 0.12);
    border-radius: var(--radius-md);
    background: var(--warm-white);
    font-family: var(--body-font);
    font-size: 0.95rem;
    color: var(--charcoal);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    line-height: 1.4;
}
.choice-btn:hover:not(.disabled) {
    border-color: var(--teal-primary);
    background: rgba(44, 95, 124, 0.04);
}
.choice-letter {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(44, 95, 124, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--teal-primary);
    flex-shrink: 0;
}
.choice-btn.correct {
    border-color: var(--sage);
    background: rgba(139, 158, 125, 0.12);
}
.choice-btn.correct .choice-letter {
    background: var(--sage);
    color: white;
}
.choice-btn.wrong {
    border-color: var(--terracotta);
    background: rgba(193, 112, 79, 0.08);
}
.choice-btn.wrong .choice-letter {
    background: var(--terracotta);
    color: white;
}
.choice-btn.disabled { cursor: default; opacity: 0.65; }
.choice-btn.correct.disabled,
.choice-btn.wrong.disabled { opacity: 1; }

/* =============================================
   EXPLANATION
   ============================================= */
.explanation {
    margin-top: 20px;
    padding: 18px 22px;
    background: var(--light-blue);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--teal-primary);
    font-size: 0.92rem;
    line-height: 1.7;
    animation: fadeIn 0.3s ease;
}
.explanation strong { color: var(--teal-primary); }
.explanation .tip {
    display: block;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(44, 95, 124, 0.12);
    font-size: 0.85rem;
    color: var(--teal-light);
}

/* =============================================
   ACTION BUTTONS
   ============================================= */
.next-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 11px 26px;
    background: var(--teal-primary);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    font-family: var(--body-font);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.next-btn:hover { background: var(--teal-light); transform: translateY(-1px); }

/* =============================================
   RESULTS CARD
   ============================================= */
.results-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.4s ease;
}
.results-card h2 {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    color: var(--teal-primary);
    margin-bottom: 6px;
}
.score-display {
    font-family: var(--heading-font);
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--teal-primary);
    margin: 14px 0;
}
.score-display span {
    color: var(--charcoal);
    font-weight: 600;
    font-size: 1.6rem;
}
.score-subtitle {
    color: var(--teal-light);
    margin-bottom: 24px;
    font-size: 0.95rem;
}
.results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.restart-btn {
    padding: 12px 32px;
    background: var(--terracotta);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    font-family: var(--body-font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(193, 112, 79, 0.3);
}
.back-btn {
    padding: 12px 32px;
    background: transparent;
    color: var(--teal-primary);
    border: 2px solid var(--teal-primary);
    border-radius: var(--radius-pill);
    font-family: var(--body-font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.back-btn:hover { background: rgba(44, 95, 124, 0.06); }

/* =============================================
   QUIZ CONFIG BAR
   ============================================= */
.config-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.quiz-length-select {
    font-family: var(--body-font);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--teal-light);
    background: white;
    border: 2px solid rgba(44, 95, 124, 0.15);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    cursor: pointer;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    text-align: center;
    padding: 24px;
    font-size: 0.8rem;
    color: var(--teal-light);
    opacity: 0.5;
}
.footer a {
    color: var(--teal-primary);
    text-decoration: none;
}
.footer a:hover { text-decoration: underline; }

/* =============================================
   GRAPH (SVG)
   ============================================= */
.q-graph {
    margin: 0.5rem auto 0.75rem;
    max-width: 480px;
}
.graph-svg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 1px solid #e0dcd6;
}
.graph-svg .g-tick {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    fill: #6b6560;
}
.graph-svg .g-label {
    font-family: 'Inter', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    fill: #5a5550;
}
.graph-svg .g-line-label {
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 700;
}
.graph-svg .g-pt-label {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 600px) {
    .page-header { padding: 36px 20px 32px; }
    .page-header h1 { font-size: 1.6rem; }
    .page-header p { font-size: 1rem; }
    .container { padding: 20px 16px 40px; }
    .question-card { padding: 24px 18px; }
    .q-text { font-size: 1.15rem; }
    .mode-btn { padding: 7px 13px; font-size: 0.8rem; }
    .ref-grid { grid-template-columns: 1fr; }
    .results-card { padding: 28px 20px; }
    .score-display { font-size: 2.6rem; }
}
