/* Lecteur vidéo (wrapper Wistia) : barre de lecture, vitesse, écran de pause.
   Tout est limité à .vsl-player : rien ici ne touche le reste de la page. */

/* Format portrait (9:16) : sur grand écran, on limite la largeur pour que la vidéo ne dépasse pas l'écran.
   Sur mobile, elle reste pleine largeur (voir funnel.css). */
.video.vsl-portrait { aspect-ratio: auto; }
@media (min-width: 641px) { .video.vsl-portrait { max-width: 440px; margin-inline: auto; } }

.vsl-player, .vsl-player * { margin: 0; padding: 0; box-sizing: border-box; }
.vsl-player { position: relative; width: 100%; font-family: "Segoe UI", system-ui, sans-serif; }
.vsl-player button { background: none; border: 0; color: inherit; font: inherit; }

/* ── Wistia ── */
.vsl-player .wistia_responsive_padding { position: relative; }
.vsl-player .wistia_responsive_wrapper { height: 100%; left: 0; position: absolute; top: 0; width: 100%; }

/* ── Écran de pause ── */
#pause-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: #c0392b; z-index: 9998; display: none;
  flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
}
#pause-overlay.visible { display: flex; cursor: pointer; }
#pause-stop { font-size: clamp(28px, 7vw, 56px); font-weight: 900; color: #fff; letter-spacing: .08em; line-height: 1; margin-bottom: 12px; }
#pause-message { font-size: clamp(15px, 4.5vw, 28px); font-weight: 700; color: #fff; letter-spacing: .05em; line-height: 1.5; max-width: 520px; text-transform: uppercase; }
#pause-message u { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
#pause-gif { margin: 28px 0; display: flex; justify-content: center; }
#pause-gif img { max-height: clamp(180px, 48vw, 480px); max-width: 80%; border-radius: 8px; }

/* ── Barre du lecteur ── */
#player-bar {
  position: absolute; bottom: 0; left: 0; width: 100%; z-index: 9999;
  background: #b79a73; display: flex; align-items: center;
  height: 36px; /* recalculée par player.js selon la hauteur de la vidéo */
  padding: 0 10px; gap: 10px; border-radius: 0 0 4px 4px;
}

#btn-play { flex-shrink: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: .9; transition: opacity .15s, transform .15s; }
#btn-play:hover { opacity: 1; transform: scale(1.12); }
#btn-play svg { width: 24px; height: 24px; fill: #fff; }

/* Barre de progression : purement visuelle, pas interactive. */
#progress-track { flex: 1; height: 5px; background: rgba(255,255,255,.28); border-radius: 3px; position: relative; overflow: hidden; }
#progress-fill { height: 100%; width: 0%; background: #fff; border-radius: 3px; position: relative; transition: width .3s linear; }

#speed-wrapper { position: relative; flex-shrink: 0; }
#speed-gear { flex-shrink: 0; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: .8; transition: opacity .2s, transform .4s ease; position: relative; }
#speed-gear:hover { opacity: 1; }
#speed-gear.spinning { transform: rotate(45deg); }
#speed-gear:not(.spinning) { transform: rotate(0deg); }
#speed-gear svg { width: 20px; height: 20px; fill: none; overflow: visible; }

#speed-menu {
  position: absolute; bottom: calc(100% + 6px); right: 0; z-index: 10000;
  background: rgba(15,15,15,.66); border: 1px solid rgba(255,255,255,.13); border-radius: 6px;
  overflow: hidden; display: none; flex-direction: column; min-width: 76px; box-shadow: 0 4px 20px rgba(0,0,0,.65);
}
#speed-menu.open { display: flex; }
/* « #speed-menu » devant : sinon « .vsl-player button { color: inherit } » l'emporte et les vitesses sortent en noir. */
#speed-menu .speed-option { padding: 7px 14px; font-size: 12px; font-family: monospace; color: #d6dad8; cursor: pointer; transition: background .12s, color .12s; white-space: nowrap; text-align: center; }
#speed-menu .speed-option:hover { background: rgba(255,255,255,.09); color: #fff; }
#speed-menu .speed-option.active { color: var(--gold, #b79a73); font-weight: 700; }

/* Navigation au clavier : l'anneau de focus reste visible sur la barre dorée. */
.vsl-player :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { #progress-fill, #speed-gear, #btn-play { transition: none; } }

/* Bouton de lecture façon YouTube, au centre, avant la première lecture (le bouton Wistia est masqué :
   playButton=false). Purement visuel : le clic passe à la vidéo ou au pop-up d'opt-in en dessous. */
#yt-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; transform: translate(-50%, -50%); z-index: 5; pointer-events: none; filter: drop-shadow(0 2px 6px #0000004d); }
#yt-play svg { display: block; width: 100%; height: 100%; }
#yt-play.hidden { display: none; }

/* ── Bouton d'appel à l'action sur la vidéo (annotation) ── */
#vsl-cta {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--bar-h, 36px) + 26px); z-index: 9997;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: max-content; max-width: calc(100% - 24px); text-align: center;
  min-height: 48px; padding: 13px 22px; border-radius: 999px; background: rgba(20, 24, 22, .78); color: #fff;
  font: 600 clamp(13px, 3.6vw, 15px)/1.25 Figtree, "Segoe UI", system-ui, sans-serif; letter-spacing: .01em;
  border: 1px solid rgba(255, 255, 255, .35); box-shadow: 0 4px 16px rgba(0, 0, 0, .25); cursor: pointer;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: vsl-cta-in .35s ease-out;
}
#vsl-cta[hidden] { display: none; }
#vsl-cta:hover { background: rgba(20, 24, 22, .9); }
#vsl-cta.corner { left: auto; right: 12px; transform: none; max-width: 70%; }
#vsl-cta.light { background: #fff; color: #141816; border-color: rgba(0, 0, 0, .12); -webkit-backdrop-filter: none; backdrop-filter: none; }
#vsl-cta.light:hover { background: #f1f1ee; }
@keyframes vsl-cta-in { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { #vsl-cta { animation: none; } }

/* ── Page de test des annotations (/?test=annotations, Worker de test seulement) ── */
.vsl-test #player-bar, .vsl-test #pause-overlay, .vsl-test #yt-play { display: none !important; }
.vsl-test #vsl-cta { bottom: 76px; } /* au-dessus de la barre Wistia */
