/* ============================================================
   public-salles.css — Styles spécifiques à /public/salles
   Requiert public-shared.css
   ============================================================ */

/* ===== FILTRE BAR LAYOUT ===== */
.filter-bar {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
}
.filter-search-wrap {
    position: relative;
    flex: 0 0 200px !important;
}
.filter-search-wrap i {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    font-size: 0.85em;
    pointer-events: none;
}
.filter-bar input[type="text"] {
    padding-left: 30px !important;
    display: inline-block !important;
}
.filter-bar select {
    flex: 0 0 auto !important;
    display: inline-block !important;
    width: auto !important;
    cursor: pointer;
    color: #444;
}
.filter-count-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 0;
}
.filter-count-row .count-label {
    font-size: 0.88em;
    font-weight: 600;
    color: var(--pub-dark);
}

/* ===== GRILLE DE SALLES ===== */
.salles-grid-inner {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px;
    margin-top: 28px;
}
@media (max-width: 1024px) { .salles-grid-inner { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 640px)  { .salles-grid-inner { grid-template-columns: 1fr !important; } }

/* ===== SALLE CARD ===== */
.salle-card {
    background: var(--pub-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    transition: transform 0.18s, box-shadow 0.18s;
    display: flex !important;
    flex-direction: column !important;
    cursor: pointer;
}
.salle-card.salle-hidden { display: none !important; }
.salle-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
.salle-card:hover .salle-card-body h3 { color: var(--pub-accent); }

/* Image / Carousel */
.salle-card-img {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: linear-gradient(135deg, #2c3e50 0%, #3d6b8a 100%);
}
.salle-card-img img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform 0.4s ease;
}
.salle-card:hover .salle-card-img img { transform: scale(1.05); }
.salle-card-img::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 55%);
    pointer-events: none;
}
.salle-card-img .img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.8em; font-weight: 800;
    color: rgba(255,255,255,0.35); letter-spacing: -2px;
}

