/**
 * Виджет «Расписание» (+ разметка таймера в «Таймер до закрытия»).
 */

/* Карточка: колонка как у других inner-виджетов */
.widget-schedule-inner {
    flex-direction: column;
    gap: var(--widget-gap);
}

.widget-schedule--no-icon .widget-schedule-icon {
    display: none;
}

.widget-schedule-icon::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 25%;
    transform: translate(-50%, 0);
    width: 35%;
    height: 25%;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    border-bottom: none;
}

.widget-schedule {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: var(--widget-pad-single);
    overflow: auto;
}

.widget-schedule-main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.widget-schedule .widget-schedule-title {
    font-weight: 600;
    opacity: 0.95;
    margin-bottom: var(--widget-gap-sm);
    font-size: 0.98em;
    text-align: center;
    width: 100%;
}

.widget-schedule.widget-schedule--no-title .widget-schedule-title {
    display: none;
}

.widget-schedule.widget-schedule--no-countdown .widget-schedule-status {
    display: none;
}

.widget-schedule.widget-schedule--no-table .widget-schedule-table {
    display: none;
}

/* После окончания последнего урока скрываем строки расписания */
.widget-schedule.widget-schedule--lessons-ended .widget-schedule-table {
    display: none;
}

.widget-schedule.widget-schedule--no-countdown-label .widget-schedule-status-label {
    display: none;
}

.widget-schedule-status {
    width: 100%;
    box-sizing: border-box;
    padding: var(--widget-pad);
    border-radius: 6px;
    margin-bottom: var(--widget-gap);
    text-align: center;
    border: none;
}

.widget-schedule-state-lesson {
    background: var(--schedule-lesson-bg, rgba(185, 28, 28, 0.9));
    color: #fff;
}

.widget-schedule-state-break {
    background: var(--schedule-break-bg, rgba(21, 128, 61, 0.92));
    color: #fff;
}

.widget-schedule-state-end {
    background: var(--schedule-end-bg, rgba(30, 64, 175, 0.9));
    color: #fff;
}

.widget-schedule-status-text {
    font-weight: 600;
    font-size: 0.92em;
}

.widget-schedule-status-time {
    font-variant-numeric: tabular-nums;
    font-size: 1.35em;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: var(--widget-gap-xs) 0;
}

.widget-schedule-status--inline-labels .widget-schedule-status-label {
    display: none !important;
}

.widget-schedule-status-time--inline {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--widget-gap) var(--widget-pad-single);
    margin: var(--widget-gap-sm) 0;
    padding-bottom: var(--widget-gap-sm);
}

.widget-schedule-status-time--inline .widget-schedule-time-pair {
    display: inline-flex;
    align-items: baseline;
    gap: var(--widget-gap-xs);
}

.widget-schedule-status-time--inline .widget-schedule-time-num {
    font-variant-numeric: tabular-nums;
}

.widget-schedule-status-time--inline .widget-schedule-status-label-part {
    font-size: 0.65em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.92;
    line-height: 1.35;
}

.widget-schedule-status-time--inline .widget-schedule-time-num--box,
.widget-schedule-status-time--boxes .widget-schedule-time-num--box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2em;
    padding: var(--widget-box-pad);
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
}

.widget-schedule-status-time--boxes:not(.widget-schedule-status-time--inline) {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--widget-gap-sm);
    margin: var(--widget-gap-sm) auto;
    padding: var(--widget-pad);
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    border: none;
    flex-wrap: nowrap;
}

.widget-schedule-status-time--boxes:not(.widget-schedule-status-time--inline) .widget-schedule-time-part {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6em;
    font-variant-numeric: tabular-nums;
}

.widget-schedule-status-time--boxes:not(.widget-schedule-status-time--inline) .widget-schedule-time-pair {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.widget-schedule-status-time--boxes:not(.widget-schedule-status-time--inline) .widget-schedule-time-sep {
    opacity: 0.85;
    font-weight: 700;
    flex-shrink: 0;
}

.widget-schedule-status-time--plaque-expand-wide {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.widget-schedule-status-time--plaque-expand-full {
    width: 100%;
    box-sizing: border-box;
}

.widget-schedule-status-label {
    font-size: 0.72em;
    opacity: 0.92;
    color: rgba(255, 255, 255, 0.9);
}

.widget-schedule-main--space-between {
    flex: 1;
    justify-content: space-between;
    min-height: 0;
}

.widget-schedule-main--space-between .widget-schedule-status {
    margin-bottom: var(--widget-gap);
}

.widget-schedule-main--space-between .widget-schedule-table {
    margin-top: auto;
}

.widget-schedule-state-break .widget-schedule-status-label {
    color: rgba(255, 255, 255, 0.88);
}

.widget-schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88em;
}

.widget-schedule-table td,
.widget-schedule-table th {
    padding: var(--widget-box-pad);
    border: 1px solid var(--color-border);
}

.widget-schedule-table tr.lesson-current {
    background: var(--schedule-table-lesson-current-bg, rgba(185, 28, 28, 0.28));
    color: var(--color-text);
}

.widget-schedule-table tr.lesson-current td {
    border-color: var(--schedule-table-lesson-current-border, rgba(185, 28, 28, 0.5));
}

.widget-schedule-table tr.break-next {
    background: var(--schedule-table-break-next-bg, rgba(21, 128, 61, 0.22));
    color: var(--color-text);
}

.widget-schedule-table tr.break-next td {
    border-color: var(--schedule-table-break-next-border, rgba(21, 128, 61, 0.45));
}

.widget-schedule-table .customers {
    text-align: center;
}

/* Общая разметка обратного отсчёта в виджете «Таймер до закрытия» */
.widget-closing-timer .widget-schedule-status-time {
    font-size: 1.15em;
}

/* Портретный киоск: сброс базового масштаба ячейки (остальные типы — в main.css) */
.player-wrap[data-screen-orientation="portrait"] .player-cell.widget-schedule {
    font-size: 1rem;
}

.player-wrap[data-screen-orientation="portrait"] .widget-schedule {
    font-size: clamp(0.85rem, min(3.5cqmax, 3cqh), 1.5rem);
    justify-content: flex-start;
}

.player-wrap[data-screen-orientation="portrait"] .widget-schedule .widget-schedule-title {
    font-size: 1.05em;
}

.player-wrap[data-screen-orientation="portrait"] .widget-schedule-status-text {
    font-size: 1.05em;
}

.player-wrap[data-screen-orientation="portrait"] .widget-schedule-status-time {
    font-size: 1.35em;
}

.player-wrap[data-screen-orientation="portrait"] .widget-schedule-table {
    font-size: 0.92em;
}

.player-wrap[data-screen-orientation="portrait"] .widget-schedule-status-time--inline {
    flex-direction: column;
    align-items: center;
    gap: 0.35em;
}

.player-wrap[data-screen-orientation="portrait"] .widget-schedule-status-time--boxes:not(.widget-schedule-status-time--inline) {
    flex-direction: column;
    gap: var(--widget-gap);
}

.player-wrap[data-screen-orientation="portrait"] .widget-schedule-status-time--inline .widget-schedule-time-pair {
    flex-direction: row;
    align-items: baseline;
    gap: 0.35em;
}
