/* ========================================
   FLOATING PARTICLES BACKGROUND
   Partículas ambientales flotantes
   ======================================== */

.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2; /* Layer 2: Above Hero Background (z-index 1), below Navbar/Menu */
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--arcane-green);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 10px var(--arcane-green);
  animation: float-up 15s ease-in infinite;
}

/* Variaciones de partículas */
.particle.small {
  width: 2px;
  height: 2px;
}

.particle.medium {
  width: 4px;
  height: 4px;
}

.particle.large {
  width: 6px;
  height: 6px;
}

.particle.gold {
  background: var(--arcane-gold);
  box-shadow: 0 0 12px var(--arcane-gold);
}

.particle.emerald {
  background: var(--arcane-emerald);
  box-shadow: 0 0 8px var(--arcane-emerald);
}

/* Animación de flotación */
@keyframes float-up {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  50% {
    transform: translateY(50vh) translateX(var(--drift-x, 20px)) rotate(180deg);
    opacity: 0.8;
  }
  90% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(-10vh) translateX(var(--drift-x, 40px)) rotate(360deg);
    opacity: 0;
  }
}

/* Animación alternativa (side drift) */
.particle.drift {
  animation: drift-float 20s ease-in-out infinite;
}

@keyframes drift-float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 0.7;
  }
  50% {
    transform: translate(var(--drift-x, 50px), -50vh) scale(1.5);
    opacity: 1;
  }
  90% {
    opacity: 0.5;
  }
}

/* Animación de pulso */
.particle.pulse {
  animation: float-up 15s ease-in infinite, pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.5);
    opacity: 1;
  }
}

/* Twinkle effect para algunas partículas */
.particle.twinkle {
  animation: float-up 15s ease-in infinite, twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* Delays aleatorios (se aplicarán vía JS) */
.particle:nth-child(1) { animation-delay: 0s; left: 5%; }
.particle:nth-child(2) { animation-delay: 2s; left: 15%; }
.particle:nth-child(3) { animation-delay: 4s; left: 25%; }
.particle:nth-child(4) { animation-delay: 6s; left: 35%; }
.particle:nth-child(5) { animation-delay: 8s; left: 45%; }
.particle:nth-child(6) { animation-delay: 10s; left: 55%; }
.particle:nth-child(7) { animation-delay: 12s; left: 65%; }
.particle:nth-child(8) { animation-delay: 14s; left: 75%; }
.particle:nth-child(9) { animation-delay: 16s; left: 85%; }
.particle:nth-child(10) { animation-delay: 18s; left: 95%; }

/* Responsive - menos partículas en móvil */
@media (max-width: 768px) {
  .particle:nth-child(n+6) {
    display: none;
  }
}

/* Accessibility - desactivar si se prefiere movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .particle {
    animation: none;
    opacity: 0.2;
  }
}

/* Background gradient animado */
.animated-gradient-bg {
  background: linear-gradient(
    45deg,
    #000000 0%,
    #0A0E0A 25%,
    #1A1F1A 50%,
    #0A0E0A 75%,
    #000000 100%
  );
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Opcional: Nebula effect overlay */
.nebula-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at 20% 30%,
    rgba(16, 185, 129, 0.05) 0%,
    transparent 50%
  ),
  radial-gradient(
    ellipse at 80% 70%,
    rgba(255, 215, 0, 0.03) 0%,
    transparent 50%
  );
  pointer-events: none;
  z-index: 5; /* Layer 5: Global Ambient Overlay */
  animation: nebulaShift 30s ease-in-out infinite;
}

@keyframes nebulaShift {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1) rotate(0deg);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1) rotate(5deg);
  }
}
