/* Infini Quiz. Built on the tokens and components in core/site.css. */

.quiz { max-width: 800px; }
.quiz [hidden] { display: none !important; }

/* ---------- picker ---------- */

.quiz-select { max-width: 20rem; font-weight: 600; }

#sections { list-style: none; padding: 0; margin: 12px 0 0; }

.section-item { margin-bottom: 10px; }

.section-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 3rem;
    padding: 0 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, transform .15s ease;
}

.section-button:hover { border-color: var(--accent); }
.section-button:active, .ss-button:active { transform: scale(0.99); }

.section-div p { margin: .75rem 0 0 1rem; }

.ss-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 3rem;
    width: min(100%, 520px);
    padding: 0 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}

.ss-button:hover { border-color: var(--accent); }
.ss-button:hover .icon { color: var(--accent); }

/* ---------- lesson ---------- */

.quiz-lesson { max-width: 520px; }

.quiz-lesson h5 { margin: 24px 0 16px; font-size: 1.1rem; }

.rdoInput-label {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    padding: .65rem .9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.rdoInput-label:hover { border-color: var(--accent); }

.rdoInput-label-selected,
.rdoInput-label-selected:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

#btnGroup { margin-top: 16px; }

.result-text { font-size: 1.5rem; font-weight: 700; margin: 16px 0 0; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.quiz-lesson .mt-3 { margin-top: 16px; }
.error-msg { color: var(--danger); }

/* ---------- loading bar ---------- */

.loader-container { display: flex; justify-content: center; margin-top: 24px; }

.progress-bar {
    width: 100%;
    height: 30px;
    padding: 2px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.progress {
    width: 0;
    height: 100%;
    border-radius: var(--radius-sm);
    background: var(--accent);
    animation: quiz-fill 4s infinite;
}

@keyframes quiz-fill {
    0% { width: 0; }
    100% { width: 100%; }
}

/* ---------- stats, thumbs, flag, review ---------- */

.quiz-stats-panel { margin: 0 0 24px; }

.quiz-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
}

.quiz-stat {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.quiz-stat-value { font-size: 1.4rem; font-weight: 700; }
.quiz-stat-label { color: var(--text-dim); font-size: .8rem; }

.quiz-stats-note { margin: 10px 0 0; font-size: .85rem; }

.quiz-link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.quiz-lesson-stats { min-height: 1.5em; margin: 4px 0 0; }

.quiz-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.quiz-action {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.quiz-action:hover { border-color: var(--accent); }

.quiz-action[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--on-accent);
}

.quiz-review { margin-top: 40px; }

.review-item { margin-bottom: 12px; padding: 14px 18px; }
.review-question { font-weight: 600; cursor: pointer; }
.review-meta { margin: 8px 0 0; font-size: .85rem; }
.review-options { margin: 12px 0; padding: 0; list-style: none; }
.review-options li { margin-bottom: 4px; }
.review-correct { color: var(--success); font-weight: 600; }
.review-explanation { margin: 0 0 12px; color: var(--text-dim); font-size: .95rem; }
