/* =====================================================
   booking15a_grid.css — Calendar grid view (backoffice style)
   Requires booking15a.css loaded first (modals, forms, toasts)
   ===================================================== */

/* ---------- Root overrides for grid mode ---------- */
.b15a-root--grid {
    max-width: 1200px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border: none;
    color: #fff;
}

/* ---------- Header overrides for grid ---------- */
.b15a-root--grid .b15a-header {
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.b15a-root--grid .b15a-header__title {
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,.3);
}

/* ---------- Event type cards (top bar, draggable) ---------- */
.b15a-etype-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    align-items: center;
}
.b15a-etype-card {
    position: relative;
    backdrop-filter: blur(10px);
    background: linear-gradient(to right, rgba(255,255,255,0.55), rgba(255,255,255,0.08) 21%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(0,0,0,.25), 0 8px 10px rgba(0,0,0,.18);
    padding: 10px 18px 10px 22px;
    min-width: 140px;
    height: 56px;
    display: flex;
    align-items: center;
    cursor: grab;
    user-select: none;
    transition: transform .15s ease, box-shadow .15s ease;
    color: #fff;
    font-weight: 600;
    font-size: .88rem;
    font-family: var(--b15a-font);
}
.b15a-etype-card::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.4);
    border-left: 7px solid var(--etype-color, #667eea);
    pointer-events: none;
}
.b15a-etype-card:active {
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 0 16px 36px rgba(0,0,0,.35);
}
.b15a-etype-card.b15a-dragging {
    opacity: .5;
}
.b15a-etype-card__price {
    margin-left: auto;
    font-size: .78rem;
    opacity: .7;
    padding-left: 12px;
}

