/* ============================================================================
 * GamePanel V3 HUD Pack — Animations Style 4 : Cinematic Elegant
 *
 * Mood : Destiny 2 character menu, Mass Effect, Star Citizen — premium, posé
 * Easing : cubic-bezier(0.25, 0.46, 0.45, 0.94) slow & intentional
 *
 * Activé par : body.ui-v3.theme-anims-cinematic
 * Respecte prefers-reduced-motion : voir fin de fichier
 * ============================================================================ */

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

/* Fade slow premium */
@keyframes cineFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade + lift depuis le bas, plus lent */
@keyframes cineLiftIn {
  from {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(1px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Page transition : fade global */
@keyframes cinePageIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Gradient sweep doré sur boutons (géré via hover) */
@keyframes cineSweep {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* Logo float lent */
@keyframes cineFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-5px); }
}

/* Glow doré ambiant sur cards online */
@keyframes cineGlowGold {
  0%, 100% {
    box-shadow:
      0 4px 20px rgba(200, 154, 58, 0.08),
      0 0 0 1px rgba(200, 154, 58, 0.12);
  }
  50% {
    box-shadow:
      0 8px 32px rgba(200, 154, 58, 0.14),
      0 0 0 1px rgba(200, 154, 58, 0.22);
  }
}

/* ============================================================================
   TRANSITIONS GLOBALES — slow & elegant
   ============================================================================ */
body.ui-v3.theme-anims-cinematic .server-card,
body.ui-v3.theme-anims-cinematic .nav-item,
body.ui-v3.theme-anims-cinematic .btn,
body.ui-v3.theme-anims-cinematic .modal-box {
  transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

body.ui-v3.theme-anims-cinematic .server-card {
  transition-duration: 400ms;
}

body.ui-v3.theme-anims-cinematic .nav-item {
  transition-duration: 300ms;
}

body.ui-v3.theme-anims-cinematic .btn {
  transition-duration: 350ms;
}

/* ============================================================================
   SERVER CARDS — fade slow avec stagger premium
   ============================================================================ */
body.ui-v3.theme-anims-cinematic .server-card {
  animation: cineLiftIn 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Stagger plus espacé — donne l'impression d'un reveal one-by-one */
body.ui-v3.theme-anims-cinematic .server-card:nth-child(1) { animation-delay: 0.08s; }
body.ui-v3.theme-anims-cinematic .server-card:nth-child(2) { animation-delay: 0.18s; }
body.ui-v3.theme-anims-cinematic .server-card:nth-child(3) { animation-delay: 0.28s; }
body.ui-v3.theme-anims-cinematic .server-card:nth-child(4) { animation-delay: 0.38s; }
body.ui-v3.theme-anims-cinematic .server-card:nth-child(5) { animation-delay: 0.48s; }
body.ui-v3.theme-anims-cinematic .server-card:nth-child(6) { animation-delay: 0.58s; }

/* Hover lift Y-4px (Vanguard y ajoute sa version, compatible ici) */
body.ui-v3.theme-anims-cinematic .server-card:hover {
  transform: translateY(-4px);
}

/* Glow doré sur les cards online */
body.ui-v3.theme-anims-cinematic .server-card.online {
  animation: cineLiftIn 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) both,
             cineGlowGold 4s ease-in-out 0.8s infinite;
}

/* ============================================================================
   GRADIENT SWEEP sur boutons primaires — 700ms
   ============================================================================ */
body.ui-v3.theme-anims-cinematic .btn-primary {
  overflow: hidden;
  position: relative;
}

body.ui-v3.theme-anims-cinematic .btn-primary::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 0;
  width: 50%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  transition: transform 700ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}

body.ui-v3.theme-anims-cinematic .btn-primary:hover::before {
  transform: translateX(300%);
}

/* ============================================================================
   PAGE TRANSITIONS — fade global 500ms
   ============================================================================ */
body.ui-v3.theme-anims-cinematic .page.active {
  animation: cinePageIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ============================================================================
   MODAL — reveal premium
   ============================================================================ */
body.ui-v3.theme-anims-cinematic .modal-overlay {
  animation: cinePageIn 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

body.ui-v3.theme-anims-cinematic .modal-box {
  animation: cineLiftIn 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ============================================================================
   SIDEBAR — stagger lent
   ============================================================================ */
body.ui-v3.theme-anims-cinematic .sidebar-section .nav-item {
  animation: cineFadeIn 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

body.ui-v3.theme-anims-cinematic .sidebar-section:nth-child(1) .nav-item:nth-child(1) { animation-delay: 0.10s; }
body.ui-v3.theme-anims-cinematic .sidebar-section:nth-child(1) .nav-item:nth-child(2) { animation-delay: 0.18s; }
body.ui-v3.theme-anims-cinematic .sidebar-section:nth-child(1) .nav-item:nth-child(3) { animation-delay: 0.26s; }
body.ui-v3.theme-anims-cinematic .sidebar-section:nth-child(2) .nav-item:nth-child(1) { animation-delay: 0.34s; }
body.ui-v3.theme-anims-cinematic .sidebar-section:nth-child(2) .nav-item:nth-child(2) { animation-delay: 0.42s; }
body.ui-v3.theme-anims-cinematic .sidebar-section:nth-child(3) .nav-item:nth-child(1) { animation-delay: 0.50s; }
body.ui-v3.theme-anims-cinematic .sidebar-section:nth-child(3) .nav-item:nth-child(2) { animation-delay: 0.58s; }
body.ui-v3.theme-anims-cinematic .sidebar-section:nth-child(3) .nav-item:nth-child(3) { animation-delay: 0.66s; }

/* ============================================================================
   LOGO LOGIN — float cinématique
   ============================================================================ */
body.ui-v3.theme-anims-cinematic .login-logo-mark {
  animation: cineFloat 5s ease-in-out infinite;
}

body.ui-v3.theme-anims-cinematic .login-card {
  animation: cineLiftIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ============================================================================
   TOPBAR — fade-in doux
   ============================================================================ */
body.ui-v3.theme-anims-cinematic #topbar {
  animation: cineFadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ============================================================================
   HERO BANNER — lift-in
   ============================================================================ */
body.ui-v3.theme-anims-cinematic #dashboard-hero {
  animation: cineLiftIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.05s both;
}

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