/* ==========================================================================
   CodeClass - student views
   ========================================================================== */

.brand-inline {
    display: flex;
    align-items: center;
    gap: var(--s2);
    text-decoration: none;
    color: inherit;
}

.brand-inline .brand-name {
    font-family: var(--font-brand);
    font-size: 1.15rem;
    line-height: 1;
}

.btn-attn {
    --btn-bg: var(--attn-soft);
    --btn-fg: var(--attn);
    --btn-line: color-mix(in srgb, var(--attn) 40%, transparent);
}

/* An answer is waiting. Different colour from the raised hand, because it is
   a different thing to do: read this, rather than keep waiting. */
.btn-ok {
    --btn-bg: var(--ok-soft);
    --btn-fg: var(--ok);
    --btn-line: color-mix(in srgb, var(--ok) 40%, transparent);
}

.section-heading {
    display: flex;
    align-items: center;
    gap: var(--s2);
    font-size: var(--text-md);
    font-weight: 650;
    letter-spacing: -0.01em;
}

/* The work card lives in components.css: the teacher's grading board and the
   preview of a student's dashboard use the same one, and a card that looked
   different in the preview would be worthless for checking what they see. */

/* ---- course list ------------------------------------------------------- */
.course-row {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) var(--s4);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    text-decoration: none;
    color: inherit;
    transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}

a.course-row:hover {
    border-color: var(--line-strong);
    background: var(--surface-2);
}

.course-row.is-locked {
    opacity: 0.55;
    cursor: not-allowed;
}

.course-index {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--ink-3);
    font-size: var(--text-xs);
    font-weight: 700;
}

.course-index.is-done {
    background: var(--ok-soft);
    color: var(--ok);
}

/* ---- workspace shell --------------------------------------------------- */
.work-view {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-h));
    min-height: 0;
}

.work-bar {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s2) var(--s4);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    flex: 0 0 auto;
    min-height: 52px;
}

.work-title {
    min-width: 0;
    display: flex;
    flex-direction: column;
    font-weight: 650;
}

.work-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
}

.course-nav {
    display: flex;
    gap: var(--s1);
    align-items: center;
    padding-left: var(--s3);
    border-left: 1px solid var(--line);
}

.course-step {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--ink-3);
    font-size: var(--text-2xs);
    font-weight: 700;
    text-decoration: none;
}

.course-step:hover {
    background: var(--line);
    color: var(--ink);
}

.course-step.is-done {
    background: var(--ok-soft);
    color: var(--ok);
}

.course-step.is-current {
    background: var(--brand);
    color: var(--on-brand);
}

.course-step.is-locked {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---- feedback ---------------------------------------------------------- */
.grade-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 92px;
    height: 92px;
    flex: 0 0 auto;
    border-radius: var(--r-lg);
    background: var(--surface-3);
}

.grade-letter {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
}

.grade-score {
    font-size: var(--text-xs);
    color: var(--ink-3);
}

.grade-ok { background: var(--ok-soft); color: var(--ok); }
.grade-info { background: var(--info-soft); color: var(--info); }
.grade-warn { background: var(--warn-soft); color: var(--warn); }
.grade-bad { background: var(--bad-soft); color: var(--bad); }

@media (max-width: 768px) {
    .work-bar { flex-wrap: wrap; }
    .course-nav { order: 10; width: 100%; border-left: 0; padding-left: 0; }
}

/* Where the back arrow was, while the clock is running. Something is there,
   and it is not a way out: an empty space would read as a missing button. */
.assessment-lock {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: var(--r);
    color: var(--bad);
    background: var(--bad-soft);
}

/* ---- the receipt for a handed-in assessment ---------------------------- */
.receipt-head {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3);
    border-radius: var(--r);
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.receipt-head[data-tone='ok'] {
    background: var(--ok-soft);
    border-color: color-mix(in srgb, var(--ok) 30%, transparent);
    color: var(--ok);
}

.receipt-head[data-tone='ok'] strong,
.receipt-head strong {
    color: var(--ink);
}

/* One line per part of the course, so "did it all go in" is read rather than
   remembered. The state is said in words as well as drawn, because a tick and
   a cross are the same shape to somebody who cannot tell the colours apart. */
.receipt-row {
    display: flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s1) var(--s2);
    border-radius: var(--r-sm);
    font-size: var(--text-sm);
    background: var(--surface-2);
}

.receipt-row[data-in='true'] { color: var(--ok); }
.receipt-row[data-in='false'] { color: var(--warn); background: var(--warn-soft); }
.receipt-row .grow { color: var(--ink); }

/* ---- assessments ------------------------------------------------------- */
.assessment-gate {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    min-height: calc(100vh - var(--header-h));
    padding: var(--s6);
    background: radial-gradient(900px 500px at 50% -10%, color-mix(in srgb, var(--bad) 10%, transparent), transparent 60%);
}

.assessment-card {
    width: min(560px, 100%);
    display: flex;
    flex-direction: column;
    gap: var(--s4);
    padding: var(--s8);
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-left: 4px solid var(--bad);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-3);
}

.assessment-rules {
    display: flex;
    flex-direction: column;
    gap: var(--s2);
}

.assessment-rules li {
    display: flex;
    align-items: flex-start;
    gap: var(--s2);
    font-size: var(--text-sm);
    color: var(--ink-2);
    line-height: var(--leading-snug);
}

.assessment-rules svg {
    flex: 0 0 auto;
    margin-top: 3px;
    color: var(--ink-4);
}

.assessment-timer {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s1) var(--s3);
    border-radius: var(--r-pill);
    background: var(--surface-3);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.assessment-timer[data-tone='warn'] { background: var(--warn-soft); color: var(--warn); }

.assessment-timer[data-tone='bad'] {
    background: var(--bad-soft);
    color: var(--bad);
    animation: pulse-soft 1.6s ease-in-out infinite;
}

@keyframes pulse-soft {
    50% { opacity: 0.6; }
}

.tab-banner {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s2) var(--s4);
    background: var(--warn-soft);
    border-bottom: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
    color: var(--ink);
    flex: 0 0 auto;
}
