/* ============================================================
   ZH ENTERTAINMENT ROBOTICS — UI CORE CSS V5
   Curseur personnalisé · Scanlines · Écran de boot · Overlays
   ============================================================ */

/* ---- TRANSITION DE PAGE ---- */
body {
  transition: opacity 0.3s ease;
}

/* ---- CURSEUR CUSTOM (crosshair cible) ---- */
.zh-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 34px; height: 34px;
  border: 1px solid rgba(251, 211, 4, 0.85);
  pointer-events: none;
  z-index: 999999;
  will-change: transform;
  /* Uniquement des propriétés composites — pas de layout reflow */
  transition: width 0.18s ease, height 0.18s ease,
              border-color 0.2s ease, background 0.2s ease;
}

/* Lignes de viseur */
.zh-cursor::before,
.zh-cursor::after {
  content: '';
  position: absolute;
  background: rgba(251, 211, 4, 0.55);
}

/* Ligne verticale */
.zh-cursor::before {
  width: 1px; height: 10px;
  left: 50%;
  top: -15px;
  transform: translateX(-50%);
}

/* Ligne horizontale */
.zh-cursor::after {
  width: 10px; height: 1px;
  top: 50%;
  left: -15px;
  transform: translateY(-50%);
}

/* Point central — suit directement la souris, sans inertie */
.zh-cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 4px; height: 4px;
  background: #FBD304;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000000;
  will-change: transform;
  box-shadow: 0 0 8px #FBD304, 0 0 16px rgba(251, 211, 4, 0.4);
}

/* État : survol — plus de margin, seulement width/height */
.zh-cursor.is-hovering {
  width: 52px; height: 52px;
  border-color: #FBD304;
  background: rgba(251, 211, 4, 0.05);
}

/* État : clic */
.zh-cursor.is-clicking {
  width: 22px; height: 22px;
  background: rgba(251, 211, 4, 0.25);
  border-color: #FBD304;
}

/* ---- SCANLINES CRT ---- */
.zh-scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.07) 3px,
    rgba(0, 0, 0, 0.07) 4px
  );
  pointer-events: none;
  z-index: 9997;
  animation: scanlines-drift 10s linear infinite;
}

@keyframes scanlines-drift {
  0%   { background-position: 0 0; }
  100% { background-position: 0 40px; }
}

/* ---- VIGNETTE (assombrit les coins) ---- */
.zh-vignette {
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(0, 0, 0, 0.7) 100%
  );
  pointer-events: none;
  z-index: 9996;
}

/* ---- ÉCRAN DE BOOT ---- */
#zh-boot {
  position: fixed;
  inset: 0;
  background: #000000;
  z-index: 999990;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(30px, 12vw, 200px);
  font-family: 'Space Mono', monospace;
  transition: opacity 0.9s ease;
  overflow: hidden;
}

/* Ligne de balayage animée sur le boot */
#zh-boot::before {
  content: '';
  position: absolute;
  top: -2px; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, #FBD304, #FFE566, transparent);
  animation: boot-scan 1.8s linear infinite;
}

@keyframes boot-scan {
  0%   { top: -2px; opacity: 1; }
  95%  { top: 100%; opacity: 0.3; }
  100% { top: 100%; opacity: 0; }
}

#zh-boot.boot-done {
  opacity: 0;
  pointer-events: none;
}

/* Logo dans le boot screen */
#boot-logo {
  position: absolute;
  right: clamp(40px, 9vw, 140px);
  top: 50%;
  transform: translateY(-50%) scale(0.92);
  height: clamp(220px, 45vh, 500px);
  width: auto;
  opacity: 0;
  filter: brightness(0) invert(1) drop-shadow(0 0 0px rgba(251, 211, 4, 0));
  animation: boot-logo-in 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.6s forwards;
  pointer-events: none;
}

@keyframes boot-logo-in {
  0%   { opacity: 0;    transform: translateY(-50%) scale(0.88); filter: brightness(0) invert(1) drop-shadow(0 0 0px   rgba(251,211,4,0)); }
  60%  { opacity: 0.9;  transform: translateY(-50%) scale(1.02); filter: brightness(0) invert(1) drop-shadow(0 0 40px  rgba(251,211,4,0.55)); }
  100% { opacity: 0.82; transform: translateY(-50%) scale(1);    filter: brightness(0) invert(1) drop-shadow(0 0 28px  rgba(251,211,4,0.38)); }
}

