﻿/* -- curriculum.css -- Verdict Alpha -- */
/* ── SRS Stats Page ───────────────────────────────────────────── */
.srs-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .srs-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.srs-stat-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
}

.srs-stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 5px;
}

.srs-stat-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.srs-patterns-section {
    margin-top: 4px;
}

.srs-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.srs-pattern-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.srs-pattern-row {
    display: grid;
    grid-template-columns: 120px 1fr 44px 36px;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

@media (max-width: 480px) {
    .srs-pattern-row {
        grid-template-columns: 90px 1fr 40px 32px;
        font-size: 0.8rem;
    }
}

.srs-pattern-name {
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: capitalize;
}

.srs-bar-wrap {
    background: var(--bg-light);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.srs-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--accent);
    transition: width 0.5s ease;
}

.srs-bar-fill.low {
    background: #e74c3c;
}
.srs-bar-fill.mid {
    background: #f39c12;
}
.srs-bar-fill.high {
    background: var(--accent);
}

.srs-pattern-pct {
    color: var(--text);
    text-align: right;
    font-weight: 600;
    font-size: 0.82rem;
}

.srs-pattern-due {
    color: var(--text-dim);
    text-align: right;
    font-size: 0.75rem;
}

.srs-pattern-due.has-due {
    color: #f39c12;
    font-weight: 600;
}

/* ── Curriculum Page ──────────────────────────────────────────── */
.curriculum-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.curriculum-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.curr-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-top: 12px;
    margin-bottom: 8px;
}

/* Current lesson card */
.curr-current-card {
    background: var(--bg-light);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 16px;
}

.curr-current-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.curr-current-tier {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.curr-progress-bar {
    background: var(--bg-dark);
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.curr-progress-fill {
    height: 100%;
    border-radius: 6px;
    background: var(--accent);
    transition: width 0.4s ease;
}

.curr-progress-label {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-bottom: 14px;
}

.curr-current-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Lesson list */
.curr-lesson-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 8px;
}

.curr-lesson-item {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition:
        border-color 0.15s,
        background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.curr-lesson-item:hover,
.curr-lesson-item:active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--bg-light));
}

.curr-lesson-item.is-active {
    border-color: var(--accent);
}

.curr-lesson-item.is-completed {
    opacity: 0.7;
}

.curr-lesson-item.is-locked {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.curr-lesson-icon {
    font-size: 1.1rem;
    text-align: center;
}

.curr-lesson-info {
    min-width: 0;
}

.curr-lesson-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.curr-lesson-meta {
    font-size: 0.73rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.curr-lesson-progress {
    font-size: 0.78rem;
    color: var(--text-dim);
    white-space: nowrap;
    text-align: right;
}

.curr-lesson-progress.done {
    color: var(--accent);
    font-weight: 600;
}

/* Drill detail panel */
.curr-drill-panel {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 4px;
    display: none;
}

.curr-drill-panel.open {
    display: block;
}

.curr-drill-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.curr-drill-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-dark);
    border-radius: 7px;
    font-size: 0.83rem;
    color: var(--text-dim);
}

.curr-drill-item.solved {
    color: var(--text);
}

.curr-drill-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
}

.curr-drill-item.solved .curr-drill-dot {
    background: var(--accent);
}

.curr-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* ── Drill Modal ─────────────────────────────────────────────── */

.drill-card {
    max-width: 520px;
    width: 100%;
}

.drill-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.drill-instruction {
    font-size: 0.95rem;
    color: var(--text-dim);
    text-align: center;
}

.drill-board-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}

.drill-board {
    width: 100%;
    max-width: min(calc(100vw - 80px), 400px);
    aspect-ratio: 1 / 1;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--bg);
}

.drill-board .square {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.drill-board .square.light {
    background: var(--square-light);
}
.drill-board .square.dark {
    background: var(--square-dark);
}

.drill-board .square.selected {
    box-shadow: inset 0 0 0 3px var(--square-selected);
}

.drill-board .square.move-dest::after {
    content: "";
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
}

.drill-board .square.last-move {
    box-shadow: inset 0 0 0 2px rgba(255, 215, 0, 0.6);
}

.drill-board .piece {
    width: 85%;
    height: 85%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.drill-board-error {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--error);
    text-align: center;
    font-weight: 600;
}

.drill-feedback {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.drill-feedback.correct {
    background: rgba(0, 217, 165, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(0, 217, 165, 0.3);
}

.drill-feedback.wrong {
    background: rgba(233, 69, 96, 0.15);
    color: var(--error);
    border: 1px solid rgba(233, 69, 96, 0.3);
}

.drill-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

@media (max-width: 480px) {
    .drill-card {
        margin: 8px;
        width: calc(100vw - 16px);
        max-width: none;
    }
    .drill-board {
        max-width: min(calc(100vw - 48px), 340px);
    }
}
