/* ============================================================
   PAGE ACCUEIL — index.php
   ============================================================ */

/* ---- Hero Section (Vidéo) ---- */
.hero-video-section {
  position: relative; width: 100%; height: 75vh; min-height: 500px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden; text-align: center; box-sizing: border-box;
}
.hero-bg-video {
  position: absolute; top: 50%; left: 50%;
  min-width: 100%; min-height: 100%;
  width: auto; height: auto; z-index: -2;
  transform: translateX(-50%) translateY(-50%);
  object-fit: cover;
}
.hero-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
  background: linear-gradient(to bottom, var(--bg-alpha-30) 0%, var(--bg) 100%);
}
.hero-content { z-index: 1; padding: 0 20px; }

.hero-logo-large {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  width: 200px;
  margin: 0 auto 1.5rem auto;
  flex-shrink: 0;
}

.hero-logo-large img {
  height: 100%;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 10px var(--black-50));
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hero-logo-large:hover img {
  filter: drop-shadow(0 0 16px var(--magic-glow));
  transform: scale(1.04);
}

.hero-logo-large.hero-logo-escaped {
  min-height: 200px; /* zone vide conservée pour ne pas faire sauter la page */
}

.hero-sub { color: var(--white); font-size: 1.2rem; margin-bottom: 2.5rem; text-shadow: 0 2px 4px var(--black-80); }

/* Bouton Magique (aussi utilisé sur /votes/, voir votes.css) */
.btn-primary {
  background: var(--magic-10);
  border: 1px solid var(--magic-color);
  color: var(--magic-color);
  padding: 15px 40px; font-size: 1.1rem; font-family: var(--font-title);
  border-radius: 50px; cursor: pointer; transition: var(--trans);
  text-transform: uppercase; letter-spacing: 1px;
}
.btn-primary:hover {
  background: var(--magic-color); color: var(--black);
  box-shadow: 0 0 20px var(--magic-glow), inset 0 0 10px var(--white-50);
  transform: translateY(-3px);
}

.ip-tooltip {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 10px;
    transition: color var(--trans);
    
    /* Zone fixe pour éviter tout déplacement de page */
    height: 40px;
    line-height: 1.4em;
    display: block;
    text-align: center;
    overflow: hidden;
}

@keyframes shake {
    0%   { transform: translate(0, 0) rotate(0deg); }
    15%  { transform: translate(calc(var(--shake, 0) * -1.5px), calc(var(--shake, 0) *  1px))  rotate(calc(var(--shake, 0) * -0.4deg)); }
    30%  { transform: translate(calc(var(--shake, 0) *  1.8px), calc(var(--shake, 0) * -1.5px)) rotate(calc(var(--shake, 0) *  0.5deg)); }
    45%  { transform: translate(calc(var(--shake, 0) * -1px),   calc(var(--shake, 0) *  1.8px)) rotate(calc(var(--shake, 0) * -0.3deg)); }
    60%  { transform: translate(calc(var(--shake, 0) *  2px),   calc(var(--shake, 0) *  1px))  rotate(calc(var(--shake, 0) *  0.6deg)); }
    75%  { transform: translate(calc(var(--shake, 0) * -1.5px), calc(var(--shake, 0) * -1px))  rotate(calc(var(--shake, 0) * -0.5deg)); }
    90%  { transform: translate(calc(var(--shake, 0) *  1px),   calc(var(--shake, 0) *  1.5px)) rotate(calc(var(--shake, 0) *  0.3deg)); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.ip-tooltip.shaking {
    animation: shake 0.35s ease-in-out;
}

/* ---- Barre de Statut (structure aussi utilisée sur /votes/, voir votes.css) ---- */
.status-bar {
  background: var(--bg2); border-bottom: 1px solid var(--border); border-top: 1px solid var(--border);
  padding: 10px 0; text-align: center;
}
.status-inner { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 0.9rem; }
.status-text code { color: var(--magic-color); font-weight: bold; background: var(--surface); padding: 2px 6px; border-radius: 4px; }

/* .dot / .pulse aussi utilisés sur /carte/, voir carte.css */
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pulse { background: var(--green); box-shadow: 0 0 0 var(--green-glow); animation: pulse 2s infinite; }
.offline { background: var(--red); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--green-glow-strong); }
  70% { box-shadow: 0 0 0 10px var(--green-glow-transparent); }
  100% { box-shadow: 0 0 0 0 var(--green-glow-transparent); }
}

/* ---- Features (Pourquoi Proxti) — Carousel ---- */
.features-section { overflow: hidden; }

.features-carousel-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Fondu sur les bords */
.features-carousel-wrapper::before,
.features-carousel-wrapper::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: clamp(60px, 12vw, 160px);
  z-index: 2;
  pointer-events: none;
}
.features-carousel-wrapper::before {
  left: 0;
  background: linear-gradient(to right, var(--bg) 30%, transparent);
}
.features-carousel-wrapper::after {
  right: 0;
  background: linear-gradient(to left, var(--bg) 30%, transparent);
}

