/* ============================================================
   Glider Booking – front-end styles  (responsive)
   ============================================================ */

#gb-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 4px;
    box-sizing: border-box;
}

/* ---- Card ---- */
.gb-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}

.gb-card h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: #1a237e;
    border-bottom: 2px solid #e8eaf6;
    padding-bottom: 10px;
}

/* ---- Form ---- */
.gb-form-row { margin-bottom: 14px; }

.gb-form-row label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #37474f;
}

.gb-form-row select,
.gb-form-row input[type="date"],
.gb-form-row input[type="time"],
.gb-form-row input[type="tel"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #b0bec5;
    border-radius: 5px;
    font-size: 1rem;           /* 1rem évite le zoom auto sur iOS */
    box-sizing: border-box;
    transition: border-color .2s;
    -webkit-appearance: none;
    appearance: none;
    background: #fff;
}

.gb-form-row select:focus,
.gb-form-row input:focus {
    outline: none;
    border-color: #1565c0;
    box-shadow: 0 0 0 2px rgba(21,101,192,.2);
}

/* Date + heure côte à côte */
.gb-dt-inputs {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.gb-dt-inputs input[type="date"] { flex: 1 1 0; min-width: 0; }
.gb-dt-inputs input[type="time"] { flex: 0 0 100px; min-width: 80px; }

/* ---- Boutons ---- */
.gb-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #1565c0;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: background .2s;
    box-sizing: border-box;
}
.gb-btn:hover  { background: #0d47a1; }
.gb-btn-danger { background: #c62828; margin-top: 12px; }
.gb-btn-danger:hover { background: #b71c1c; }

/* ---- Messages ---- */
.gb-msg {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: .875rem;
    min-height: 0;
}
.gb-msg:empty { display: none; }
.gb-msg.success { background: #e8f5e9; color: #2e7d32; }
.gb-msg.error   { background: #ffebee; color: #c62828; }

/* ---- Notice non-connecté ---- */
.gb-notice {
    background: #fff3e0;
    border-left: 4px solid #fb8c00;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: .9rem;
}

/* ---- Popup (desktop : centré / mobile : bottom-sheet) ---- */
.gb-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 16px;
    box-sizing: border-box;
}
.gb-popup[hidden] { display: none; }

.gb-popup-inner {
    background: #fff;
    border-radius: 12px;
    padding: 24px 24px 20px;
    width: 100%;
    max-width: 380px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

.gb-popup-inner h4 {
    margin: 0 28px 12px 0;
    color: #1a237e;
    font-size: 1rem;
    line-height: 1.4;
}

.gb-popup-inner p {
    margin: 6px 0;
    font-size: .9rem;
}

.gb-popup-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 30px; height: 30px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    color: #444;
    padding: 0;
}
.gb-popup-close:hover { background: #e0e0e0; }

/* ---- FullCalendar overrides ---- */
#gb-calendar {
    --fc-border-color: #e0e0e0;
    --fc-today-bg-color: #e8f0fe;
    --fc-event-border-color: transparent;
    --fc-small-font-size: .8em;
    font-size: .85rem;
    width: 100%;
    min-width: 0;
}

/* Empêche le calendrier de déborder sur son conteneur */
.fc {
    width: 100% !important;
    overflow: hidden;
}

/* Réduit le padding des cellules pour gagner de la place */
.fc .fc-daygrid-day-frame { min-height: 40px; }
.fc .fc-daygrid-event     { font-size: .75rem; padding: 1px 3px; }

/* Toolbar : empêche le titre de déborder */
.fc .fc-toolbar-title {
    font-size: 1rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* ============================================================
   MOBILE  ≤ 600 px
   ============================================================ */
@media (max-width: 600px) {

    #gb-wrap { padding: 0; }

    .gb-card { padding: 14px 12px; border-radius: 6px; }

    /* Formulaire : champ date + heure empilés sur très petit écran */
    .gb-dt-inputs { flex-direction: column; gap: 6px; }
    .gb-dt-inputs input[type="date"],
    .gb-dt-inputs input[type="time"] { flex: none; width: 100%; }

    /* FullCalendar – vue liste par défaut : géré en JS
       mais on optimise aussi la vue grille si l'user la choisit */
    .fc .fc-toolbar { flex-direction: column; gap: 6px; align-items: stretch; }
    .fc .fc-toolbar-chunk { display: flex; justify-content: center; }
    .fc .fc-toolbar-title { max-width: 100%; font-size: .95rem !important; }

    /* Boutons de navigation plus grands pour le touch */
    .fc .fc-button {
        padding: 6px 10px !important;
        font-size: .8rem !important;
    }

    /* Cellules de grille plus compactes */
    .fc .fc-daygrid-day-frame { min-height: 32px; }
    .fc .fc-col-header-cell-cushion { font-size: .75rem; padding: 4px 2px; }
    .fc .fc-daygrid-day-number { font-size: .75rem; padding: 2px 4px; }

    /* Événements dans la grille : texte tronqué */
    .fc .fc-daygrid-event .fc-event-title { 
        overflow: hidden; 
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }

    /* Vue liste : plus lisible sur mobile */
    .fc .fc-list-event-title  { font-size: .85rem; }
    .fc .fc-list-event-time   { font-size: .8rem; white-space: nowrap; }
    .fc .fc-list-day-cushion  { padding: 6px 10px; }

    /* Popup : bottom-sheet sur mobile */
    .gb-popup {
        align-items: flex-end;
        padding: 0;
    }
    .gb-popup-inner {
        border-radius: 16px 16px 0 0;
        max-width: 100%;
        width: 100%;
        padding: 20px 20px 32px;
        animation: gb-slide-up .22s ease;
    }
}

@keyframes gb-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* ============================================================
   Tablette  601 – 768 px
   ============================================================ */
@media (min-width: 601px) and (max-width: 768px) {
    .fc .fc-toolbar-title { max-width: 200px; font-size: .95rem !important; }
    .fc .fc-button { padding: 5px 8px !important; font-size: .8rem !important; }
    .fc .fc-daygrid-event { font-size: .78rem; }
}
