/* Fenêtre de réservation partagée : tableau des terrains et « Proposer une session » (liste des joueurs). */
/* ================= Modal ================= */
.hidden{ display:none !important; }

.booking-modal{
    position:fixed;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:16px;
    background:rgba(15,23,42,.55);
    backdrop-filter:blur(4px);
    z-index:1000;
}

.booking-modal .modal-content{
    width:480px;
    max-width:100%;
    max-height:94vh;
    overflow-y:auto;
    padding:20px 22px;
    background:#fff;
    border-radius:20px;
    box-shadow:0 25px 60px rgba(0,0,0,.25);
}

.booking-modal .modal-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:14px;
    padding-bottom:10px;
    border-bottom:1px solid #eef2f7;
}
.booking-modal .modal-header h3{ margin:0; font-size:1.15rem; color:#111827; }
.booking-modal .modal-subtitle{ display:none; }

.booking-modal .close-btn{
    width:34px; height:34px;
    border:none; border-radius:50%;
    background:#f3f4f6; color:#475569;
    cursor:pointer; transition:.2s;
}
.booking-modal .close-btn:hover{ background:#fee2e2; color:#dc2626; }

/* ---------- Grille ---------- */
.booking-modal .booking-grid{
    display:grid;
    grid-template-columns:repeat(6, minmax(0,1fr));
    gap:12px;
}
.booking-modal .span-3{ grid-column:span 3; }
.booking-modal .span-2{ grid-column:span 2; }
.booking-modal .full{ grid-column:1 / -1; }

.booking-modal .form-group{ margin:0; min-width:0; }

.booking-modal .form-group > label{
    display:block;
    margin:0 0 4px;
    font-size:.72rem;
    font-weight:700;
    color:#475569;
    text-transform:uppercase;
    letter-spacing:.03em;
}

.booking-modal input[type="date"],
.booking-modal input[type="time"],
.booking-modal select{
    width:100%;
    height:38px;
    padding:0 10px;
    border:1px solid #e5e7eb;
    border-radius:10px;
    background-color:#f8fafc;
    font-size:.9rem;
    color:#111827;
    box-sizing:border-box;
    transition:.2s;
}

.booking-modal select{
    appearance:none;
    cursor:pointer;
    padding-right:30px;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 10px center;
}

.booking-modal input:hover,
.booking-modal select:hover{ border-color:#16a34a; }

.booking-modal input:focus,
.booking-modal select:focus{
    outline:none;
    border-color:#16a34a;
    background-color:#fff;
    box-shadow:0 0 0 3px rgba(22,163,74,.15);
}

.booking-modal input[readonly]{
    background:#f1f5f9;
    color:#64748b;
    cursor:not-allowed;
}

/* ---------- Format (segmenté) ---------- */
.booking-modal .segmented{
    display:grid;
    grid-template-columns:1fr 1fr;
    padding:3px;
    background:#f1f5f9;
    border-radius:10px;
}
.booking-modal .segmented label{
    position:relative;
    display:block;
    margin:0;
    cursor:pointer;
    text-transform:none;
    letter-spacing:0;
}
.booking-modal .segmented input{
    position:absolute;
    opacity:0;
    width:0; height:0;
    pointer-events:none;
}
.booking-modal .segmented span{
    display:block;
    padding:8px 6px;
    text-align:center;
    font-size:.88rem;
    font-weight:600;
    color:#475569;
    border-radius:8px;
    transition:.15s;
}
.booking-modal .segmented input:checked + span{
    background:#fff;
    color:#16a34a;
    box-shadow:0 1px 4px rgba(0,0,0,.12);
}

/* ---------- Match ouvert (toggle) ---------- */
.booking-modal .switch-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    margin:0;
    padding:10px 12px;
    border:1px solid #e5e7eb;
    border-radius:10px;
    cursor:pointer;
    text-transform:none;
    letter-spacing:0;
}
.booking-modal .switch-row strong{ display:block; font-size:.9rem; color:#111827; }
.booking-modal .switch-row small{ display:block; font-size:.78rem; font-weight:400; color:#64748b; }

.booking-modal .switch{
    appearance:none;
    -webkit-appearance:none;
    flex-shrink:0;
    position:relative;
    width:42px !important;
    height:24px !important;
    padding:0;
    border:none;
    border-radius:999px;
    background:#cbd5e1;
    cursor:pointer;
    transition:.2s;
}
.booking-modal .switch::after{
    content:"";
    position:absolute;
    top:3px; left:3px;
    width:18px; height:18px;
    border-radius:50%;
    background:#fff;
    transition:.2s;
}
.booking-modal .switch:checked{ background:#16a34a; }
.booking-modal .switch:checked::after{ transform:translateX(18px); }

/* ---------- Joueurs ---------- */
.booking-modal .count{ color:#16a34a; text-transform:none; letter-spacing:0; }

.booking-modal .player-add{ display:flex; gap:8px; }
.booking-modal .player-add select{ flex:1; }

.booking-modal .btn-add{
    flex-shrink:0;
    height:38px;
    padding:0 16px;
    border:none;
    border-radius:10px;
    background:#16a34a;
    color:#fff;
    font-weight:600;
    font-size:.9rem;
    cursor:pointer;
}
.booking-modal .btn-add:hover:not(:disabled){ background:#15803d; }
.booking-modal .btn-add:disabled{ opacity:.4; cursor:not-allowed; }

.booking-modal .chips{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.booking-modal .chips:empty{ display:none; }
.booking-modal .chip{
    display:flex;
    align-items:center;
    gap:6px;
    padding:4px 6px 4px 10px;
    background:#f0fdf4;
    border:1px solid #bbf7d0;
    border-radius:999px;
    color:#166534;
    font-size:.82rem;
    font-weight:600;
}
.booking-modal .chip button{
    border:none;
    background:none;
    color:#166534;
    cursor:pointer;
    line-height:1;
}

/* ---------- Actions ---------- */
.booking-modal .modal-actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-top:16px;
    padding-top:14px;
    border-top:1px solid #eef2f7;
}
.booking-modal .btn-secondary,
.booking-modal .btn-auth{
    height:38px;
    padding:0 20px;
    border:none;
    border-radius:10px;
    font-weight:600;
    font-size:.9rem;
    cursor:pointer;
    transition:.2s;
}
.booking-modal .btn-secondary{ background:#f3f4f6; color:#374151; }
.booking-modal .btn-secondary:hover{ background:#e5e7eb; }
.booking-modal .btn-auth{ background:#16a34a; color:#fff; box-shadow:0 4px 12px rgba(22,163,74,.3); }
.booking-modal .btn-auth:hover{ background:#15803d; }

@media (max-width:480px){
    .booking-modal .span-2{ grid-column:span 3; }
    .booking-modal .modal-content{ padding:16px; }
}


/* ================= Modal : compléments ================= */
.booking-modal .modal-subtitle{
    display:block;
    margin:2px 0 0;
    font-size:.82rem;
    color:#64748b;
}

.booking-modal .static-field{
    height:38px;
    display:flex;
    align-items:center;
    padding:0 10px;
    border-radius:10px;
    background:#f1f5f9;
    color:#334155;
    font-size:.9rem;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.booking-modal select option:disabled{ color:#cbd5e1; }

.booking-modal .player-search{ position:relative; }
.booking-modal .player-search input{
    width:100%;
    height:38px;
    padding:0 12px;
    border:1px solid #e5e7eb;
    border-radius:10px;
    background:#f8fafc;
    font-size:.9rem;
    box-sizing:border-box;
}
.booking-modal .player-search input:disabled{ cursor:not-allowed; opacity:.6; }

.booking-modal .player-results{
    position:absolute;
    top:calc(100% + 4px);
    left:0; right:0;
    max-height:220px;
    overflow-y:auto;
    margin:0;
    padding:4px;
    list-style:none;
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:12px;
    box-shadow:0 12px 30px rgba(15,23,42,.15);
    z-index:10;
}
.booking-modal .player-results li{
    display:flex;
    flex-direction:column;
    padding:8px 10px;
    border-radius:8px;
    cursor:pointer;
}
.booking-modal .player-results li strong{ font-size:.9rem; color:#111827; }
.booking-modal .player-results li small{ font-size:.75rem; color:#64748b; }
.booking-modal .player-results li:hover,
.booking-modal .player-results li:focus{ background:#f0fdf4; outline:none; }
.booking-modal .player-results li.empty{ cursor:default; color:#94a3b8; font-size:.85rem; }
.booking-modal .player-results li.empty:hover{ background:none; }

.booking-modal .chip-me{ background:#f1f5f9; border-color:#e2e8f0; color:#475569; padding-right:10px; }

.booking-modal .booking-summary{
    margin-top:14px;
    padding:12px 14px;
    border-radius:12px;
    background:#f0fdf4;
    border:1px solid #bbf7d0;
    color:#166534;
    font-size:.88rem;
    line-height:1.5;
}
.booking-modal .booking-summary:empty{ display:none; }
.booking-modal .booking-summary small{ color:#15803d; }

.booking-modal .btn-auth:disabled{ opacity:.6; cursor:wait; }

/* Neutralise les styles globaux de .btn-auth / .btn-secondary (base_style.css) :
   marge haute, largeur 100 %, padding vertical et effet de survol décalaient les boutons. */
.booking-modal .modal-actions{ align-items:center; }
.booking-modal .modal-actions .btn-secondary,
.booking-modal .modal-actions .btn-auth{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    height:42px;
    margin:0;
    padding:0 20px;
    line-height:1;
    border-radius:10px;
    box-sizing:border-box;
}
.booking-modal .modal-actions .btn-secondary{ flex:0 0 auto; }
.booking-modal .modal-actions .btn-auth{ flex:1 1 auto; width:auto; }
.booking-modal .modal-actions .btn-auth:hover{ transform:none; }

.booking-modal .modal-actions .btn-danger{
    display:inline-flex;
    align-items:center;
    height:42px;
    margin:0 auto 0 0;      /* poussé à gauche */
    padding:0 14px;
    border:1px solid #fecaca;
    border-radius:10px;
    background:#fff;
    color:#b91c1c;
    font-weight:600;
    font-size:.85rem;
    cursor:pointer;
    transition:.2s;
}
.booking-modal .modal-actions .btn-danger:hover{ background:#fef2f2; }
.booking-modal .modal-actions{ flex-wrap:wrap; }


/* Contrôle segmenté à 3 choix dont certains peuvent être masqués (types de session) */
.booking-modal .segmented.three{ grid-template-columns:none; grid-auto-flow:column; grid-auto-columns:1fr; }
.booking-modal .segmented label[hidden]{ display:none; }
.booking-modal .form-group[hidden]{ display:none; }
.booking-modal input[type="date"]{ cursor:pointer; }