.features-carousel {
  display: flex;
  gap: 1.5rem;
  padding: 2.5rem 0;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* .feature-card (carte de base) aussi utilisée sur /votes/, voir votes.css */
.feature-card {
  flex: 0 0 clamp(220px, 30vw, 320px);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  overflow: hidden;
  transition: border-color 0.5s ease, box-shadow 0.5s ease, transform 0.5s ease;
}
.feature-card h3 { color: var(--magic-color); font-size: 1.3rem; margin-bottom: 1rem; }
.feature-card p { color: var(--muted); font-size: 0.95rem; }
.feature-card:hover {
  transform: translateY(-8px);
  border-color: var(--magic-color);
  box-shadow: 0 10px 30px var(--black-50), 0 0 15px var(--magic-glow);
}

.feature-gif { width: 100%; border-radius: 8px; margin-bottom: 1.5rem; border: 1px solid var(--border); }

.feature-card.is-center {
  border-color: var(--magic-color);
  box-shadow: 0 0 20px var(--magic-glow);
  transform: scale(1.03);
}

/* Boutons flèches */
.carousel-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 3;
  background: var(--bg-alpha-80);
  border: 1px solid var(--border);
  color: var(--magic-color);
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  transition: var(--trans);
}
.carousel-btn:hover {
  border-color: var(--magic-color);
  box-shadow: 0 0 12px var(--magic-glow);
}
.carousel-btn-left  { left: clamp(8px, 2vw, 20px); }
.carousel-btn-right { right: clamp(8px, 2vw, 20px); }

/* ---- Trailer ---- */
.trailer-section { overflow: hidden; }

.trailer-wrapper {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  border-radius: 16px;
  padding: 3px;
  transition: box-shadow 0.5s ease;
}

.trailer-wrapper::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  background: conic-gradient(
    from var(--angle, 0deg),
    transparent 0deg,
    var(--magic-color) 60deg,
    transparent 120deg
  );
  animation: trailerRotate 4s linear infinite;
  z-index: 0;
}

.trailer-wrapper:hover::before {
  animation: trailerRotate 1.5s linear infinite;
}

.trailer-wrapper:hover {
  box-shadow: 0 0 40px var(--magic-glow), 0 0 80px var(--magic-15);
}

@property --angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

@keyframes trailerRotate {
  to { --angle: 360deg; }
}

/* Lueur de fond derrière la vidéo */
.trailer-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(ellipse at center, var(--magic-glow) 0%, transparent 70%);
  opacity: 0;
  border-radius: 24px;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 0;
}
.trailer-wrapper:hover .trailer-glow { opacity: 0.5; }

/* Cadre intérieur sombre */
.trailer-frame {
  position: relative;
  z-index: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--black);
  aspect-ratio: 16 / 9;
}

.trailer-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: none;
  display: block;
}

/* Coins décoratifs */
.trailer-corner {
  position: absolute;
  width: 18px; height: 18px;
  border-color: var(--magic-color);
  border-style: solid;
  opacity: 0.7;
  transition: opacity 0.3s ease, width 0.3s ease, height 0.3s ease;
  z-index: 2;
  pointer-events: none;
}
.trailer-wrapper:hover .trailer-corner {
  opacity: 1;
  width: 26px; height: 26px;
}
.trailer-corner--tl { top: -1px;  left: -1px;  border-width: 2px 0 0 2px; border-radius: 4px 0 0 0; }
.trailer-corner--tr { top: -1px;  right: -1px; border-width: 2px 2px 0 0; border-radius: 0 4px 0 0; }
.trailer-corner--bl { bottom: -1px; left: -1px;  border-width: 0 0 2px 2px; border-radius: 0 0 0 4px; }
.trailer-corner--br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-radius: 0 0 4px 0; }

/* ---- Dernières actualités (bloc sur l'accueil) ---- */
.actus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.actu-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; transition: var(--trans);
}
.actu-card:hover { transform: translateY(-4px); border-color: var(--magic-color); box-shadow: 0 5px 15px var(--black-30); }
.actu-card time { font-size: 0.8rem; color: var(--muted); font-family: monospace; }
.actu-card h3 { margin: .5rem 0 1rem; font-size: 1.2rem; }
.actu-card h3 a { color: var(--text); }
.actu-card h3 a:hover { color: var(--magic-color); text-shadow: none; text-decoration: none; }

.center-btn { text-align: center; margin-top: 3rem; }
.btn-secondary {
  border: 1px solid var(--muted); color: var(--text);
  padding: 10px 25px; border-radius: 50px; transition: var(--trans);
}
.btn-secondary:hover { border-color: var(--magic-color); color: var(--magic-color); }
