/* FullCalendar Overlay Fix - предотвращение наложения на кнопки */

/* Ограничение z-index для всех элементов календаря */
#clientCalendar,
#clientCalendar *,
.fc,
.fc *,
.fc-view-harness,
.fc-scroller,
.fc .fc-daygrid-day-frame,
.fc .fc-popover,
.fc .fc-more-popover,
.fc-daygrid-body,
.fc-scrollgrid,
.fc-scrollgrid-sync-table {
    position: relative !important;
    z-index: 1 !important;
}

/* Контейнер календаря - максимальная изоляция */
#clientCalendar {
    contain: layout style paint !important;
    isolation: isolate !important;
    position: relative !important;
    z-index: 1 !important;
}

.client-calendar {
    position: relative;
    z-index: 2;
    max-height: 480px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 16px;
}

/* Белая рамка приложения (Telegram safe area) */
body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.app-container {
    padding-bottom: 120px;
}

/* Контейнер с календарем в booking-config */
.booking-config-container {
    position: relative;
    z-index: 1;
    padding-bottom: 140px !important;
    overflow-x: hidden;
}

/* Панель кнопок управления записью - максимальный приоритет */
.actions-panel {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    padding: 16px !important;
    padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
    z-index: 99999 !important;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1) !important;
    isolation: isolate !important;
}

/* Секция даты и времени - ограничение высоты */
.datetime-section {
    position: relative;
    z-index: 3;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

/* Список слотов времени - позиционирование */
.timeslots-section {
    position: relative;
    z-index: 4;
    margin-top: 12px;
}

#timeSlots,
#timeSlotsList {
    position: relative;
    z-index: 4;
}

/* Выбранное время - поверх календаря и слотов */
.selected-panel {
    position: relative;
    z-index: 10;
}

/* Секция пожеланий - после всех элементов */
.notes-section {
    position: relative;
    z-index: 5;
}

/* Легенда календаря - поверх календаря */
.calendar-legend {
    position: relative;
    z-index: 5;
}

/* Индикатор загрузки слотов */
.loading-slots {
    position: relative;
    z-index: 6;
}

/* Индикатор ошибки */
.error-indicator {
    position: relative;
    z-index: 8;
}