@media (max-width: 750px) { #boot-logo { display: none; } }

/* Lignes de texte du boot */
.boot-line {
  font-size: clamp(0.55rem, 1.4vw, 0.82rem);
  color: #FBD304;
  margin-bottom: 7px;
  opacity: 0;
  transform: translateX(-15px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.boot-line.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Variantes de couleur */
.boot-line.gold  { color: #FBD304; }
.boot-line.red   { color: #FF0040; }
.boot-line.muted { color: rgba(251, 211, 4, 0.3); }

.boot-line.big {
  color: #ffffff;
  font-size: clamp(1rem, 2.8vw, 1.8rem);
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  letter-spacing: 5px;
  margin-top: 25px;
  margin-bottom: 0;
}

/* Barre de progression */
.boot-progress {
  width: min(350px, 80vw);
  height: 2px;
  background: rgba(255, 255, 255, 0.07);
  margin-top: 28px;
  position: relative;
  overflow: hidden;
}

.boot-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #C49A00, #FBD304);
  box-shadow: 0 0 12px rgba(251, 211, 4, 0.6);
  transition: width 1.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   MENU HAMBURGER & NAV MOBILE
   ============================================================ */

/* Bouton hamburger — caché par défaut sur desktop */
.zh-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid rgba(251, 211, 4, 0.35);
  cursor: pointer !important;
  z-index: 1002;
  flex-shrink: 0;
  transition: border-color 0.3s ease;
}

.zh-nav-toggle:hover { border-color: #FBD304; }

.zh-nav-toggle span {
  display: block;
  width: 20px; height: 1.5px;
  background: #FBD304;
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
  transform-origin: center;
}

/* État ouvert — croix */
.zh-nav-toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.zh-nav-toggle.is-open span:nth-child(2) { opacity: 0; width: 0; }
.zh-nav-toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 768px) {
  /* Afficher le hamburger */
  .zh-nav-toggle { display: flex; }

  /* Nav : overlay plein écran */
  nav {
    position: fixed;
    top: 60px; left: 0;
    width: 100%; height: calc(100dvh - 60px);
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    border-top: 1px solid rgba(251, 211, 4, 0.15);
  }

  nav.nav-open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
  }

  /* Items nav verticaux et grands */
  nav ul {
    flex-direction: column !important;
    align-items: center !important;
    gap: 0 !important;
    width: 100%;
    padding: 0 30px;
  }

  nav ul li { width: 100%; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.05); }
  nav ul li:first-child { border-top: 1px solid rgba(255,255,255,0.05); }

  nav ul li a {
    display: block;
    padding: 22px 0 !important;
    font-size: 0.75rem !important;
    letter-spacing: 4px !important;
    color: #aaa !important;
  }

  nav ul li a:hover, nav ul li a.active { color: #FBD304 !important; }
  nav ul li a::after { display: none; }

  /* Dropdown inline */
  .dropdown-content {
    position: static !important;
    transform: none !important;
    display: block !important;
    background: transparent !important;
    border: none !important;
    border-top: 1px solid rgba(251,211,4,0.1) !important;
    min-width: auto !important;
    backdrop-filter: none !important;
    animation: none !important;
  }

  .dropdown-content a {
    font-size: 0.62rem !important;
    padding: 14px 0 !important;
    text-align: center;
    color: #666 !important;
    border-bottom: none !important;
  }

  .dropdown-content a:hover { padding-left: 0 !important; border-left: none !important; color: #FBD304 !important; }

  nav ul li.dropdown::after { display: none; }

  /* Bloquer le scroll quand menu ouvert */
  body.nav-locked { overflow: hidden; }
}

/* ---- Curseur clignotant inline ---- */
.boot-cursor {
  display: inline-block;
  width: 9px; height: 1.1em;
  background: #FBD304;
  margin-left: 5px;
  vertical-align: text-bottom;
  animation: blink-cursor 1s step-end infinite;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
