/*
 * Coding Ireland proprietary interactive activity
 * Copyright (c) 2017-2026 Coding Ireland. All rights reserved.
 *
 * Part of the Coding Ireland online learning platform. Licensed for use only
 * as delivered on the platform. Copying, redistributing, or adapting this
 * file, in whole or in part, for use in any other product or service is not
 * permitted. Ref: CI-maths-timetable-reader
 */
/*
 * timetable-reader activity styles.
 *
 * A real-looking timetable: stations as rows, services as columns,
 * each cell carrying a time. Tap-to-select a depart cell, then a
 * later arrive cell — the widget highlights both and computes the
 * elapsed time.
 */

.tt-mode-chip {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    background: var(--maths-surface-alt);
    color: var(--maths-primary-dark);
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tt-target-label { font-weight: 800; color: #8a5a00; font-size: 0.95rem; margin-right: 0.5rem; }
.tt-target-prompt { flex: 1 1 auto; color: #6b4500; font-weight: 700; font-size: 1rem; }

.tt-meta {
    background: var(--maths-surface);
    border: 1px solid var(--maths-border);
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    padding: 0.75rem 1rem;
}

.tt-meta-title {
    font-weight: 800;
    color: var(--maths-primary-dark);
    font-size: 1.35rem;
}

.tt-meta-subtitle {
    color: var(--maths-ink-muted);
    font-size: 1rem;
    margin-top: 0.2rem;
}

.tt-stage {
    background: var(--maths-surface);
    border: 1px solid var(--maths-border);
    border-radius: 0 0 12px 12px;
    border-top: none;
    padding: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.tt-table {
    border-collapse: collapse;
    width: 100%;
    font-family: 'Nunito', sans-serif;
    font-variant-numeric: tabular-nums;
}

.tt-table th,
.tt-table td {
    border-bottom: 1px solid var(--maths-border);
    padding: 0.85rem 0.9rem;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.tt-table thead th {
    background: var(--maths-surface-alt);
    color: var(--maths-primary-dark);
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--maths-primary);
    position: sticky;
    top: 0;
}

.tt-table th:first-child {
    text-align: left;
}

.tt-table tbody th {
    text-align: left;
    background: var(--maths-surface-alt);
    color: var(--maths-ink);
    font-weight: 800;
    font-size: 1.05rem;
    min-width: 140px;
}

.tt-cell-time {
    cursor: pointer;
    transition: background-color 160ms ease;
    color: var(--maths-ink);
}

.tt-cell-time:hover {
    background: #E8F2FB;
}

.tt-cell-time.is-from {
    background: #1F6FB2;
    color: #fff;
}

.tt-cell-time.is-to {
    background: #3E8E7E;
    color: #fff;
}

.tt-elapsed {
    background: var(--maths-surface);
    border: 1px solid var(--maths-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.tt-elapsed-row {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}

.tt-elapsed-label {
    font-weight: 700;
    color: var(--maths-ink-muted);
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.tt-elapsed-value {
    font-weight: 700;
    color: var(--maths-ink);
    font-variant-numeric: tabular-nums;
    font-size: 1.15rem;
}

.tt-elapsed-row-big .tt-elapsed-value-big {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--maths-primary-dark);
}

.tt-your-turn {
    background: #FFF7DE;
    border: 1px solid #F0C14B;
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    margin-top: 1rem;
}

.tt-your-turn-label { font-weight: 800; color: #8a5a00; margin-bottom: 0.4rem; }
.tt-your-turn-list { margin: 0; padding-left: 1.2rem; color: #5e3c00; font-weight: 600; }

body.display-mode .tt-cell-time,
body.display-mode #clearButton,
body.display-mode #resetButton {
    pointer-events: none;
}

/* ---------- Competition layout (board) ----------
 * Seven services by six stations has to fit a laptop on a projector as well as a board, so the
 * cells come in and the subtitle goes.
 *
 * The elapsed time under the table goes too. It works out the very number the question asks the
 * class for ("How long does the 07:00 take?") the moment two cells are picked, so the typed answer
 * was copied off the screen. The selection line above it stays, so they can see what they picked.
 */
html.mcr-compete .maths-activity .tt-meta-subtitle { display: none; }
html.mcr-compete .maths-activity .tt-table th,
html.mcr-compete .maths-activity .tt-table td { padding: 0.4rem 0.6rem; }
html.mcr-compete .maths-activity .tt-elapsed-row-big { display: none !important; }
/* ---------- end competition layout ---------- */
