/* Check-in Light: the Green/Yellow/Red picker on a check-in assignment and the Light shown on the mentor board.
   Each Light takes the brand's success, warning or error roles; the words always accompany the colour. */

.light-option--green,
.light-indicator.light-green {
    --light: var(--md-sys-color-success);
    --light-container: var(--md-sys-color-success-container);
    --on-light-container: var(--md-sys-color-on-success-container);
}

.light-option--yellow,
.light-indicator.light-yellow {
    --light: var(--md-sys-color-warning);
    --light-container: var(--md-sys-color-warning-container);
    --on-light-container: var(--md-sys-color-on-warning-container);
}

.light-option--red,
.light-indicator.light-red {
    --light: var(--md-sys-color-error);
    --light-container: var(--md-sys-color-error-container);
    --on-light-container: var(--md-sys-color-on-error-container);
}

.light-dot {
    display: inline-block;
    flex: none;
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 50%;
    background: var(--light);
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.15);
}

/* Picker: one card per Light; the chosen card fills with its colour */
.light-picker {
    display: grid;
    gap: 0.5rem;
    max-width: 32rem;
    min-width: 0;
    margin: 1rem 0 1.5rem;
    /* normalize.css loads after the theme and pads every fieldset */
    padding: 0;
}

.light-picker legend {
    margin-bottom: 0.75rem;
    padding: 0;
}

.light-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    border: 1.5px solid var(--md-sys-color-outline-variant);
    border-radius: var(--brand-shape-medium, 12px);
    background: var(--md-sys-color-surface);
    transition: background-color 0.15s, border-color 0.15s;
}

.light-option input[type="radio"] {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    accent-color: var(--on-light-container);
}

.light-option label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0;
    padding: 0.875rem 0;
    font-weight: 500;
    cursor: pointer;
}

.light-option:hover {
    border-color: var(--light);
}

.light-option:has(input:checked) {
    background: var(--light-container);
    border-color: var(--light);
    color: var(--on-light-container);
}

.light-option:has(input:focus-visible) {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

/* Mentor board: the Light as a pill, its date beneath, and an edge mark on rows still waiting to be seen */
.light-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.625rem 0.25rem 0.5rem;
    border-radius: 999px;
    background: var(--light-container);
    color: var(--on-light-container);
    font-weight: 600;
    white-space: nowrap;
}

.light-date {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
    white-space: nowrap;
}

.light-none {
    color: var(--md-sys-color-on-surface-variant);
}

.mentor-board-row--urgent-red > td:first-child {
    box-shadow: inset 4px 0 0 var(--md-sys-color-error);
    padding-left: 0.75rem;
}

.mentor-board-row--urgent-yellow > td:first-child {
    box-shadow: inset 4px 0 0 var(--md-sys-color-warning);
    padding-left: 0.75rem;
}

/* Mentor board on phones: each student's row becomes a card. The column headers stay in the
   accessibility tree (visually hidden, not display:none), and each value shows its column name above it. */
.mentor-board__cell-label {
    display: none;
}

@media (max-width: 600px) {
    .mentor-board__table {
        margin-top: 1.25rem;
    }

    .mentor-board__table .data-table,
    .mentor-board__table .data-table tbody {
        display: block;
    }

    .mentor-board__table .data-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .mentor-board-row {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "student light"
            "days progress"
            "seen seen";
        gap: 0.375rem 0.75rem;
        margin-bottom: 0.625rem;
        padding: 0.875rem 1rem;
        border: 1px solid var(--md-sys-color-outline-variant);
        border-radius: var(--brand-shape-medium, 12px);
        background: var(--md-sys-color-surface);
    }

    .mentor-board__table .data-table .mentor-board-row > td {
        display: block;
        padding: 0;
        border: 0;
        box-shadow: none;
        white-space: normal;
    }

    /* Visually hidden but kept as a cell, so screen readers still pair each later cell with its column */
    .mentor-board__table .data-table .mentor-board-row > td.mentor-board__cell--empty {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .mentor-board__cell--student {
        grid-area: student;
        font-size: 1rem;
        font-weight: 600;
    }

    .mentor-board__cell--light {
        grid-area: light;
        text-align: right;
    }

    .mentor-board__cell--days {
        grid-area: days;
    }

    .mentor-board__cell--progress {
        grid-area: progress;
    }

    .mentor-board__cell--seen {
        grid-area: seen;
        margin-top: 0.25rem;
    }

    .mentor-board__cell--seen p {
        margin: 0;
    }

    .mentor-board__cell--seen button {
        width: 100%;
    }

    .mentor-board__cell-label {
        display: block;
        font-size: 0.6875rem;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--md-sys-color-outline);
    }

    .mentor-board-row--urgent-red {
        border-left: 4px solid var(--md-sys-color-error);
    }

    .mentor-board-row--urgent-yellow {
        border-left: 4px solid var(--md-sys-color-warning);
    }
}
