/* ============================================================
   MonNavette Péi — public/css/app.css
   Styles custom front public
   Bootstrap 5.3 chargé via CDN dans le layout Blade
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --blue:       #8b5e3f;
  --dark:       #545E75;
  --light-blue: #A7CCED;
  --white:      #ffffff;
  --bg:         #f5f7fa;
  --text:       #2d3142;
  --text-light: #6b7280;
  --border:     #e0e6ef;
  --green:      #28a745;
  --orange:     #ffc107;
  --red:        #dc3545;
  --shadow:     0 2px 12px rgba(84,94,117,0.10);
  --radius:     10px;
}

/* ── Base ───────────────────────────────────────────────────── */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
a            { color: var(--blue); }
a:hover      { color: #4a9de0; }

/* ── Surcharge couleur primaire Bootstrap ───────────────────── */
.btn-primary         { background-color: #8b5e3f; border-color: #9F704F; color: #fff; }
.btn-primary:hover   { background-color: #6E4A30; border-color: #6E4A30; color: #fff; }
.btn-primary:focus   { box-shadow: 0 0 0 0.2rem rgba(139,94,63,0.35); }
.btn-secondary       { background-color: #e9edf5; border-color: #e9edf5; color: var(--dark); }
.btn-secondary:hover { background-color: #d5dae5; border-color: #d5dae5; color: var(--dark); }
.text-primary        { color: var(--blue) !important; }
.border-primary      { border-color: var(--blue) !important; }
.form-control:focus,
.form-select:focus   { border-color: var(--blue); box-shadow: 0 0 0 0.2rem rgba(99,173,242,0.20); }

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  background: #f7ead7;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1030;
}
.header-logo {
  width: 100px;
  height: 100px;
  background: var(--dark);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.header-logo img { width: 100%; height: 100%; object-fit: cover; }

/* ── Badge ouvert / fermé ───────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.status-badge .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-badge.open   { background: #d4edda; color: #155724; }
.status-badge.open   .dot { background: var(--green); }
.status-badge.closed { background: #f8d7da; color: #721c24; }
.status-badge.closed .dot { background: var(--red); }

/* ── Calendrier ─────────────────────────────────────────────── */
/* ── Calendrier ─────────────────────────────────────────────── */
.calendar-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid #c0c8d8;
}
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 2px solid #c0c8d8;
  flex-wrap: wrap;
  gap: 10px;
}
.calendar-title { font-size: 17px; font-weight: 700; color: var(--dark); }

.view-switcher { display: flex; gap: 4px; background: var(--bg); border-radius: 8px; padding: 4px; }
.view-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-light);
  transition: all .2s;
}
.view-btn.active { background: var(--blue); color: var(--white); font-weight: 600; }

/* ── Grille mois ────────────────────────────────────────────── */
.month-grid { padding: 0; }
.month-header {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  border-bottom: 2px solid #c0c8d8;
}
.month-header-cell {
  padding: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-right: 1px solid #c0c8d8;
}
.month-header-cell:last-child  { border-right: none; }
.month-header-cell:nth-child(6),
.month-header-cell:nth-child(7) { background: #e5e5e5; color: var(--dark); }

.month-body { display: grid; grid-template-columns: repeat(7,1fr); }
.month-day {
  border-right: 1px solid #c0c8d8;
  border-bottom: 1px solid #c0c8d8;
  min-height: 100px;
  padding: 6px;
  cursor: default;
  transition: background .15s;
  overflow: hidden;
  min-width: 0;
}
.month-day:nth-child(7n)        { border-right: none; }
/* Samedi = 6e colonne, Dimanche = 7e colonne */
.month-day:nth-child(7n+6),
.month-day:nth-child(7n)        { background: #e5e5e5; }
.month-day.other-month          { background: #eaeaea; }
/* Samedi/Dimanche autre mois encore plus discret */
.month-day.other-month:nth-child(7n+6),
.month-day.other-month:nth-child(7n) { background: #d8d8d8; }
.month-day.today                { background: #f0f7ff !important; }
.month-day.today .day-number    { color: var(--blue); font-weight: 700; }
.month-day.has-slots:hover      { background: #e8f4fd !important; cursor: pointer; }
.day-number { font-size: 13px; font-weight: 600; color: var(--text-light); margin-bottom: 4px; }
/* ── Pills créneaux (vue mois / semaine) ────────────────────── */
.slot-pill {
  display: block;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 11px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity .15s;
  text-decoration: none;
  position: relative;     
  max-width: 100%;    /* ← ajouter cette ligne */
}
.slot-pill:hover                  { opacity: .85; }
.slot-pill.status-pending         { background: #fff3cd; color: #856404; border-left: 3px solid #ffc107; }
.slot-pill.status-confirmed       { background: #d4edda; color: #155724; border-left: 3px solid #28a745; }
.slot-pill.status-full            { background: #e2e3e5; color: #6c757d; border-left: 3px solid #adb5bd; cursor: not-allowed; }
.slot-pill.status-cancelled       { background: #f8d7da; color: #721c24; border-left: 3px solid #dc3545; cursor: not-allowed; text-decoration: line-through; }
.more-slots                       { font-size: 11px; color: var(--blue); cursor: pointer; }

/* ── Carte créneau (vue jour) ───────────────────────────────── */
.slot-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: box-shadow .2s;
  cursor: pointer;
  background: var(--white);
  text-decoration: none;
  color: inherit;
}
.slot-card:hover                  { box-shadow: var(--shadow); color: inherit; }
.slot-card.status-full,
.slot-card.status-cancelled       { opacity: .6; cursor: default; pointer-events: none; }
.slot-card .slot-time             { font-size: 16px; font-weight: 700; color: var(--dark); }
.slot-card .slot-route            { font-size: 14px; color: var(--text-light); margin-top: 2px; }
.slot-card .seats-info            { font-size: 13px; color: var(--text-light); }

/* ── Badges statut ──────────────────────────────────────────── */
.badge-pending   { background: #fff3cd; color: #856404; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; display: inline-block; }
.badge-confirmed { background: #d4edda; color: #155724; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; display: inline-block; }
.badge-full      { background: #e2e3e5; color: #6c757d; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; display: inline-block; }
.badge-cancelled { background: #f8d7da; color: #721c24; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; display: inline-block; }

/* ── Tunnel de réservation — étapes ─────────────────────────── */
.booking-steps {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
}
.booking-steps .step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-light);
}
.booking-steps .step-number {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-light);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.booking-steps .step.active              { color: var(--blue); font-weight: 600; }
.booking-steps .step.active .step-number { background: var(--blue); color: var(--white); }
.booking-steps .step.done                { color: var(--green); }
.booking-steps .step.done .step-number   { background: var(--green); color: var(--white); }
.booking-steps .step-line                { flex: 1; height: 2px; background: var(--border); margin: 0 8px; }
.booking-steps .step-line.done           { background: var(--green); }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--dark);
  color: #a0a8b8;
  font-size: 13px;
  padding: 24px 0;
  margin-top: 60px;
}
.site-footer a       { color: #a0a8b8; text-decoration: none; }
.site-footer a:hover { color: var(--white); }

/* ── Légende calendrier ─────────────────────────────────────── */
.calendar-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-light);
  align-items: center;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.legend-dot {
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  display: block;
}
.legend-dot.pending   { background: #fff3cd; border: 2px solid #ffc107; }
.legend-dot.confirmed { background: #d4edda; border: 2px solid #28a745; }
.legend-dot.full      { background: #e2e3e5; border: 2px solid #adb5bd; }
.legend-dot.cancelled { background: #f8d7da; border: 2px solid #dc3545; }

/* ── Départ conditionnel (pending_threshold) ────────────────── */
.slot-pill.status-pending_threshold {
  background: #fff3cd;
  color: #856404;
  border-left: 3px solid #ffc107;
}
.slot-card.status-pending_threshold {
  border-left: 3px solid #ffc107;
}

/* ── Responsive mobile ──────────────────────────────────────── */
@media (max-width: 768px) {

  /* Header */
  .site-header .container { padding: 10px 16px; }
  .header-logo { width: 42px; height: 42px; }

  /* Calendrier toolbar */
  .calendar-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
  }
  .calendar-title { font-size: 15px; }
  .view-switcher { width: 100%; }
  .view-btn { flex: 1; text-align: center; }

  /* Grille mois */
  .month-header-cell { font-size: 10px; padding: 6px 2px; text-align: center; }
  .month-day { min-height: 60px; padding: 3px; }
  .day-number { font-size: 11px; }
  .slot-pill { font-size: 9px; padding: 2px 3px; }

  /* Légende */
  .calendar-legend { gap: 10px; padding: 10px 14px; font-size: 11px; }

  /* Slot card vue jour */
  .slot-card { flex-direction: column; align-items: flex-start; gap: 10px; }
  .slot-card .text-end { width: 100%; display: flex; justify-content: space-between; align-items: center; }

  /* Tunnel réservation */
  .booking-steps { gap: 0; }
  .booking-steps .step span { display: none; }
  .booking-steps .step-number { width: 32px; height: 32px; font-size: 14px; }

  /* Footer */
  .site-footer .row { gap: 24px; }
}

@media (max-width: 480px) {
  .month-day { min-height: 44px; }
  
  /* Au lieu de cacher les pills, on les réduit au maximum */
  .slot-pill {
    font-size: 8px;
    padding: 1px 2px;
    border-left-width: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  
  /* Cacher le texte, garder juste l'heure */
  .slot-pill {
    display: block !important;
  }

  .more-slots { font-size: 8px; }
  .day-number { font-size: 10px; }
  .booking-steps .step-line { margin: 0 4px; }
}

/* ── Bloc SEO ───────────────────────────────────────────────── */
.seo-section { margin-top: 24px; }

.seo-block {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  height: 100%;
  border-top: 3px solid var(--blue);
}

.seo-block h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 12px;
  line-height: 1.4;
}

.seo-block p {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.7;
  margin: 0;
}

.seo-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.seo-list li {
  font-size: 13px;
  color: var(--text-light);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.seo-list li:last-child { border-bottom: none; }

@media (max-width: 768px) {
  .seo-block { margin-bottom: 4px; }
}