/* a2i-video.css — Composant vidéo vitrine + lightbox (générique, partagé).
   Préfixe: a2i-vitrine / a2i-lightbox.
   Utilisable sur toutes les pages du site Intégrateur.
   Les badges HUD (0 cloud, IA locale, 0 abonnement) et le layout spécifique
   aux portes restent dans a2i-commun.css. */

/* ═══ Vitrine — fenêtre d'application avec vidéo ═══ */

.a2i-vitrine {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.a2i-vitrine__chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: linear-gradient(180deg, rgba(22, 22, 34, 0.95), rgba(14, 14, 22, 0.95));
  border-bottom: 1px solid var(--a2-corporate-border);
  border-radius: 14px 14px 0 0;
}
.a2i-vitrine__dots { display: flex; gap: 7px; }
.a2i-vitrine__dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--a2-corporate-2); opacity: 0.55;
  box-shadow: 0 0 6px var(--a2-corporate-glow);
}
.a2i-vitrine__dot--green { background: var(--a2-corp-green); box-shadow: 0 0 6px var(--a2-corp-green-bg); }
.a2i-vitrine__dot--mute { background: #475569; box-shadow: none; opacity: 0.5; }
.a2i-vitrine__title {
  flex: 1; text-align: center;
  font-size: 0.66rem; letter-spacing: 0.14em;
  color: #64748b; text-transform: uppercase;
}
.a2i-vitrine__title b { color: var(--a2-corporate-2); font-weight: 600; }
.a2i-vitrine__live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.6rem; letter-spacing: 0.1em;
  color: #475569; text-transform: uppercase;
  transition: color 0.3s;
}
.a2i-vitrine__live::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #475569; transition: background 0.3s, box-shadow 0.3s;
}
.a2i-vitrine__live--on { color: var(--a2-corp-green); }
.a2i-vitrine__live--on::before {
  background: var(--a2-corp-green);
  box-shadow: 0 0 8px var(--a2-corp-green);
  animation: a2i-pulse 1.6s ease-in-out infinite;
}
@keyframes a2i-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

.a2i-vitrine__ecran {
  position: relative; display: block; width: 100%;
  aspect-ratio: 1280 / 736; overflow: hidden;
  background: #050509; cursor: pointer;
  border-bottom: 1px solid var(--a2-corporate-border);
}
.a2i-vitrine__ecran--playing { cursor: zoom-in; }

/* Variante : vidéo non-16/10 (ex. capture d'écran quasi-carrée) */
.a2i-vitrine__ecran--contain { aspect-ratio: 4 / 3; }
.a2i-vitrine__ecran--contain img,
.a2i-vitrine__ecran--contain video { object-fit: contain; background: #050509; }

.a2i-vitrine__ecran img,
.a2i-vitrine__ecran video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s;
  filter: saturate(0.82) brightness(0.82) contrast(1.06);
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}
.a2i-vitrine:hover .a2i-vitrine__ecran img,
.a2i-vitrine:hover .a2i-vitrine__ecran video,
.a2i-vitrine__ecran--playing img,
.a2i-vitrine__ecran--playing video {
  transform: scale(1.04); filter: saturate(1) brightness(1) contrast(1);
}
.a2i-vitrine__ecran::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,7,11,0.12) 0%, transparent 30%, transparent 65%, rgba(7,7,11,0.5) 100%);
  pointer-events: none; z-index: 1;
}
.a2i-vitrine__ecran::after {
  content: ''; position: absolute; left: 0; right: 0;
  height: 38%; top: -38%;
  background: linear-gradient(180deg, transparent, rgba(102, 126, 234, 0.10), transparent);
  pointer-events: none; z-index: 2;
  animation: a2i-scan 6s ease-in-out infinite;
}
@keyframes a2i-scan {
  0%   { top: -38%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.a2i-vitrine__play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 66px; height: 66px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(7, 7, 11, 0.72);
  border: 1px solid var(--a2-corporate-2);
  color: var(--a2-corporate-3);
  font-size: 1.3rem; padding-left: 4px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  z-index: 3; opacity: 1;
  box-shadow: 0 0 28px var(--a2-corporate-glow);
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s, border-color 0.3s, box-shadow 0.3s;
}
.a2i-vitrine:hover .a2i-vitrine__play {
  border-color: var(--a2-corporate-3);
  box-shadow: 0 0 36px var(--a2-corporate-glow);
  transform: translate(-50%, -50%) scale(1);
}
.a2i-vitrine__ecran--playing .a2i-vitrine__play {
  opacity: 0; transform: translate(-50%, -50%) scale(0.7);
}

/* Quand la vidéo joue, le scan lumineux disparaît */
.a2i-vitrine__ecran--playing::after {
  animation: none;
  opacity: 0;
}

.a2i-vitrine__zoom {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(7, 7, 11, 0.65);
  border: 1px solid var(--a2-corporate-border);
  color: #ffffff; font-size: 0.95rem;
  opacity: 0.85; transform: scale(1);
  transition: opacity 0.3s, transform 0.3s, border-color 0.3s, color 0.3s;
  cursor: zoom-in;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  z-index: 20;
  animation: a2i-zoom-pulse 2.4s ease-in-out infinite;
}
@keyframes a2i-zoom-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
  50%      { box-shadow: 0 0 12px 2px rgba(102, 126, 234, 0.35); }
}
.a2i-vitrine:hover .a2i-vitrine__zoom {
  opacity: 1; border-color: var(--a2-corporate-2);
  animation: none;
}
.a2i-vitrine__zoom:hover {
  border-color: var(--a2-corporate-3); color: #ffffff;
  box-shadow: 0 0 16px var(--a2-corporate-glow);
  animation: none;
}

