/*
 * Публичное расписание соревнования (`app/views/competitions/schedule.php`).
 *
 * Блоки: панель фильтров, группы клубов и раскрывающиеся таблицы тренеров.
 * Цвета — из токенов `public/css/variables.css` (`--md-*`), чтобы страница работала
 * в светлой и тёмной темах. Цвет бейджа категории приходит из данных (`data-color-bg`).
 */

.schedule-related {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.schedule-related li {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
}

/* ── Панель фильтров ───────────────────────────────────────────── */

.schedule-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
}

.schedule-toolbar .form-group {
    flex: 0 1 220px;
    min-width: 180px;
    margin: 0;
}

.schedule-toolbar__search {
    flex: 1 1 260px;
}

.schedule-toolbar .filter-select,
.schedule-toolbar .search-input {
    width: 100%;
    height: 40px;
}

.schedule-summary {
    margin: 14px 0 0;
    font-size: 14px;
    color: var(--md-text-secondary, #5f6368);
}

.schedule-summary strong {
    color: var(--md-on-surface, #212529);
    font-variant-numeric: tabular-nums;
}

.schedule-opening {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0;
}

.schedule-found {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--md-primary, #1a73e8);
}

.schedule-found[hidden] {
    display: none;
}

/* ── Группа клуба ──────────────────────────────────────────────── */

.schedule-club {
    margin-bottom: 20px;
    border: 1px solid var(--md-outline-variant, #e0e0e0);
    border-radius: 12px;
    background: var(--md-surface, #fff);
    overflow: hidden;
}

.schedule-club__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: var(--md-surface-variant, #f5f5f5);
    border-bottom: 1px solid var(--md-outline-variant, #e0e0e0);
}

.schedule-club__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 360px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.schedule-club__toggle:hover .schedule-club__name {
    text-decoration: underline;
}

.schedule-club__toggle:focus-visible {
    outline: 2px solid var(--md-primary, #1a73e8);
    outline-offset: 2px;
    border-radius: 6px;
}

.schedule-club__icon {
    font-size: 22px;
    color: var(--md-text-secondary, #5f6368);
    transition: transform 0.2s ease;
}

.schedule-club__toggle[aria-expanded="true"] .schedule-club__icon {
    transform: rotate(180deg);
}

.schedule-club__toggle[aria-expanded="false"] .schedule-club__icon {
    transform: rotate(-90deg);
}

.schedule-club__title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.schedule-club__mark {
    font-size: 22px;
    color: var(--md-primary, #1a73e8);
}

.schedule-club__name {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
}

.schedule-club__body[hidden] {
    display: none;
}

.schedule-club__stats {
    font-size: 12.5px;
    color: var(--md-text-secondary, #5f6368);
}

.schedule-club__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.schedule-pdf {
    font-size: 12px;
    font-weight: 600;
    color: var(--md-primary, #1a73e8);
    text-decoration: none;
    white-space: nowrap;
}

.schedule-pdf:hover,
.schedule-pdf:focus-visible {
    text-decoration: underline;
}

/* ── Тренер: заголовок-переключатель ───────────────────────────── */

.schedule-trainer {
    border-top: 1px solid var(--md-outline-variant, #ececec);
}

.schedule-club__head + .schedule-trainer {
    border-top: 0;
}

.schedule-trainer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 16px;
}

.schedule-trainer__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 320px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.schedule-trainer__toggle:hover .schedule-trainer__name {
    text-decoration: underline;
}

.schedule-trainer__toggle:focus-visible {
    outline: 2px solid var(--md-primary, #1a73e8);
    outline-offset: 2px;
    border-radius: 6px;
}

.schedule-trainer__icon {
    font-size: 20px;
    color: var(--md-text-secondary, #5f6368);
    transition: transform 0.2s ease;
}

.schedule-trainer__toggle[aria-expanded="true"] .schedule-trainer__icon {
    transform: rotate(180deg);
}

.schedule-trainer__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--md-on-surface, #212529);
}

.schedule-trainer__stats {
    font-size: 12.5px;
    color: var(--md-text-secondary, #5f6368);
    font-variant-numeric: tabular-nums;
}

.schedule-trainer__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.schedule-trainer__body {
    padding: 0 8px 10px;
}

.schedule-trainer__body[hidden] {
    display: none;
}

/* ── Таблица участников ───────────────────────────────────────── */

.schedule-table {
    width: 100%;
    font-size: 13px;
}

.schedule-table th {
    padding: 0;
    background: var(--md-surface-variant, #f8f9fa);
}

.schedule-table td {
    vertical-align: middle;
}

.schedule-sort {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 9px 8px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    cursor: pointer;
}

.schedule-table th.text-start .schedule-sort {
    justify-content: flex-start;
}

.schedule-sort__icon {
    font-size: 14px;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.schedule-sort:hover .schedule-sort__icon,
.schedule-sort:focus-visible .schedule-sort__icon {
    opacity: 1;
}

.schedule-sort:focus-visible {
    outline: 2px solid var(--md-primary, #1a73e8);
    outline-offset: -2px;
}

.schedule-sort[data-direction="asc"] .schedule-sort__icon,
.schedule-sort[data-direction="desc"] .schedule-sort__icon {
    opacity: 1;
    color: var(--md-primary, #1a73e8);
}

.schedule-time {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

.schedule-date {
    color: var(--md-text-secondary, #5f6368);
    white-space: nowrap;
}

.schedule-cat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.schedule-cat__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 22px;
    padding: 0 7px;
    border-radius: 7px;
    background: #6c757d;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.schedule-cat__name {
    min-width: 0;
}

.schedule-row--inactive td {
    text-decoration: line-through;
    opacity: 0.65;
}

.schedule-row--inactive .schedule-cat__badge {
    text-decoration: none;
}

.schedule-row__status {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--md-danger, #c62828);
    text-decoration: none;
}

.schedule-club.is-hidden,
.schedule-trainer.is-hidden,
.schedule-row.is-hidden {
    display: none;
}

@media (max-width: 720px) {
    .schedule-club__head,
    .schedule-trainer__head {
        padding: 12px;
    }

    .schedule-toolbar .form-group {
        flex: 1 1 100%;
    }

    .schedule-table {
        min-width: 640px;
    }
}

