/* Weekly timetable (Pages/Shared/_ScheduleGrid.cshtml): /Schedule and the homepage "today" section.
   Customer themes restyle colours via body-scoped rules (e.g. css/customers/intown.css). */

.schedule-grid {
    width: 100%;
    table-layout: fixed;          /* equal day columns, independent of their content */
    border-collapse: collapse;
    margin-top: 20px;
}

.schedule-grid .schedule-col-time { width: 6.25rem; }

.schedule-grid th, .schedule-grid td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    vertical-align: top;
}

.schedule-grid th {
    background-color: #1d1e20;
    color: #fff;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.time-slot {
    font-weight: bold;
    background-color: #1d1e20;
    color: #fff;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
}

/* start on top, end time smaller below: keeps the time column narrow */
.time-slot .time-start { display: block; }
.time-slot .time-sep { display: none; }
.time-slot .time-end { display: block; font-size: .8em; font-weight: 500; opacity: .7; }

.schedule-cell { position: relative; }

.has-class {
    background-color: #2c5aa0;
    color: #fff;
    border-left: 3px solid var(--accent-color);
}

.no-class {
    background-color: #2a2a2a;
    color: #ccc;
}

.class-info {
    text-align: left;
    overflow-wrap: break-word;
}

/* divider only between visible classes (the track filter hides some) */
.class-info:not([hidden]) ~ .class-info:not([hidden]) {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.schedule-grid .program-name,
.schedule-grid .program-link {
    font-weight: bold;
    font-size: .875rem;
    line-height: 1.3;
    color: #fff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.program-link:hover { color: var(--accent-color); }

.coach-name {
    font-size: 0.8rem;
    margin-top: 2px;
    color: var(--accent-color);
}

.coach-name a { color: inherit; text-decoration: none; }
.coach-name a:hover { text-decoration: underline; }

.no-class-text { color: #666; }

.table-responsive { overflow-x: auto; }

/* Cells/rows emptied by the track filter */
.schedule-grid .class-info[hidden] { display: none; }
.schedule-grid tr[hidden] { display: none; }

/* Single day (homepage "today"): same cells, narrower table */
.schedule-wrap--day { max-width: 40rem; }
.schedule-grid--day .schedule-col-time { width: 7rem; }

/* Day picker: only on narrow screens, where the grid shows one day at a time */
.schedule-daypicker {
    display: none;
    grid-template-columns: repeat(7, 1fr);
    gap: .35rem;
    margin: 0 0 .75rem;
}

.schedule-daypicker-btn {
    padding: .55rem 0;
    border: 1px solid var(--line, #34363a);
    border-radius: 6px;
    background: transparent;
    color: var(--text-color, #fff);
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
}

.schedule-daypicker-btn:hover { border-color: var(--accent-color); }

.schedule-daypicker-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--on-accent, #000);
}

.schedule-day-empty { margin: 1rem 0 0; color: var(--muted-color, #aaa); }

@media (max-width: 900px) {
    .schedule-daypicker { display: grid; }
    .schedule-grid { margin-top: 0; }
    .schedule-grid .schedule-col-time { width: 5.25rem; }

    /* only the active day's column ... */
    .schedule-grid[data-active-day="monday"]    [data-day]:not([data-day="monday"]),
    .schedule-grid[data-active-day="tuesday"]   [data-day]:not([data-day="tuesday"]),
    .schedule-grid[data-active-day="wednesday"] [data-day]:not([data-day="wednesday"]),
    .schedule-grid[data-active-day="thursday"]  [data-day]:not([data-day="thursday"]),
    .schedule-grid[data-active-day="friday"]    [data-day]:not([data-day="friday"]),
    .schedule-grid[data-active-day="saturday"]  [data-day]:not([data-day="saturday"]),
    .schedule-grid[data-active-day="sunday"]    [data-day]:not([data-day="sunday"]) { display: none; }

    /* ... and only the time rows that have a class on that day */
    .schedule-grid[data-active-day="monday"]    tbody tr:not([data-days~="monday"]),
    .schedule-grid[data-active-day="tuesday"]   tbody tr:not([data-days~="tuesday"]),
    .schedule-grid[data-active-day="wednesday"] tbody tr:not([data-days~="wednesday"]),
    .schedule-grid[data-active-day="thursday"]  tbody tr:not([data-days~="thursday"]),
    .schedule-grid[data-active-day="friday"]    tbody tr:not([data-days~="friday"]),
    .schedule-grid[data-active-day="saturday"]  tbody tr:not([data-days~="saturday"]),
    .schedule-grid[data-active-day="sunday"]    tbody tr:not([data-days~="sunday"]) { display: none; }
}

/* Track filter chips */
.schedule-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
}

.schedule-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--line, #34363a);
    border-radius: 999px;
    background: transparent;
    color: var(--text-color, #fff);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.schedule-filter-chip:hover { border-color: var(--accent-color); }

.schedule-filter-chip.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--on-accent, #000);
}

.schedule-filter-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(127, 127, 127, 0.5);
}

/* Legend under the grid (ProgramSchedule:TrackLegendEnabled) */
.schedule-legend {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--line, #34363a);
}

.schedule-legend h2 { margin: 0 0 1.25rem; }

.schedule-legend-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.25rem 2rem;
}

.schedule-legend-item { display: flex; align-items: flex-start; gap: 0.85rem; }

.schedule-legend-icon {
    flex: none;
    display: inline-flex;
    width: 1.6em;
    justify-content: center;
    padding-top: 0.1rem;
    color: var(--text-color, #fff);
}

.schedule-legend-text { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }

.schedule-legend-name { font-weight: 700; color: var(--text-color, #fff); text-decoration: none; }
a.schedule-legend-name:hover { color: var(--accent-color); }

.schedule-legend-headline { font-size: 0.9rem; color: var(--muted-color, #aaa); line-height: 1.4; }

.schedule-more { margin-top: 1.25rem; }

/* /Schedule: the grid gets more room than the 1280px text container on wide screens */
.container.schedule-page { max-width: 1520px; }
@media (min-width: 1400px) { .container.schedule-page { padding: 0 2.5rem; } }

@media (max-width: 900px) {
    /* the time column is narrow here: no wide tracking that would cut off "Uhrzeit" */
    body .schedule-grid thead th:first-child { letter-spacing: .04em; text-overflow: clip; }
}
