/*
 * wf_slider.css — Slider multi-images (option 5)
 * Namespace : .wf-slider-* pour zéro conflit avec l'existant
 * Chargé uniquement dans les pages qui en ont besoin
 * ----------------------------------------------------------------
 */

/* ── Conteneur slider ──────────────────────────────────────────── */
.wf-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: var(--shadow-md, 0 4px 16px rgba(0,0,0,.14));
  background: #f1f5f9;
  /* Pas d'aspect-ratio fixe : la hauteur s'adapte aux images */
}

/* ── Slides ────────────────────────────────────────────────────── */
.wf-slider__track {
  display: flex;
  height: 100%;
  transition: none; /* slide via JS/CSS transform */
}

.wf-slider__slide {
  flex: 0 0 100%;
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .55s ease;
  pointer-events: none;
}

.wf-slider__slide.is-active {
  opacity: 1;
  pointer-events: auto;
  position: relative; /* reprend la place dans le flux — détermine la hauteur du conteneur */
  inset: auto;
}

/* Img dans chaque slide : taille entière, sans recadrage */
.wf-slider__slide img {
  width: 100%;
  height: auto;          /* hauteur naturelle — pas de crop */
  max-height: 400px;     /* plafond raisonnable sur les grandes images */
  object-fit: contain;   /* image entière visible */
  display: block;
  border-radius: 0;
  background: #f1f5f9;   /* fond neutre si image transparente ou portrait */
}

/* ── Dots indicateurs ──────────────────────────────────────────── */
.wf-slider__dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.wf-slider__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.55);
  border: none;
  cursor: pointer;
  transition: background .25s, transform .25s;
  padding: 0;
}

.wf-slider__dot.is-active {
  background: #fff;
  transform: scale(1.35);
}

/* ── Flèches nav (optionnel, désactivé sur mobile) ─────────────── */
.wf-slider__prev,
.wf-slider__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.35);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}

.wf-slider:hover .wf-slider__prev,
.wf-slider:hover .wf-slider__next {
  opacity: 1;
}

.wf-slider__prev { left: 8px; }
.wf-slider__next { right: 8px; }

@media (max-width: 600px) {
  .wf-slider__prev,
  .wf-slider__next { display: none; }
}

/* Slider dans le preview live de dashboard_v2 : adaptatif */
.wf-slider--preview {
  aspect-ratio: unset !important;
  min-height: 80px;
}
.wf-slider--preview .wf-slider__slide img {
  max-height: 280px;
}

/* ── Badge multi-images dans le listing ────────────────────────── */
.wf-slider-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(99,102,241,.82);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  z-index: 5;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

/* ── UI upload (dans les dashboards) ──────────────────────────── */

/* Zone de prévisualisation des images sélectionnées */
.wf-mimg-preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.wf-mimg-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}

.wf-mimg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wf-mimg-thumb__del {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(239,68,68,.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.wf-mimg-thumb__del:hover { background: #dc2626; }

/* Compteur + hint */
.wf-mimg-count {
  font-size: .78rem;
  color: #64748b;
  margin-top: 4px;
}

/* Champ intervalle */
.wf-mimg-interval-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: .82rem;
  color: #475569;
}

.wf-mimg-interval-row input[type="number"] {
  width: 80px;
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: .82rem;
  background: #fff;
}

/* Bouton media multi-images */
.wf-mimg-box {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1.5px dashed #a5b4fc;
  border-radius: 10px;
  background: rgba(99,102,241,.04);
}

.wf-mimg-box-title {
  font-size: .8rem;
  font-weight: 600;
  color: #6366f1;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Thumbnail slider mini dans listing (dashboard) */
.wf-slider-listing {
  position: relative;
  width: 100%;
  height: 100%;
}

.wf-slider-listing img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .6s ease;
}

.wf-slider-listing img.is-active {
  opacity: 1;
}
