﻿
.training-schedule {
    padding: 2rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    box-shadow: var(--shadow-small);
}

.training-schedule__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

    .training-schedule__header h2 {
        margin: 0;
        color: var(--color-text);
        font-size: clamp(1.5rem, 3vw, 2rem);
    }

.training-schedule__badge {
    padding: 0.65rem 1rem;
    border-radius: 12px;
    background: #e7f2ef;
    color: var(--color-primary-dark);
    font-weight: 600;
    white-space: nowrap;
}

/* Horizontal scrolling for smaller screens */
.training-schedule__scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.training-schedule__table {
    width: 100%;
    min-width: 1050px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
}

    .training-schedule__table th,
    .training-schedule__table td {
        padding: 12px 8px;
        border-right: 1px solid var(--color-border);
        border-bottom: 1px solid var(--color-border);
        text-align: center;
        vertical-align: middle;
    }

    .training-schedule__table tr > :last-child {
        border-right: 0;
    }

    .training-schedule__table tbody tr:last-child > * {
        border-bottom: 0;
    }

    /* Days header */
    .training-schedule__table thead th {
        padding: 1.25rem 0.5rem;
        background: #edf2f0;
        color: var(--color-text);
        font-size: 0.9rem;
        font-weight: 700;
    }

    /* Time column */
    .training-schedule__table th:first-child {
        width: 90px;
    }

.schedule-time {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
}

.training-schedule__table tbody td {
    height: 110px;
    background: #fff;
}

/* Training cards */
.schedule-event {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 80px;
    padding: 12px 8px;
    border-radius: 12px;
    text-align: center;
    overflow-wrap: anywhere;
}

    .schedule-event + .schedule-event {
        margin-top: 8px;
    }

    .schedule-event strong {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .schedule-event span {
        font-size: 0.8rem;
    }

    .schedule-event small {
        font-size: 0.75rem;
        line-height: 1.4;
    }

/* Physiotherapy */
.schedule-event--physio {
    background: #e3f1e8;
    color: #145a42;
}

/* Children's training */
.schedule-event--kids {
    background: #fff0db;
    color: #85521c;
}

/* Functional training */
.schedule-event--functional {
    background: #dff2ef;
    color: #176b67;
}

/* Empty cells */
.schedule-empty {
    color: #a2adaa;
    font-size: 1.2rem;
}


.schedule-info {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
}

    .schedule-info h2 {
        margin-bottom: 1.5rem;
        color: var(--color-primary-dark);
        font-size: 1.5rem;
    }

.schedule-info__locations {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.schedule-info__location {
    padding: 1.25rem;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 12px;
}

    .schedule-info__location h3 {
        margin-bottom: 0.5rem;
        font-size: 1rem;
        color: var(--color-primary-dark);
    }

    .schedule-info__location p {
        margin: 0;
        color: var(--color-text-muted);
    }

.schedule-info__rules {
    display: grid;
    gap: 0.85rem;
    margin: 0 0 1.75rem;
    padding-left: 1.4rem;
}

    .schedule-info__rules li {
        padding-left: 0.25rem;
    }

.schedule-info__notice {
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--color-primary);
    background: #e7f2ef;
    border-radius: 10px;
}

    .schedule-info__notice strong {
        color: var(--color-primary-dark);
    }

    .schedule-info__notice p {
        margin: 0.4rem 0 0;
    }

@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
    .training-schedule {
        /* Размер текста внутри таблицы */
        --calendar-font-size: clamp( 0.75rem, calc(0.65rem + 0.5vmin), 0.9rem );
        /* Основные настройки размеров */
        --calendar-min-width: 40rem;
        --calendar-time-width: 3.5rem;
        --calendar-cell-padding: 0.35rem;
        --calendar-card-padding: 0.4rem;
        padding: clamp(0.5rem, 2vmin, 1rem);
    }

    .training-schedule__table {
        width: 100%;
        min-width: var(--calendar-min-width);
        font-size: var(--calendar-font-size);
    }

        .training-schedule__table th,
        .training-schedule__table td {
            padding: var(--calendar-cell-padding);
        }

        .training-schedule__table thead th {
            padding: 0.6rem var(--calendar-cell-padding);
            font-size: 1em;
            line-height: 1.3;
            overflow-wrap: anywhere;
        }

        .training-schedule__table th:first-child {
            width: var(--calendar-time-width);
        }

    .schedule-time {
        font-size: 1em;
    }

    .training-schedule__table tbody td {
        /* Переопределяет исходные 110px */
        height: auto;
    }

    .schedule-event {
        /* Переопределяет исходные min-height: 80px */
        min-height: 0;
        padding: var(--calendar-card-padding);
        gap: 0.2rem;
    }

        .schedule-event strong {
            font-size: 1em;
            line-height: 1.3;
        }

        .schedule-event span {
            font-size: 0.95em;
            line-height: 1.3;
        }

        .schedule-event small {
            font-size: 0.9em;
            line-height: 1.3;
        }

        .schedule-event + .schedule-event {
            margin-top: 0.3rem;
        }
}