/* ============================================================
   STELLAR EMPIRES - ANIMATIONS CSS
   Keyframes y efectos de animación para la interfaz espacial
   ============================================================ */

/* ---- PULSOS DE BRILLO NEÓN ---- */
@keyframes glow-blue-pulse {
  0% {
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.2), 0 0 10px rgba(59, 130, 246, 0.1);
    border-color: var(--color-border-dim);
  }
  50% {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5), 0 0 25px rgba(59, 130, 246, 0.2);
    border-color: var(--color-accent-blue);
  }
  100% {
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.2), 0 0 10px rgba(59, 130, 246, 0.1);
    border-color: var(--color-border-dim);
  }
}

@keyframes glow-cyan-pulse {
  0% {
    box-shadow: 0 0 5px rgba(6, 182, 212, 0.2), 0 0 10px rgba(6, 182, 212, 0.1);
    border-color: var(--color-border-dim);
  }
  50% {
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.5), 0 0 25px rgba(6, 182, 212, 0.2);
    border-color: var(--color-accent-cyan);
  }
  100% {
    box-shadow: 0 0 5px rgba(6, 182, 212, 0.2), 0 0 10px rgba(6, 182, 212, 0.1);
    border-color: var(--color-border-dim);
  }
}

@keyframes glow-gold-pulse {
  0% {
    box-shadow: 0 0 5px rgba(245, 158, 11, 0.2), 0 0 10px rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5), 0 0 25px rgba(245, 158, 11, 0.2);
    border-color: var(--color-accent-gold);
  }
  100% {
    box-shadow: 0 0 5px rgba(245, 158, 11, 0.2), 0 0 10px rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
  }
}

/* ---- EFECTO FLOTAR (Para planetas y naves) ---- */
@keyframes hover-float {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1.5deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

@keyframes slow-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ---- BARRIDO HOLOGRÁFICO ---- */
@keyframes scanline-swipe {
  0% {
    top: -100%;
  }
  100% {
    top: 200%;
  }
}

/* ---- EFECTO DE RADAR / PULSAR ---- */
@keyframes radar-pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.4;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* ---- DESTELLO DE ESTRELLAS ---- */
@keyframes star-flicker {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ---- DESPLAZAMIENTO DE ENERGÍA ---- */
@keyframes energy-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ---- CLASES DE ANIMACIÓN APLICABLES ---- */
.animate-glow-blue {
  animation: glow-blue-pulse 3s infinite ease-in-out;
}

.animate-glow-cyan {
  animation: glow-cyan-pulse 3s infinite ease-in-out;
}

.animate-glow-gold {
  animation: glow-gold-pulse 3s infinite ease-in-out;
}

.animate-float {
  animation: hover-float 6s infinite ease-in-out;
}

.animate-spin-slow {
  animation: slow-spin 60s infinite linear;
}

.animate-spin-medium {
  animation: slow-spin 20s infinite linear;
}

.scanline-overlay {
  position: relative;
  overflow: hidden;
}

.scanline-overlay::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 2;
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
}

.scanline-sweep::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 4px;
  background: linear-gradient(180deg, transparent, rgba(6, 182, 212, 0.4), transparent);
  left: 0;
  animation: scanline-swipe 4s infinite linear;
  pointer-events: none;
  z-index: 3;
}

/* ---- DESTELLO AL SUBIR DE NIVEL ---- */
@keyframes level-up-flash {
  0% {
    background: rgba(34, 197, 94, 0);
    box-shadow: inset 0 0 0px rgba(34, 197, 94, 0);
  }
  30% {
    background: rgba(34, 197, 94, 0.25);
    box-shadow: inset 0 0 20px rgba(34, 197, 94, 0.6);
  }
  100% {
    background: rgba(34, 197, 94, 0);
    box-shadow: inset 0 0 0px rgba(34, 197, 94, 0);
  }
}

.level-up-success {
  animation: level-up-flash 1.5s ease-out;
}
