/* Базовый класс для всех иконок */
.timetable-icon::before {
    display: inline-block;
    width: 1.2em;
    text-align: center;
    margin-right: 0.5em;
    font-style: normal;
    font-weight: normal;
}

.list-container.schedule-slot-pattern {
    display: flex;
    flex-direction: column;
/*    height: calc(100vh - 140px);*/
}

.schedule-grid-container {
    flex: 1;
    overflow: auto;
    margin-top: 12px;
}

.list-container.schedule-slot-pattern td.slot-cell .schedule-slot {
    /*min-width: 150px;*/
}

.list-container.schedule-slot-pattern td.slot-cell .empty-cell {
    /*width: 24px;*/
}

/* СПРАВОЧНИКИ И УЧЕБНАЯ СТРУКТУРА */
.icon-specialization::before { content: "🎓"; } /* Специальность */
.icon-study-plan::before { content: "📋"; } /* Учебный план */
.icon-study-plan-item::before { content: "📑"; } /* Элемент учебного плана */
.icon-subject::before { content: "📚"; } /* Предмет */

/* УЧАСТНИКИ ПРОЦЕССА */
.icon-teacher::before { content: "👨‍🏫"; } /* Преподаватель */
.icon-student::before { content: "🧑‍"; } /* Студенческая группа */
.icon-student-group::before { content: "👥"; } /* Студенческая группа */
.icon-student-subgroup::before { content: "👫"; } /* Подгруппа */

/* ИНФРАСТРУКТУРА */
.icon-building::before { content: "🏢"; } /* Здание */
.icon-room::before { content: "🚪"; } /* Аудитория */

/* ГЕНЕРАЦИЯ РАСПИСАНИЯ */
.icon-schedule-generation::before { content: "📅"; } /* Генерация расписания */
.icon-activity::before { content: "🎯"; } /* Занятие */
.icon-tag::before { content: "🏷️"; } /* Тэг */

/* ОГРАНИЧЕНИЯ */
.icon-time-constraint::before { content: "⏰"; } /* Временное ограничение */
.icon-activity-constraint::before { content: "🔗"; } /* Ограничение активности */
.icon-space-constraint::before { content: "📍"; } /* Ограничение аудитории */

/* РЕЗУЛЬТАТ */
.icon-schedule-slot::before { content: "⏱️"; } /* Слот расписания */
.icon-schedule-slot-pattern::before { content: "🗓️"; } /* Слот шабона расписания */
.icon-fet-mapping::before { content: "🔄"; } /* Маппинг */
.icon-day-slot::before { content: "🌞"; } /* Слот шабона расписания */
.icon-time-slot::before { content: "🕐"; } /* Слот шабона расписания */

/* Дополнительные вспомогательные иконки */
.icon-success::before { content: "✅"; }
.icon-error::before { content: "❌"; }
.icon-warning::before { content: "⚠️"; }
.icon-info::before { content: "ℹ️"; }
.icon-edit::before { content: "✏️"; }
.icon-delete::before { content: "🗑️"; }
.icon-add::before { content: "➕"; }
.icon-search::before { content: "🔍"; }
.icon-calendar::before { content: "📆"; }
.icon-clock::before { content: "🕐"; }
.icon-document::before { content: "📄"; }
.icon-folder::before { content: "📁"; }
.icon-settings::before { content: "⚙️"; }
.icon-export::before { content: "📤"; }
.icon-import::before { content: "📥"; }
.icon-print::before { content: "🖨️"; }
.icon-save::before { content: "💾"; }
.icon-refresh::before { content: "🔄"; }

/* Размеры иконок */
.icon-sm::before { font-size: 0.875em; }
.icon-lg::before { font-size: 1.5em; }
.icon-xl::before { font-size: 2em; }
.icon-2xl::before { font-size: 3em; }

/* Цвета (работает не во всех браузерах для эмодзи) */
.icon-primary { filter: hue-rotate(210deg); }
.icon-success { filter: hue-rotate(120deg); }
.icon-danger { filter: hue-rotate(0deg); }
.icon-warning { filter: hue-rotate(45deg); }


/* Стили для daytimeslot grid */
.daytimeslot-grid table,
.daytimeslot-multiple-grid table {
    table-layout: fixed;
}

.daytimeslot-grid .slot-cell,
.daytimeslot-multiple-grid .slot-cell {
    background-color: #f8f9fa;
    transition: background-color 0.2s;
    height: 30px;
}

