@import url('./main-layout.css');

/* Главный контейнер сетки */
.booking-grid {
    display: grid;
    overflow: auto;
    border: 1px solid #ddd;
    background-color: #f5f5f5;
    /* Фиксируем: первая строка 50px, остальные по 40px (как вы просили тоньше) */
    grid-template-rows: 50px repeat(auto-fill, 40px);
    gap: 1px;
    position: relative;
    height: 100%;
}

.booking-item:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* УГОЛ (Месяц) — Самый высокий приоритет */
.grid-header-corner {
    position: sticky !important;
    top: 0;
    left: 0;
    z-index: 1000; /* Выше всех */
    background: white !important;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
    border-right: 2px solid #bbb;
    border-bottom: 2px solid #bbb;
    box-sizing: border-box;
}

/* ДНИ (Шапка) */
.day-header {
    position: sticky !important;
    top: 0;
    z-index: 900;
    background: #f8f9fa !important;
    height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.85em;
    font-weight: bold;
    border-bottom: 2px solid #bbb;
    box-sizing: border-box;
}

/* НОМЕРА КОМНАТ (Левая колонка) */
.room-label {
    position: sticky !important;
    left: 0;
    z-index: 800; /* Ниже шапки, но выше броней */
    background-color: white !important;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.1em;
    color: #2c3e50;
    border-right: 2px solid #bbb;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
    /* Тень помогает визуально отделить фиксированную колонку */
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}

/* Элемент бронирования */
.booking-item {
    color: white;
    border-radius: 4px;
    margin: 2px 2px;
    height: 36px; /* Чуть меньше высоты строки 40px */
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 1.0em;
    font-weight: 600;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 10;
    transition: transform 0.1s;
}

.booking-item:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

/* Поднимаем все диалоги выше sticky-элементов календаря */
vaadin-dialog-overlay {
    z-index: 9999 !important;
}

/* Если кнопки или части диалога всё еще под липкой колонкой */
.calendar-view-container {
    /* Ограничиваем уровень календаря, чтобы он не перекрывал оверлеи */
    isolation: isolate;
}