/* Flèche indicatrice pointant vers le bouton agrandir (⤢) — PAS le badge Démo.
   Opt-in : n'apparaît que sur les éléments marqués .a2i-vitrine--indic.
   Placée à l'extérieur droit du cadre, alignée verticalement sur le bouton ⤢,
   pointe vers la gauche (vers le bouton). Va-et-vient horizontal : rentre dans
   le cadre puis ressort, pour attirer l'œil. Ne s'active QUE quand la vidéo
   joue (.a2i-vitrine__ecran--playing), pas en mode poster. */
.a2i-vitrine--indic {
  position: relative;
}
.a2i-vitrine--indic::after {
  content: '';
  position: absolute;
  top: 43px;
  right: -26px;
  width: 28px;
  height: 28px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28' fill='none' stroke='%238b5cf6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M22 14 L6 14'/><path d='M11 9 L6 14 L11 19'/></svg>") center / contain no-repeat;
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.6));
  z-index: 30;
  pointer-events: none;
  transform-origin: 100% 50%;
  opacity: 0;
  transition: opacity 0.3s;
}
.a2i-vitrine--indic:has(.a2i-vitrine__ecran--playing)::after {
  opacity: 1;
  animation: a2i-fleche-entre 2.2s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}
@keyframes a2i-fleche-entre {
  0%, 100% { transform: translateX(6px) scale(0.9); opacity: 0.5; }
  45%      { transform: translateX(-22px) scale(1); opacity: 1; }
  55%      { transform: translateX(-22px) scale(1); opacity: 1; }
}
.a2i-vitrine--indic:hover::after {
  animation: none;
  opacity: 0;
  transition: opacity 0.3s;
}

/* ═══ Lightbox ═══ */
.a2i-lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  background: rgba(3, 3, 6, 0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s;
}
.a2i-lightbox--ouvert { opacity: 1; pointer-events: auto; }
.a2i-lightbox__media {
  position: relative;
  max-width: 100%; max-height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.a2i-lightbox__wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%; max-height: 90dvh;
}
.a2i-lightbox__wrapper video {
  max-width: 100%; max-height: 90dvh;
  display: block;
  border-radius: 14px; border: 1px solid var(--a2-corporate-border);
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 60px var(--a2-corporate-glow);
}
.a2i-lightbox__media img {
  max-width: 100%; max-height: 90dvh;
  border-radius: 14px; border: 1px solid var(--a2-corporate-border);
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 60px var(--a2-corporate-glow);
  transform: scale(0.94);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.a2i-lightbox--ouvert .a2i-lightbox__media img { transform: scale(1); }
.a2i-lightbox__close {
  position: absolute; top: 24px; right: 28px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(15, 15, 23, 0.8);
  border: 1px solid var(--a2-corporate-border);
  color: var(--txt); font-size: 1.4rem; cursor: pointer;
  transition: border-color 0.25s, color 0.25s, transform 0.25s, box-shadow 0.25s;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.a2i-lightbox__close:hover {
  border-color: var(--a2-corporate-2); color: var(--a2-corporate-3);
  transform: rotate(90deg); box-shadow: 0 0 16px var(--a2-corporate-glow);
}
.a2i-lightbox__controls {
  position: absolute; bottom: -52px; left: 0; right: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(7, 7, 11, 0.85);
  border: 1px solid var(--a2-corporate-border);
  border-radius: 10px;
  z-index: 10;
}
.a2i-lightbox__playbtn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(7, 7, 11, 0.6);
  border: 1px solid var(--a2-corporate-border);
  color: #fff; font-size: 0.9rem; cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.a2i-lightbox__playbtn:hover {
  border-color: var(--a2-corporate-2);
  box-shadow: 0 0 12px var(--a2-corporate-glow);
}
.a2i-lightbox__progress { flex: 1; cursor: pointer; }
.a2i-lightbox__progress-bar {
  height: 4px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}
.a2i-lightbox__progress-fill {
  height: 100%; width: 0;
  background: var(--a2-corporate-2);
  border-radius: 2px;
  transition: width 0.1s linear;
}
.a2i-lightbox__time {
  font-size: 0.7rem; color: #94a3b8;
  min-width: 60px; text-align: right;
  font-variant-numeric: tabular-nums;
}

.a2i-lightbox__caption {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  font-size: 0.78rem; color: var(--txt-dim);
  letter-spacing: 0.02em; text-align: center; max-width: 80%;
}

@media (prefers-reduced-motion: reduce) {
  .a2i-vitrine__ecran::after { animation: none; }
  .a2i-vitrine--indic::after { animation: none; opacity: 0.7; }
}