.daytimeslot-grid .slot-cell:hover,
.daytimeslot-multiple-grid .slot-cell:hover {
    background-color: #e9ecef;
}

.daytimeslot-grid .slot-cell.selected,
.daytimeslot-multiple-grid .slot-cell.selected {
    background-color: #007bff;
}

.daytimeslot-grid .slot-cell.selected:hover,
.daytimeslot-multiple-grid .slot-cell.selected:hover {
    background-color: #0056b3;
}

.native-form-container .cell {
    margin-bottom: 15px;
}

/* Закругление углов для таблицы расписания */
.schedule-table {
    border-radius: 0.5rem;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    border-right: 1px solid #dee2e6;
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
}

.schedule-table th,
.schedule-table td {
    border-left: 1px solid #dee2e6;
}

/* Закругление углов для угловых ячеек */
.schedule-table thead tr:first-child th:first-child {
    border-top-left-radius: 0.5rem;
}

.schedule-table thead tr:first-child th:last-child {
    border-top-right-radius: 0.5rem;
}

.schedule-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 0.5rem;
}

.schedule-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 0.5rem;
}

/* ===== ДОПОЛНЕНИЯ ДЛЯ МНОЖЕСТВЕННЫХ СЛОТОВ ===== */

/* Контейнер для множественных слотов в одной ячейке */
.slot-cell-container {
    display: flex;
    flex-direction: row;
    gap: 2px;
    width: 100%;
    height: 100%;
    align-items: stretch;
}

/* Контейнеры отдельных слотов */
.slot-cell-container > div[class^="slot-container-"] {
    flex: 1;
    min-width: 0; /* Позволяет сжиматься */
    display: flex;
}

/* Адаптация ширины слота при множественном размещении */
.slot-cell-container .schedule-slot {
    width: 100%;
    min-width: auto; /* Отменяем фиксированную минимальную ширину */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Стили для одиночного слота (обратная совместимость) */
.slot-cell-container:has(> :only-child) .schedule-slot {
    min-width: 150px; /* Сохраняем минимальную ширину для одиночных */
}

/* Визуальное разделение множественных слотов */
.slot-cell-container > div[class^="slot-container-"]:not(:last-child) {
    border-right: 1px dashed #dee2e6;
    padding-right: 2px;
}

/* Стили для subgroup badge в слотах */
.subgroup-badge {
    display: inline-block;
    padding: 0 4px;
    margin: 0 2px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    font-size: 0.85em;
}

/* Корректировка высоты для ячеек с rowspan */
td.slot-cell[rowspan] {
    vertical-align: top;
    position: relative;
}

td.slot-cell[rowspan] .slot-cell-container {
    height: 100%;
}

/* Визуальный индикатор duration внутри слота */
.schedule-slot[data-duration]:after {
    content: attr(data-duration) "h";
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.7em;
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.8);
    padding: 0 3px;
    border-radius: 2px;
}

/* Адаптивность для маленьких экранов */
@media (max-width: 768px) {
    .slot-cell-container {
        flex-direction: column; /* Вертикальное размещение на мобильных */
        gap: 1px;
    }

    .slot-cell-container > div[class^="slot-container-"]:not(:last-child) {
        border-right: none;
        border-bottom: 1px dashed #dee2e6;
        padding-right: 0;
        padding-bottom: 2px;
    }
}

/* Улучшение читаемости при множественных слотах */
.slot-cell-container:has(> div:nth-child(3)) .schedule-slot {
    font-size: 0.9em; /* Уменьшаем шрифт при 3+ слотах */
}

.slot-cell-container:has(> div:nth-child(4)) .schedule-slot {
    font-size: 0.85em; /* Еще меньше при 4+ слотах */
}

/* Подсветка при наведении на множественные слоты */
.slot-cell-container > div[class^="slot-container-"]:hover {
    background-color: rgba(0, 123, 255, 0.05);
    z-index: 1;
}

/* Пустые ячейки */
td.slot-cell .empty-cell {
    min-height: 40px;
    width: 100%;
}

/* Разделитель между слотами в одной ячейке */
.slot-cell-container > div[data-entity="ScheduleSlotPattern"]:not(:first-child) {
    border-left: 1px solid #d0d0d0;
    padding-left: 5px;
    margin-left: 5px;
}

.slot-cell-container > div[data-entity="ScheduleSlotPattern"] {
    width: 100%;
}

/* Стиль для занятий-замен (substitutionStatus = substitute) */
.schedule-slot-substitute {
    background-color: #fffacd !important; /* Бледно-желтый (lemonchiffon) */
}