/* Category progress panel — end-of-quiz feedback shared by the per-quiz
   results page and every solo mode (random, spaced repetition, test).
   Rendered by quizzes/includes/category-progress.php on the shared
   .surface-panel, .section-head / .section-title, .fl-progress and
   .status-pill (includes/styles.css); this file is layout only. */
.cat-progress-card {
    margin-bottom: 2rem;
    text-align: left;
}

.cat-progress-head {
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.cat-progress-head .section-title i { color: var(--primary-soft); }

.cat-progress-summary {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.cat-progress-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    margin: 0.5rem 0 1rem;
    font-size: var(--fs-meta);
    color: var(--text-muted);
}

.cat-progress-meta i { margin-right: 0.25rem; }

/* Per-quiz rows: title | bar | count | pills. The whole row links to
   the quiz so "go study that one" is one click. */
.cat-quiz-rows {
    display: grid;
    grid-template-columns: minmax(8rem, 1.4fr) minmax(4.5rem, 1fr) auto auto;
    gap: 0 0.75rem;
    border-top: 1px solid var(--border-soft);
}

.cat-quiz-row {
    display: grid;
    grid-template-columns: minmax(120px, 1.4fr) minmax(70px, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.5rem;
    border-bottom: 1px solid var(--border-soft);
    text-decoration: none;
    border-radius: var(--r-sm);
    transition: background var(--dur-fast) ease;
}

/* In this panel every row shares the list's columns (subgrid), so the
   bars, counts and pills line up from row to row. Without subgrid each
   row keeps its own columns. */
.cat-quiz-rows > .cat-quiz-row {
    grid-column: 1 / -1;
}

@supports (grid-template-columns: subgrid) {
    .cat-quiz-rows > .cat-quiz-row {
        grid-template-columns: subgrid;
    }
}

.cat-quiz-row:hover { background: color-mix(in srgb, var(--primary-soft) 7%, transparent); }

.cat-quiz-row.is-current {
    background: var(--primary-tint);
}

.cat-quiz-title {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* In this panel the name truncates on its own and the "this quiz" tag
   stays whole: beside the name when both fit, on a line of its own
   under it when they don't, so a narrow column never squeezes the name
   down to a few letters. */
.cat-progress-card .cat-quiz-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 0.4rem;
}

.cat-quiz-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-quiz-title .status-pill { flex: none; }

.cat-quiz-count {
    font-size: var(--fs-meta);
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.cat-quiz-pills { display: flex; gap: 0.35rem; }

/* Feedback lines: what to do next, each with a direct link
   (.text-link). */
.cat-feedback {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cat-feedback-line {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: var(--fs-body-sm);
    color: var(--text-secondary);
    line-height: 1.45;
}

.cat-feedback-line i {
    color: var(--primary-text);
    font-size: 1.05rem;
    margin-top: 0.05rem;
    flex-shrink: 0;
}

.cat-feedback-line .text-link { font-weight: 600; }

@media (max-width: 600px) {
    .cat-quiz-rows,
    .cat-quiz-row { grid-template-columns: minmax(0, 1fr) auto; }
    .cat-quiz-progress { display: none; }
    .cat-quiz-pills { grid-column: 1 / -1; justify-content: flex-end; margin-top: -0.25rem; }
    /* No pills: drop the empty second line. */
    .cat-quiz-pills:not(:has(*)) { display: none; }
}
