/* ============================================================================
 * GamePanel V3 HUD Pack — Animations Style 1 : Holographic Fluide
 *
 * Mood : JARVIS terminal, scan-lines, hologrammes pulsants
 * Recommandé pour direction Jarvis mais compatible toutes directions
 *
 * Activé par : body.ui-v3.theme-anims-holographic
 * Respecte prefers-reduced-motion : voir fin de fichier
 * ============================================================================ */

/* ============================================================================
   @keyframes
   ============================================================================ */

/* Fade + scale-in holographique */
@keyframes holoFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
    filter: brightness(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: brightness(1);
  }
}

/* Sweep-line scan diagonal (render initial des sections) */
@keyframes holoScanLine {
  from { transform: translateX(-100%); opacity: 0.7; }
  to   { transform: translateX(200%); opacity: 0; }
}

/* Glow concentrique pulsant sur badges actifs */
@keyframes holoGlowPulse {
  0%, 100% {
    box-shadow:
      0 0 4px var(--primary),
      0 0 10px var(--primary-glow, rgba(255,165,61,0.3));
  }
  50% {
    box-shadow:
      0 0 8px var(--primary),
      0 0 20px var(--primary-glow, rgba(255,165,61,0.5)),
      0 0 40px var(--primary-glow, rgba(255,165,61,0.2));
  }
}

/* Particules flottantes en background */
@keyframes holoFloat {
  0%   { transform: translateY(0px) translateX(0px); opacity: 0.3; }
  25%  { transform: translateY(-8px) translateX(3px); opacity: 0.6; }
  50%  { transform: translateY(-4px) translateX(-2px); opacity: 0.4; }
  75%  { transform: translateY(-12px) translateX(4px); opacity: 0.5; }
  100% { transform: translateY(0px) translateX(0px); opacity: 0.3; }
}

/* Type-writer blink cursor */
@keyframes holoCursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Bordure qui s'écrit (reveal left→right via clip-path) */
@keyframes holoBorderReveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}

/* Modal fade scale-in */
@keyframes holoModalIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(-8px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

/* Loader spinner holo */
@keyframes holoSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============================================================================
   SERVER CARDS
   ============================================================================ */
body.ui-v3.theme-anims-holographic .server-card {
  animation: holoFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Stagger des cards */
body.ui-v3.theme-anims-holographic .server-card:nth-child(1) { animation-delay: 0.05s; }
body.ui-v3.theme-anims-holographic .server-card:nth-child(2) { animation-delay: 0.10s; }
body.ui-v3.theme-anims-holographic .server-card:nth-child(3) { animation-delay: 0.15s; }
body.ui-v3.theme-anims-holographic .server-card:nth-child(4) { animation-delay: 0.20s; }
body.ui-v3.theme-anims-holographic .server-card:nth-child(5) { animation-delay: 0.25s; }
body.ui-v3.theme-anims-holographic .server-card:nth-child(6) { animation-delay: 0.30s; }

/* Scan-line sur les cards au render */
body.ui-v3.theme-anims-holographic .server-card::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%);
  pointer-events: none;
  animation: holoScanLine 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

/* ============================================================================
   STATUS BADGE ACTIF — glow concentrique
   ============================================================================ */
body.ui-v3.theme-anims-holographic .status-badge.online {
  animation: holoGlowPulse 2.4s ease-in-out infinite;
}

/* ============================================================================
   NAV ITEMS — hover slide-in
   ============================================================================ */
body.ui-v3.theme-anims-holographic .nav-item {
  transition:
    background 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.15s ease,
    border-left-color 0.2s ease;
}

/* ============================================================================
   MODAL — fade scale-in holographique
   ============================================================================ */
body.ui-v3.theme-anims-holographic .modal-overlay {
  animation: holoFadeIn 0.25s ease-out;
}

body.ui-v3.theme-anims-holographic .modal-box {
  animation: holoModalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ============================================================================
   PAGE TRANSITIONS — fade-in sur .page.active
   ============================================================================ */
body.ui-v3.theme-anims-holographic .page.active {
  animation: holoFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ============================================================================
   PARTICULES HOLOGRAPHIQUES — background login
   ============================================================================ */
body.ui-v3.theme-anims-holographic #login-page::before,
body.ui-v3.theme-anims-holographic #login-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: var(--primary, #ffa53d);
}

body.ui-v3.theme-anims-holographic #login-page::before {
  width: 4px; height: 4px;
  top: 20%; left: 15%;
  box-shadow:
    0 0 6px var(--primary, #ffa53d),
    50vw 10vh 4px var(--secondary, #5dd5fc),
    20vw 60vh 4px var(--primary, #ffa53d),
    70vw 30vh 3px var(--secondary, #5dd5fc),
    85vw 70vh 4px var(--primary, #ffa53d);
  animation: holoFloat 8s ease-in-out infinite;
  opacity: 0.4;
}

body.ui-v3.theme-anims-holographic #login-page::after {
  width: 3px; height: 3px;
  top: 60%; left: 70%;
  box-shadow:
    0 0 4px var(--secondary, #5dd5fc),
    -30vw -20vh 3px var(--primary, #ffa53d),
    -50vw 15vh 4px var(--secondary, #5dd5fc),
    15vw -40vh 3px var(--primary, #ffa53d);
  animation: holoFloat 10s ease-in-out 2s infinite;
  opacity: 0.35;
}

/* ============================================================================
   LOGO LOGIN — float animation
   ============================================================================ */
body.ui-v3.theme-anims-holographic .login-logo-mark {
  animation: holoFloat 4s ease-in-out infinite;
}

/* ============================================================================
   SIDEBAR NAV — stagger animation au boot
   ============================================================================ */
body.ui-v3.theme-anims-holographic .sidebar-section .nav-item {
  animation: holoFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.ui-v3.theme-anims-holographic .sidebar-section:nth-child(1) .nav-item:nth-child(1) { animation-delay: 0.05s; }
body.ui-v3.theme-anims-holographic .sidebar-section:nth-child(1) .nav-item:nth-child(2) { animation-delay: 0.10s; }
body.ui-v3.theme-anims-holographic .sidebar-section:nth-child(1) .nav-item:nth-child(3) { animation-delay: 0.15s; }
body.ui-v3.theme-anims-holographic .sidebar-section:nth-child(2) .nav-item:nth-child(1) { animation-delay: 0.20s; }
body.ui-v3.theme-anims-holographic .sidebar-section:nth-child(2) .nav-item:nth-child(2) { animation-delay: 0.25s; }
body.ui-v3.theme-anims-holographic .sidebar-section:nth-child(3) .nav-item:nth-child(1) { animation-delay: 0.30s; }
body.ui-v3.theme-anims-holographic .sidebar-section:nth-child(3) .nav-item:nth-child(2) { animation-delay: 0.35s; }
body.ui-v3.theme-anims-holographic .sidebar-section:nth-child(3) .nav-item:nth-child(3) { animation-delay: 0.40s; }

/* ============================================================================
   COUNTERS PULSE — stat-value au changement (via JS add/remove class)
   ============================================================================ */
body.ui-v3.theme-anims-holographic .stat-value.updated {
  animation: holoCounterPulse 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes holoCounterPulse {
  0%   { transform: scale(1); color: var(--primary); }
  50%  { transform: scale(1.08); color: var(--secondary, var(--primary)); }
  100% { transform: scale(1); }
}

/* ============================================================================
   REDUCED MOTION
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  body.ui-v3.theme-anims-holographic * {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