/* Carousel buttons */
.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    background: rgba(0,0,0,0.45); color: #fff; border: none; border-radius: 50%;
    width: 30px; height: 30px; font-size: 16px; line-height: 1;
    cursor: pointer; display: none; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.carousel-btn:hover { background: rgba(0,0,0,0.7); }
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }
.salle-card:hover .carousel-btn { display: flex; }
.carousel-dots {
    position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
    z-index: 3; display: flex; gap: 5px;
}
.carousel-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,0.5); transition: background 0.15s;
}
.carousel-dot.active { background: #fff; }

/* Badges sur image */
.badge-type {
    position: absolute; top: 12px; left: 12px; z-index: 2;
    font-size: 11px; font-weight: 700; padding: 4px 11px;
    border-radius: 20px; text-transform: uppercase; letter-spacing: 0.06em;
}
.badge-type.salle       { background: #3498db; color: #fff; }
.badge-type.lieu_public { background: #27ae60; color: #fff; }
.badge-type.vehicule    { background: #f39c12; color: #fff; }
.badge-type.equipement  { background: #8e44ad; color: #fff; }
.badge-cap {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    background: rgba(0,0,0,0.52); color: #fff;
    font-size: 12px; font-weight: 600; padding: 4px 10px;
    border-radius: 20px; display: flex; align-items: center; gap: 5px;
}

/* Card body */
.salle-card-body { padding: 20px 22px 0; flex: 1; }
.salle-card-body h3 {
    font-size: 16px; font-weight: 700; margin: 0 0 2px;
    color: var(--pub-text); line-height: 1.35; transition: color 0.2s ease;
}
.salle-card-desc {
    font-size: 13px; color: #777; line-height: 1.6; margin: 8px 0 14px;
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
}
.salle-card-equip { display: flex !important; flex-wrap: wrap !important; gap: 6px; margin-bottom: 16px; }
.equip-tag {
    font-size: 12px; background: var(--pub-grey-bg); color: var(--pub-dark);
    border-radius: 6px; padding: 4px 10px; display: flex; align-items: center; gap: 5px;
}

/* Card footer */
.salle-card-footer { padding: 0 22px 22px; }
.btn-demander {
    display: block;
    width: 100%;
    padding: 12px;
    text-align: center;
    justify-content: center;
}

/* ===== BOOKING MODAL ===== */
.bm-dialog { max-width: 1020px; width: 96vw; }
.bm-content {
    border-radius: 20px !important;
    overflow: hidden;
    border: none !important;
    box-shadow: 0 24px 80px rgba(0,0,0,0.18) !important;
    max-height: 92vh;
    overflow-y: auto !important;
}
.bm-inner { padding: 36px 40px 40px; background: var(--pub-card); position: relative; }
.bm-close {
    position: absolute; top: 20px; right: 24px;
    background: none; border: none; font-size: 22px; color: #bbb;
    cursor: pointer; line-height: 1; z-index: 10;
}
.bm-close:hover { color: var(--pub-dark); }
.bm-header { margin-bottom: 28px; }
.bm-header-type {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--pub-accent); margin-bottom: 8px;
}
.bm-header-type i { font-size: 11px; }
.bm-header h2 { font-size: 26px; font-weight: 800; color: var(--pub-text); margin: 0 0 6px; }
.bm-header p  { font-size: 14px; color: var(--pub-muted); margin: 0; line-height: 1.5; }

.bm-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 36px; }
@media (max-width: 640px) { .bm-grid { grid-template-columns: 1fr; } }

/* Colonne image */
.bm-img {
    width: 100%; height: 260px;
    object-fit: cover; border-radius: 16px;
    display: block; margin-bottom: 18px;
}
.bm-img-placeholder {
    width: 100%; height: 260px; border-radius: 16px;
    background: linear-gradient(135deg, #2c3e50, #3d6b8a);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5em; color: rgba(255,255,255,0.35); margin-bottom: 18px;
}
.bm-img-wrap-inner { position: relative; margin-bottom: 18px; }
.bm-img-wrap-inner img.bm-img { margin-bottom: 0; }
.bm-info-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 15px; border-radius: 12px;
    background: #f5f4f1; margin-bottom: 10px;
    font-size: 13px; color: #333;
}
.bm-info-row i { font-size: 13px; color: var(--pub-accent); width: 16px; text-align: center; flex-shrink: 0; }
.bm-info-row--column { flex-direction: column; align-items: flex-start; }
.bm-info-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bm-info-header i { color: var(--pub-accent); width: 16px; text-align: center; }
.bm-info-header-title { font-size: 13px; font-weight: 600; }
.bm-info-content { padding-left: 26px; }
.bm-equip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.bm-equip-tag { font-size: 11px; background: #eae8e4; color: var(--pub-dark); border-radius: 5px; padding: 3px 9px; }
#modal-desc { line-height: 1.5; color: #555; }
.bm-adresse-link { color: var(--pub-accent); text-decoration: none; line-height: 1.4; }
.bm-adresse-link:hover { text-decoration: underline; }
#modal-docs { display: flex; flex-direction: column; gap: 6px; }
#modal-docs a { font-size: 13px; color: var(--pub-accent); text-decoration: none; }
#modal-docs a i { margin-right: 5px; }

/* Carousel modal */
.bm-car-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.45); color: #fff; border: none; cursor: pointer;
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; line-height: 1; transition: background .2s; z-index: 5;
}
.bm-car-btn:hover { background: rgba(0,0,0,0.7); }
.bm-car-btn.prev { left: 10px; }
.bm-car-btn.next { right: 10px; }
.bm-car-dots { display: flex; justify-content: center; gap: 5px; margin-top: 8px; }
.bm-car-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #ccc; cursor: pointer; transition: background .2s;
}
.bm-car-dot.active { background: var(--pub-accent); }

/* Mini calendrier modal */
/* ===== MINI-CALENDRIER MENSUEL ===== */
.bm-cal {
    border: 1.5px solid #eceae6; border-radius: 16px;
    overflow: hidden; margin-bottom: 16px; background: var(--pub-card);
}
.bm-cal-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: #f3f4f6; border-bottom: 1px solid #d1d5db;
}
.bm-cal-nav span { font-size: 13px; font-weight: 700; color: var(--pub-text); }
.bm-cal-nav button {
    background: none; border: none; cursor: pointer;
    color: var(--pub-muted); font-size: 17px; padding: 2px 7px; border-radius: 6px; line-height: 1;
}
.bm-cal-nav button:hover { background: #eee; color: #333; }
.bm-cal-grid { padding: 10px 12px 12px; }
.bm-cal-dow { display: grid; grid-template-columns: repeat(7,1fr); margin-bottom: 4px; }
.bm-cal-dow span {
    text-align: center; font-size: 10px; font-weight: 700;
    color: #6b7280; padding: 3px 0; text-transform: uppercase;
}
.bm-cal-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.bm-cal-day {
    text-align: center; font-size: 12px; padding: 6px 2px;
    border-radius: 6px; cursor: pointer; color: #333;
    transition: background 0.15s, color 0.15s; user-select: none;
}
.bm-cal-day:hover:not(.bm-cal-empty):not(.bm-cal-disabled) { background: #fdf0e0; color: var(--pub-accent); }
.bm-cal-day.bm-cal-disabled { color: #c4c8d0; cursor: not-allowed; }
.bm-cal-day.bm-cal-blocked { background: #e5e7eb; color: #6b7280; cursor: not-allowed; }
.bm-cal-day.bm-cal-empty { cursor: default; }
.bm-cal-day.bm-cal-selected { background: var(--pub-accent) !important; color: #fff !important; font-weight: 700; }

/* ===== VUE SEMAINE (RESA-159) ===== */

/* Section vue semaine (conteneur) */
.bw-section {
    border: 1.5px solid #eceae6; border-radius: 14px;
    overflow: hidden; margin-top: 28px; margin-bottom: 16px; background: #fafaf8;
}
.bw-section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: #f3f4f6; border-bottom: 1px solid #d1d5db;
    gap: 8px; flex-wrap: wrap;
}
.bw-section-title {
    display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0;
    font-size: 12px; font-weight: 700; color: var(--pub-text);
}
.bw-section-icon { color: var(--pub-accent); font-size: 12px; }
.bw-section-nav { display: flex; gap: 4px; align-items: center; }
.bw-legend { padding: 6px 12px 10px; display: flex; gap: 12px; flex-wrap: wrap; }

/* Navigation semaine */
.bw-nav {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 12px; flex-wrap: wrap;
}
.bw-nav-btn {
    background: none; border: 1.5px solid #e5e2dd; cursor: pointer;
    color: var(--pub-muted); font-size: 17px; padding: 4px 10px;
    border-radius: 8px; line-height: 1; transition: background 0.15s, color 0.15s;
    font-family: inherit;
}
.bw-nav-btn:hover { background: #fdf0e0; color: var(--pub-accent); border-color: var(--pub-accent); }
.bw-today-btn { font-size: 12px; font-weight: 600; padding: 5px 10px; }
.bw-nav-center {
    flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
}
#bw-title {
    font-size: 13px; font-weight: 700; color: var(--pub-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bw-datepicker {
    border: 1.5px solid #e5e2dd; border-radius: 8px; padding: 4px 8px;
    font-size: 12px; color: #555; background: var(--pub-card); cursor: pointer;
    outline: none; font-family: inherit;
}
.bw-datepicker:focus { border-color: var(--pub-accent); }

/* Chargement */
.bw-loading {
    text-align: center; padding: 24px; color: var(--pub-muted);
    font-size: 13px;
}

/* Grille semaine */
.bw-grid-wrap {
    min-height: 300px;
    border-bottom: 1px solid #eceae6;
}
.bw-grid {
    display: grid;
    grid-template-columns: 44px repeat(7, 1fr);
    min-width: 0;
}

/* En-têtes jours */
.bw-corner { background: #f3f4f6; border-bottom: 2px solid #d1d5db; }
.bw-day-header {
    background: #f3f4f6; border-bottom: 2px solid #d1d5db;
    border-left: 1px solid #d1d5db;
    text-align: center; padding: 8px 2px; user-select: none;
}
.bw-day-header .bw-dow {
    font-size: 10px; font-weight: 700; color: #6b7280;
    text-transform: uppercase; letter-spacing: 0.04em; display: block;
}
.bw-day-header .bw-dnum {
    font-size: 14px; font-weight: 700; color: var(--pub-text); display: block;
}
.bw-day-header.bw-today .bw-dnum {
    background: var(--pub-accent); color: #fff;
    border-radius: 50%; width: 24px; height: 24px;
    line-height: 24px; margin: 0 auto;
}
.bw-day-header.bw-past { opacity: 0.4; }

/* Label heure */
.bw-time-label {
    font-size: 10px; color: #9ca3af; text-align: right;
    padding: 0 6px 0 0; line-height: 1; border-right: 1px solid #d1d5db;
    display: flex; align-items: flex-start; padding-top: 2px;
    user-select: none;
}
.bw-time-label.bw-hour-label { font-weight: 700; color: #4b5563; }

/* Cellule slot */
.bw-slot {
    height: 20px; border-left: 1px solid #eceae6;
    border-bottom: 1px solid #f5f3f0;
    box-sizing: border-box; transition: background 0.1s;
}
/* Séparateur heure entière plus visible */
.bw-slot.bw-hour-top { border-bottom-color: #9ca3af; }
.bw-slot--available {
    background: #86efac; cursor: default;
}
.bw-slot--available:hover { background: #4ade80; }
.bw-slot--occupied {
    background: repeating-linear-gradient(
        45deg, #f87171, #f87171 3px, #fca5a5 3px, #fca5a5 8px
    );
    cursor: not-allowed;
}
.bw-slot--closed {
    background: #d1d5db; cursor: not-allowed;
}
.bw-slot--past {
    background: #d1d5db; opacity: 0.6; cursor: not-allowed;
}
/* Légende */
.bw-legend {
    display: flex; gap: 14px; flex-wrap: wrap;
}
.bw-legend-item {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: var(--pub-muted);
}
.bw-legend-item::before {
    content: ''; display: inline-block;
    width: 12px; height: 12px; border-radius: 3px;
}
.bw-legend-available::before { background: #86efac; border: 1.5px solid #4ade80; }
.bw-legend-occupied::before  {
    background: repeating-linear-gradient(45deg,#f87171,#f87171 3px,#fca5a5 3px,#fca5a5 8px);
    border: 1.5px solid #ef4444;
}
.bw-legend-closed::before { background: #d1d5db; border: 1.5px solid #9ca3af; }

/* Mode journée — grille sans colonne d'heure, cellule pleine hauteur */
.bw-grid--daily { grid-template-columns: repeat(7, 1fr); }
.bw-slot--day { height: 72px; }

/* Sélection horaire */
.bm-time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.bm-label { font-size: 13px; font-weight: 600; color: var(--pub-text); display: block; margin-bottom: 6px; }
.bm-select {
    width: 100%; border: 1.5px solid #e5e2dd; border-radius: 10px;
    padding: 11px 14px; font-size: 14px; background: var(--pub-card);
    outline: none; color: #333; cursor: pointer; appearance: auto;
}
.bm-select:focus { border-color: var(--pub-accent); box-shadow: 0 0 0 3px rgba(228,147,56,0.1); }

.bm-recap {
    background: #fdf8f2; border: 1.5px solid #f0e8d8;
    border-radius: 14px; padding: 18px; margin-bottom: 18px;
}
.bm-recap-title { font-size: 14px; font-weight: 700; color: var(--pub-text); margin: 0 0 14px; }
.bm-recap-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #666; margin-bottom: 8px; }
.bm-recap-row i { color: var(--pub-accent); }

#btn-confirmer {
    width: 100%; padding: 15px;
    background: linear-gradient(135deg, var(--pub-accent), #f5a623);
    color: #fff; border: none; border-radius: 12px;
    font-weight: 800; font-size: 15px; cursor: pointer;
    transition: box-shadow 0.2s, opacity 0.2s; letter-spacing: 0.01em;
    font-family: inherit;
}
#btn-confirmer:disabled { opacity: 0.4; cursor: not-allowed; }
#btn-confirmer:not(:disabled):hover { box-shadow: 0 0 28px rgba(228,147,56,0.45); }

/* Hint sous le bouton Confirmer */
#btn-hint {
    min-height: 18px;
    font-size: 12px;
    color: #888;
    text-align: center;
    margin-top: 8px;
}

/* Pill de guidage contextuel au-dessus du calendrier */
.cal-hint {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    transition: background 0.25s, color 0.25s;
}
.cal-hint--pending {
    background: #fff4e6;
    color: var(--pub-accent);
    border: 1.5px solid #f5d29a;
    animation: hint-pulse 2s ease-in-out infinite;
}
.cal-hint--action {
    background: #fff4e6;
    color: var(--pub-accent);
    border: 1.5px solid #f5d29a;
    animation: none;
}
.cal-hint--ready {
    background: #eafaf1;
    color: #27ae60;
    border: 1.5px solid #a9dfbf;
    animation: none;
}
@keyframes hint-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

/* Plage de dates (mode journée) */
.bm-cal-day.bm-cal-in-range {
    background: #fdebc8;
    border-radius: 0;
    color: #7a5000;
}
.bm-cal-day.bm-cal-range-end {
    background: var(--pub-accent) !important;
    color: #fff !important;
    font-weight: 700;
}