/* ---------- Date navigation (glass bar) ---------- */
.b15a-grid-datebar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 12px 20px;
    backdrop-filter: blur(10px);
    background: linear-gradient(to right, rgba(255,255,255,0.55), rgba(255,255,255,0.08) 21%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(0,0,0,.2);
    margin: 0 20px 16px;
    flex-wrap: wrap;
}
.b15a-grid-datebar__btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 10px;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background .15s;
}
.b15a-grid-datebar__btn:hover { background: rgba(255,255,255,.22); }
.b15a-grid-datebar__label {
    font-weight: 600;
    font-size: .95rem;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,.4);
    min-width: 180px;
    text-align: center;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background .15s;
}
.b15a-grid-datebar__label:hover { background: rgba(255,255,255,.1); }
.b15a-grid-datebar__today {
    font-size: .78rem;
    padding: 5px 14px;
    border-radius: 8px;
    background: var(--b15a-primary, #667eea);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background .15s;
}
.b15a-grid-datebar__today:hover { background: var(--b15a-primary-hover, #5a6fd6); }
.b15a-root--grid .b15a-datepicker__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ---------- Calendar grid (terrain columns) ---------- */
.b15a-grid-container {
    display: flex;
    gap: 10px;
    padding: 0 20px 16px;
    max-height: 640px;
    overflow: auto;
    align-items: flex-start;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.2) transparent;
}
.b15a-grid-col {
    position: relative;
    flex: 1 0 160px;
    min-width: 160px;
    max-width: 260px;
    backdrop-filter: blur(10px);
    background: linear-gradient(to right, rgba(255,255,255,0.55), rgba(255,255,255,0.08) 21%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(0,0,0,.2), 0 8px 10px rgba(0,0,0,.15);
    /* clip (et non hidden) : ne crée pas de conteneur de scroll, l'en-tête sticky reste actif */
    overflow: clip;
    display: flex;
    flex-direction: column;
}
.b15a-grid-col::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.4);
    pointer-events: none;
}
.b15a-grid-col__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    position: sticky;
    top: 0;
    z-index: 5;
    background: #222b4a;
    border-radius: 16px 16px 0 0;
}
.b15a-grid-col__sport-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    min-width: 36px;
    background: rgba(255,255,255,.15);
    border-radius: 50%;
    font-size: .75rem;
    color: #fff;
    text-transform: uppercase;
    font-weight: 700;
}
.b15a-grid-col__name {
    margin: 0;
    font-size: .88rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Hour slots ---------- */
.b15a-grid-slots {
    position: relative;
    flex: 1;
    min-height: 100px;
}
.b15a-grid-slot {
    height: 36px;
    border-top: 1px solid rgba(255,255,255,.12);
    position: relative;
    display: flex;
    align-items: center;
    transition: background .12s;
}
.b15a-grid-slot:first-child { border-top: none; }
.b15a-grid-slot--free {
    cursor: pointer;
}
.b15a-grid-slot--free:hover {
    background: rgba(255,255,255,.08);
}
.b15a-grid-slot--free.b15a-drop-target {
    background: rgba(102,126,234,.25);
    box-shadow: inset 0 0 0 2px var(--b15a-primary, #667eea);
}
.b15a-grid-slot__time {
    position: absolute;
    top: 10px;
    left: 8px;
    font-size: .7rem;
    color: rgba(255,255,255,.5);
    user-select: none;
    z-index: 1;
    pointer-events: none;
}
.b15a-grid-slot--past {
    opacity: .35;
    cursor: default;
}
.b15a-grid-slot--peak {
    background: rgba(231, 76, 60, .12);
}
.b15a-grid-slot--free.b15a-grid-slot--peak:hover {
    background: rgba(231, 76, 60, .22);
}
.b15a-grid-slot--peak .b15a-grid-slot__time {
    color: #ff9b8f;
}

/* ---------- Peak hours legend ---------- */
.b15a-grid-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -4px 20px 12px;
    font-size: .75rem;
    color: rgba(255,255,255,.65);
}
.b15a-grid-legend__swatch {
    width: 14px; height: 14px;
    border-radius: 4px;
    background: rgba(231, 76, 60, .35);
    border: 1px solid rgba(255, 155, 143, .6);
}

/* ---------- Busy event cards (positioned) ---------- */
.b15a-grid-event {
    position: absolute;
    left: 4px; right: 4px;
    border-radius: 10px;
    border-left: 5px solid var(--evt-color, #667eea);
    border-top: 1px solid rgba(255,255,255,.3);
    border-right: 1px solid rgba(255,255,255,.2);
    border-bottom: 2px solid rgba(255,255,255,.15);
    backdrop-filter: blur(8px);
    background: linear-gradient(to right, rgba(255,255,255,.45), rgba(255,255,255,.06) 60%);
    box-shadow: 3px 3px 6px rgba(0,0,0,.25);
    padding: 4px 8px;
    overflow: hidden;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    pointer-events: none;
}
.b15a-grid-event__name {
    font-size: .72rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.b15a-grid-event__time {
    font-size: .65rem;
    color: rgba(255,255,255,.7);
}

/* ---------- Current time indicator ---------- */
.b15a-grid-now {
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    z-index: 3;
    box-shadow: 0 0 4px 2px #03c700, 0 0 10px rgba(0,8,255,.5);
    background: #03c700;
    pointer-events: none;
}

/* ---------- Loading overlay for grid ---------- */
.b15a-grid-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255,255,255,.6);
    font-size: .95rem;
    flex-direction: column;
    gap: 12px;
}
.b15a-grid-loading .b15a-loading__spinner {
    border-color: rgba(255,255,255,.15);
    border-top-color: #fff;
}

/* ---------- Grid footer ---------- */
.b15a-root--grid .b15a-footer {
    background: transparent;
    border-top: 1px solid rgba(255,255,255,.08);
    color: rgba(255,255,255,.4);
}
.b15a-root--grid .b15a-footer a {
    color: rgba(255,255,255,.6);
}

/* ---------- Grid empty state ---------- */
.b15a-grid-empty {
    padding: 40px 20px;
    text-align: center;
    color: rgba(255,255,255,.5);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .b15a-etype-bar { gap: 8px; padding: 12px 14px; }
    .b15a-etype-card { min-width: 110px; height: 46px; font-size: .8rem; padding: 8px 12px 8px 16px; }
    .b15a-grid-datebar { margin: 0 14px 12px; gap: 8px; }
    .b15a-grid-container { padding: 0 14px 14px; }
    .b15a-grid-col { flex: 1 0 140px; min-width: 140px; }
}
@media (max-width: 480px) {
    .b15a-grid-col { flex: 0 0 128px; min-width: 128px; }
    .b15a-grid-col__header { padding: 10px; gap: 6px; }
    .b15a-grid-col__sport-icon { width: 28px; height: 28px; min-width: 28px; font-size: .65rem; }
    .b15a-grid-container { gap: 8px; padding: 0 10px 12px; max-height: 520px; }
    .b15a-grid-datebar { margin: 0 10px 12px; }
    .b15a-etype-bar { flex-direction: column; align-items: stretch; }
    .b15a-etype-card { width: 100%; }
}
