/* =============================================================================
   slider.css — Slider vertical réutilisable + lightbox plein écran
   =============================================================================
   Utilisé dans les modals formation (horaires, PFMP, allocation, etc.)
   ============================================================================= */

/* =============================================================================
   SLIDER VERTICAL
   ============================================================================= */
.vslider {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  background: #1b2735;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Zone d'affichage : empile les slides en absolu pour le crossfade */
.vslider-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vslider-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  cursor: zoom-in;
  pointer-events: none;
  /* Texte centré au cas où */
  text-align: center;
}

.vslider-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.vslider-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Flèches haut/bas */
.vslider-arrow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 120, 212, 0.85);
  color: #fff;
  border: none;
  width: 40px;
  height: 30px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  z-index: 3;
  transition: background 0.2s ease, transform 0.2s ease;
  font-family: inherit;
}

.vslider-arrow:hover {
  background: var(--bg-tile-blue);
  transform: translateX(-50%) scale(1.1);
}

.vslider-arrow-prev { top: 8px; }
.vslider-arrow-next { bottom: 8px; }

/* Dans une tuile : cacher les flèches (l'autoplay suffit, garder l'aspect propre) */
.tile-slider .vslider-arrow {
  display: none;
}

/* Dots indicateurs (verticaux à droite) */
.vslider-dots {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 3;
}

.vslider-dot {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.vslider-dot:hover { background: rgba(255, 255, 255, 0.7); }

.vslider-dot.active {
  background: #fff;
  transform: scale(1.4);
}

/* État vide */
.vslider-empty {
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 40px;
  font-size: 14px;
  font-style: italic;
}

/* =============================================================================
   LIGHTBOX PLEIN ÉCRAN
   ============================================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: lightbox-in 0.2s ease;
}

.lightbox[hidden] { display: none; }

@keyframes lightbox-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: default;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.7);
  border-radius: 4px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, transform 0.2s;
  z-index: 5001;
}

.lightbox-close {
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 32px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.lightbox-prev:hover,
.lightbox-next:hover { transform: translateY(-50%) scale(1.05); }

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 13px;
  letter-spacing: 0.5px;
}

/* Bloquer le scroll du body quand la lightbox est ouverte */
body.lightbox-open {
  overflow: hidden;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 640px) {
  .lightbox { padding: 20px; }
  .lightbox-close { top: 12px; right: 12px; width: 40px; height: 40px; font-size: 22px; }
  .lightbox-prev, .lightbox-next { width: 44px; height: 44px; font-size: 26px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* =============================================================================
   Lien sur image — icône en coin + curseur pointer
   ============================================================================= */
.vslider-slide-clickable {
  cursor: pointer !important;
}
.vslider-slide-clickable:hover img {
  transform: scale(1.02);
  transition: transform 0.3s ease;
}
.vslider-link-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 120, 212, 0.92);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.vslider-slide-clickable.active .vslider-link-icon {
  opacity: 1;
}
