/* -------------------------------------------------------- */
/* Reset & base                                             */
/* -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  background: #f0f0ec;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  margin: 0;
}

/* -------------------------------------------------------- */
/* Navbar                                                   */
/* -------------------------------------------------------- */
.navbar { background: #111827 !important; }
.navbar-brand { font-weight: 700; color: #fff !important; font-size: 1rem; }
.nav-link { color: rgba(255,255,255,.6) !important; border-radius: 6px; padding: .3rem .7rem !important; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.12); color: #fff !important; }

/* -------------------------------------------------------- */
/* Calendar container                                       */
/* -------------------------------------------------------- */
.cal-container {
  max-width: 65%;
  margin: 0 auto;
}
@media (max-width: 640px) {
  .cal-container { max-width: 100%; }
}

/* -------------------------------------------------------- */
/* Toolbar                                                  */
/* -------------------------------------------------------- */
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: #1e40af;
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cal-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 36px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.cal-nav-btn:hover { background: #f5f5f2; border-color: #bbb; }
.cal-nav-today { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.cal-nav-today:hover { background: #dbeafe; border-color: #93c5fd; }

/* -------------------------------------------------------- */
/* Scroll wrapper with side arrows                          */
/* -------------------------------------------------------- */
.scroll-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.scroll-arrow {
  flex-shrink: 0;
  width: 52px;
  background: #fff;
  border: 2px solid #ccc;
  border-radius: 12px;
  font-size: 24px;
  color: #222;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s, box-shadow .15s, opacity .2s;
  align-self: center;
  height: 72px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.scroll-arrow:hover {
  background: #f0f0ec;
  border-color: #999;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}

/* -------------------------------------------------------- */
/* Horizontal scroll container                              */
/* -------------------------------------------------------- */
.weeks-scroll {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 4px 0 16px 0;
  scrollbar-width: thin;
  scrollbar-color: #ccc #f0f0ec;
}
.weeks-scroll::-webkit-scrollbar { height: 6px; }
.weeks-scroll::-webkit-scrollbar-track { background: #f0f0ec; }
.weeks-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* -------------------------------------------------------- */
/* Vue verticale (fixe)                                     */
/* -------------------------------------------------------- */
.view-vertical {
  flex-direction: column;
  align-items: stretch;
}
.view-vertical .scroll-arrow { display: none; }
.view-vertical .weeks-scroll {
  flex-direction: column;
  align-items: stretch;
  overflow-x: hidden;
  overflow-y: visible;
  max-height: none;
  padding: 4px 0 16px 0;
}
.view-vertical .week-card { flex: 1; min-width: 0; }

.scroll-sentinel {
  flex-shrink: 0;
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  padding-top: 40px;
}

/* -------------------------------------------------------- */
/* Week card + connecteurs                                  */
/* -------------------------------------------------------- */
.week-card-wrap {
  flex-shrink: 0;
  position: relative;
  display: flex;
}

/* Ligne horizontale entre cartes (mode horizontal) */
.week-card-wrap + .week-card-wrap::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 2px;
  width: 12px;
  height: 2px;
  background: #bbb;
  z-index: 1;
}

/* Mode vertical : ligne continue sur le côté gauche */
.view-vertical .week-card-wrap {
  width: 100%;
  padding-left: 28px;
}

.view-vertical .week-card-wrap::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: -12px; /* s'étend dans le gap jusqu'à la prochaine carte */
  width: 4px;
  height: auto;
  background: #ccc;
  border-radius: 2px;
  z-index: 1;
}

/* Couleur de la barre verticale + fond fadé selon le mois */
.view-vertical .week-card-wrap:has(.month-0)::before  { background: #93c5fd; }
.view-vertical .week-card-wrap:has(.month-1)::before  { background: #c4b5fd; }
.view-vertical .week-card-wrap:has(.month-2)::before  { background: #6ee7b7; }
.view-vertical .week-card-wrap:has(.month-3)::before  { background: #86efac; }
.view-vertical .week-card-wrap:has(.month-4)::before  { background: #bef264; }
.view-vertical .week-card-wrap:has(.month-5)::before  { background: #fde047; }
.view-vertical .week-card-wrap:has(.month-6)::before  { background: #fdba74; }
.view-vertical .week-card-wrap:has(.month-7)::before  { background: #fca5a5; }
.view-vertical .week-card-wrap:has(.month-8)::before  { background: #fcd34d; }
.view-vertical .week-card-wrap:has(.month-9)::before  { background: #d97706; }
.view-vertical .week-card-wrap:has(.month-10)::before { background: #a78bfa; }
.view-vertical .week-card-wrap:has(.month-11)::before { background: #7dd3fc; }

/* Stopper la ligne sous la dernière carte */
.view-vertical .weeks-scroll > .week-card-wrap:last-of-type::before {
  bottom: 0;
}

.week-card {
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-top-width: 4px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

/* Couleurs par mois */
.month-0  { border-top-color: #93c5fd; } /* janvier  — bleu      */
.month-1  { border-top-color: #c4b5fd; } /* février  — violet    */
.month-2  { border-top-color: #6ee7b7; } /* mars     — emeraude  */
.month-3  { border-top-color: #86efac; } /* avril    — vert      */
.month-4  { border-top-color: #bef264; } /* mai      — lime      */
.month-5  { border-top-color: #fde047; } /* juin     — jaune     */
.month-6  { border-top-color: #fdba74; } /* juillet  — orange    */
.month-7  { border-top-color: #fca5a5; } /* août     — corail    */
.month-8  { border-top-color: #fcd34d; } /* septembre— ambre     */
.month-9  { border-top-color: #d97706; } /* octobre  — rouille   */
.month-10 { border-top-color: #a78bfa; } /* novembre — mauve     */
.month-11 { border-top-color: #7dd3fc; } /* décembre — bleu froid*/

.wc-header {
  background: #f5f5f2;
  border-bottom: 1px solid #e8e8e2;
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #888;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wc-month-tag {
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  color: #444;
  background: #e5e5e0;
  text-transform: uppercase;
  flex-shrink: 0;
}
.month-0  .wc-month-tag { background: #bfdbfe; }
.month-1  .wc-month-tag { background: #ddd6fe; }
.month-2  .wc-month-tag { background: #a7f3d0; }
.month-3  .wc-month-tag { background: #bbf7d0; }
.month-4  .wc-month-tag { background: #d9f99d; }
.month-5  .wc-month-tag { background: #fef08a; }
.month-6  .wc-month-tag { background: #fed7aa; }
.month-7  .wc-month-tag { background: #fecaca; }
.month-8  .wc-month-tag { background: #fde68a; }
.month-9  .wc-month-tag { background: #fde68a; color: #92400e; }
.month-10 .wc-month-tag { background: #e9d5ff; }
.month-11 .wc-month-tag { background: #bae6fd; }

/* Fond du header selon le mois */
.month-0  .wc-header { background: #bfdbfe; }
.month-1  .wc-header { background: #ddd6fe; }
.month-2  .wc-header { background: #a7f3d0; }
.month-3  .wc-header { background: #bbf7d0; }
.month-4  .wc-header { background: #d9f99d; }
.month-5  .wc-header { background: #fef08a; }
.month-6  .wc-header { background: #fed7aa; }
.month-7  .wc-header { background: #fecaca; }
.month-8  .wc-header { background: #fde68a; }
.month-9  .wc-header { background: #fde68a; }
.month-10 .wc-header { background: #e9d5ff; }
.month-11 .wc-header { background: #bae6fd; }

/* -------------------------------------------------------- */
/* Days row inside a week card                              */
/* -------------------------------------------------------- */
.wc-days {
  display: flex;
  flex-direction: row;
}

.wc-day {
  flex: 1;
  min-width: 200px;
  padding: 12px;
  border-right: 1px solid #eee;
}
.wc-day:last-child { border-right: none; }
.wc-day.wc-past { opacity: .6; background: #fafafa; }
.wc-day.wc-today { background: #f0f6ff; box-shadow: inset 0 3px 0 #3b82f6; }

/* -------------------------------------------------------- */
/* Day title                                                */
/* -------------------------------------------------------- */
.wc-day-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.wc-dow {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #666;
}
.wc-date {
  font-size: 13px;
  color: #333;
}
.wc-date-badge {
  background: #3b82f6;
  color: #fff;
  border-radius: 5px;
  padding: 1px 7px;
  font-weight: 700;
  font-size: 12px;
}
.wc-holiday-badge {
  font-size: 10px;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: .03em;
}

/* -------------------------------------------------------- */
/* Events                                                   */
/* -------------------------------------------------------- */
.wc-events {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wc-event {
  background: #dbeafe;
  border-left: 4px solid #3b82f6;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
  box-shadow: 0 1px 4px rgba(59,130,246,.18);
}
.wc-event a { color: #1e3a8a; text-decoration: underline dotted; }
.wc-event a:hover { text-decoration: underline; }
.wc-event b { flex-shrink: 0; }
.wc-event-empty {
  height: 28px;
}
@media (max-width: 640px) {
  .wc-events { display: none; margin: 0; }
}

/* -------------------------------------------------------- */
/* Slots — ligne de temps                                   */
/* -------------------------------------------------------- */
.wc-slots {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wc-slot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 7px;
  background: #f8f8f6;
  border: 1px solid #e5e5e0;
}

.wc-slot-dot {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fca5a5;
}
.wc-slot-partial .wc-slot-dot { background: #fbbf24; }
.wc-slot-full    .wc-slot-dot { background: #4ade80; }

.wc-slot-label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  color: #b91c1c;
  min-width: 38px;
}
.wc-slot-partial .wc-slot-label { color: #b91c1c; }
.wc-slot-full    .wc-slot-label { color: #b91c1c; }

.wc-slot-places {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  flex: 1;
  overflow: hidden;
}

/* -------------------------------------------------------- */
/* Places                                                   */
/* -------------------------------------------------------- */
.wc-place-taken {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #111;
  border-radius: 5px;
  flex: 1;
  min-width: 0;
  height: 2em;
  font-size: 11px;
  font-weight: 700;
  color: #1e40af;
  letter-spacing: .01em;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}
.wc-place-taken .btn-x {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  background: rgba(255,255,255,.92);
  border: none;
  font-size: 14px;
  color: #ef4444;
  cursor: pointer;
}
.wc-place-taken:hover .btn-x { display: flex; align-items: center; justify-content: center; }
@media (hover: none) { .wc-place-taken .btn-x { display: flex; align-items: center; justify-content: center; position: static; width: auto; background: none; padding: 0 4px; font-size: 16px; } }
.wc-slot-full .wc-place-taken {
  background: #fff;
  color: #1e40af;
}
.wc-slot-full .wc-place-taken {
  color: #1e40af;
}

.wc-place-free {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #ddd;
  border: 2px solid #1d4ed8;
  border-radius: 5px;
  flex: 1;
  min-width: 0;
  height: 2em;
  font-size: 11px;
  color: #ccc;
  color: #1d4ed8;
  font-weight: 700;
}

/* -------------------------------------------------------- */
/* Buttons                                                  */
/* -------------------------------------------------------- */
.btn-register {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  color: #aaa;
  cursor: pointer;
  transition: color .15s, opacity .15s;
  white-space: nowrap;
  opacity: 0;
}
.wc-slot-row:hover .btn-register { opacity: 1; color: #1d4ed8; }
.btn-register:hover { color: #1d4ed8; }
.btn-register .bi { font-size: 12px; }
@media (max-width: 640px) { .btn-register { opacity: 1; } }

.btn-x {
  background: none;
  border: none;
  color: #ccc;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
}
.btn-x:hover { color: #ef4444; }

.wc-libre {
  font-size: 12px;
  color: #ccc;
  padding: 5px 8px;
}

/* -------------------------------------------------------- */
/* Responsive — mobile : un jour par ligne                  */
/* -------------------------------------------------------- */
@media (max-width: 640px) {
  /* Forcer la vue verticale */
  .scroll-wrapper { flex-direction: column; align-items: stretch; }
  .scroll-arrow { display: none !important; }
  .weeks-scroll {
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: visible;
    max-height: none;
    padding: 4px 0 16px 0;
  }
  .week-card { flex: 1; min-width: 0; }
  .week-card-wrap { width: 100%; padding-left: 20px; }

  /* Barre verticale gauche */
  .week-card-wrap::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: -12px;
    width: 4px;
    border-radius: 2px;
    background: #ccc;
    z-index: 1;
  }
  .weeks-scroll > .week-card-wrap:last-of-type::before { bottom: 0; }

  /* Couleur barre verticale selon mois */
  .week-card-wrap:has(.month-0)::before  { background: #93c5fd; }
  .week-card-wrap:has(.month-1)::before  { background: #c4b5fd; }
  .week-card-wrap:has(.month-2)::before  { background: #6ee7b7; }
  .week-card-wrap:has(.month-3)::before  { background: #86efac; }
  .week-card-wrap:has(.month-4)::before  { background: #bef264; }
  .week-card-wrap:has(.month-5)::before  { background: #fde047; }
  .week-card-wrap:has(.month-6)::before  { background: #fdba74; }
  .week-card-wrap:has(.month-7)::before  { background: #fca5a5; }
  .week-card-wrap:has(.month-8)::before  { background: #fcd34d; }
  .week-card-wrap:has(.month-9)::before  { background: #d97706; }
  .week-card-wrap:has(.month-10)::before { background: #a78bfa; }
  .week-card-wrap:has(.month-11)::before { background: #7dd3fc; }

  /* Un jour par ligne */
  .wc-days { flex-direction: column; }
  .wc-day  { min-width: 0; border-right: none; border-bottom: 1px solid #eee; }
  .wc-day:last-child { border-bottom: none; }

}

/* -------------------------------------------------------- */
/* Config cards                                             */
/* -------------------------------------------------------- */
.card { border-radius: 10px; border-color: #e0e0d8; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card-header { background: #f8f8f5; border-bottom-color: #e0e0d8; padding: .65rem 1rem; }

