/**
 * Advanced Animations & Effects
 * Premium gaming aesthetic with smooth 60fps animations
 */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Gradient Animation */
@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Pulse Glow */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.6), 0 0 60px rgba(212, 175, 55, 0.3);
  }
}

/* Neon Pulse */
@keyframes neonPulse {
  0%, 100% {
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.8),
                 0 0 20px rgba(212, 175, 55, 0.6),
                 0 0 30px rgba(212, 175, 55, 0.4);
  }
  50% {
    text-shadow: 0 0 20px rgba(212, 175, 55, 1),
                 0 0 40px rgba(212, 175, 55, 0.8),
                 0 0 60px rgba(212, 175, 55, 0.6);
  }
}

/* Float Animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Rotate Slow */
@keyframes rotateSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Shimmer Effect */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Border Glow Animation */
@keyframes borderGlow {
  0%, 100% {
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.1);
  }
  50% {
    border-color: rgba(212, 175, 55, 0.8);
    box-shadow: inset 0 0 40px rgba(212, 175, 55, 0.3);
  }
}

/* Particle Float */
@keyframes particleFloat {
  0% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) translateX(50px) scale(0);
    opacity: 0;
  }
}

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Down */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide In Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Ripple Effect */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* ============================================
   ANIMATED GRADIENT BACKGROUNDS
   ============================================ */

.animated-gradient {
  background: linear-gradient(
    -45deg,
    var(--color-accent-gold-start),
    var(--color-accent-gold-end),
    var(--color-accent-blue-start),
    var(--color-accent-blue-end)
  );
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

.animated-gradient-gold {
  background: linear-gradient(
    -45deg,
    var(--color-accent-gold-start),
    var(--color-accent-gold-end),
    #ffa500,
    var(--color-accent-gold-start)
  );
  background-size: 400% 400%;
  animation: gradientShift 10s ease infinite;
}

/* ============================================
   GLOW EFFECTS
   ============================================ */

.glow-pulse {
  animation: pulseGlow 3s ease-in-out infinite;
}

.neon-text {
  animation: neonPulse 2s ease-in-out infinite;
}

.text-glow-gold {
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.8),
               0 0 20px rgba(212, 175, 55, 0.6),
               0 0 30px rgba(212, 175, 55, 0.4);
}

.text-glow-blue {
  text-shadow: 0 0 10px rgba(30, 144, 255, 0.8),
               0 0 20px rgba(30, 144, 255, 0.6),
               0 0 30px rgba(30, 144, 255, 0.4);
}

/* ============================================
   FLOATING ELEMENTS
   ============================================ */

.float-animation {
  animation: float 6s ease-in-out infinite;
}

.float-slow {
  animation: float 8s ease-in-out infinite;
}

.float-fast {
  animation: float 4s ease-in-out infinite;
}

/* ============================================
   PARTICLE SYSTEM
   ============================================ */

.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--color-accent-gold-start);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat linear infinite;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

.particle:nth-child(1) { left: 10%; animation-duration: 15s; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-duration: 18s; animation-delay: 2s; }
.particle:nth-child(3) { left: 30%; animation-duration: 12s; animation-delay: 4s; }
.particle:nth-child(4) { left: 40%; animation-duration: 20s; animation-delay: 1s; }
.particle:nth-child(5) { left: 50%; animation-duration: 16s; animation-delay: 3s; }
.particle:nth-child(6) { left: 60%; animation-duration: 14s; animation-delay: 5s; }
.particle:nth-child(7) { left: 70%; animation-duration: 19s; animation-delay: 2s; }
.particle:nth-child(8) { left: 80%; animation-duration: 17s; animation-delay: 4s; }
.particle:nth-child(9) { left: 90%; animation-duration: 13s; animation-delay: 1s; }
.particle:nth-child(10) { left: 95%; animation-duration: 21s; animation-delay: 3s; }

/* ============================================
   SHIMMER EFFECT
   ============================================ */

.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shimmer 3s infinite;
}

/* ============================================
   BORDER ANIMATIONS
   ============================================ */

.animated-border {
  position: relative;
  border: 2px solid rgba(212, 175, 55, 0.3);
  animation: borderGlow 3s ease-in-out infinite;
}

.animated-border-rotate {
  position: relative;
  overflow: hidden;
}

.animated-border-rotate::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    transparent,
    var(--color-accent-gold-start),
    transparent 30%
  );
  animation: rotateSlow 4s linear infinite;
}

.animated-border-rotate::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--color-bg-secondary);
  border-radius: inherit;
  z-index: 1;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

.hover-lift {
  transition: transform var(--duration-normal) var(--easing-standard),
              box-shadow var(--duration-normal) var(--easing-standard);
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-2xl), var(--glow-gold-strong);
}

.hover-glow {
  transition: box-shadow var(--duration-normal) var(--easing-standard);
}

.hover-glow:hover {
  box-shadow: var(--glow-gold-intense);
}

.hover-scale {
  transition: transform var(--duration-normal) var(--easing-standard);
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* ============================================
   MAGNETIC BUTTON EFFECT
   ============================================ */

.magnetic-btn {
  position: relative;
  transition: transform var(--duration-fast) var(--easing-standard);
}

.magnetic-btn::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--color-accent-gold);
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--easing-standard);
  z-index: -1;
  filter: blur(10px);
}

.magnetic-btn:hover::before {
  opacity: 0.5;
}

/* ============================================
   RIPPLE EFFECT
   ============================================ */

.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  pointer-events: none;
  animation: ripple 0.6s ease-out;
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

[data-animate] {
  opacity: 0;
}

[data-animate="fade-up"] {
  animation: fadeInUp var(--duration-slower) var(--easing-decelerate) forwards;
}

[data-animate="fade-down"] {
  animation: fadeInDown var(--duration-slower) var(--easing-decelerate) forwards;
}

[data-animate="scale"] {
  animation: scaleIn var(--duration-slower) var(--easing-decelerate) forwards;
}

[data-animate="slide-right"] {
  animation: slideInRight var(--duration-slower) var(--easing-decelerate) forwards;
}

[data-animate].animated {
  opacity: 1;
}

/* Stagger delays for multiple elements */
[data-animate].animated:nth-child(1) { animation-delay: 0s; }
[data-animate].animated:nth-child(2) { animation-delay: 0.1s; }
[data-animate].animated:nth-child(3) { animation-delay: 0.2s; }
[data-animate].animated:nth-child(4) { animation-delay: 0.3s; }
[data-animate].animated:nth-child(5) { animation-delay: 0.4s; }
[data-animate].animated:nth-child(6) { animation-delay: 0.5s; }

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--color-accent-gold-start);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-dots {
  display: flex;
  gap: var(--space-2);
}

.loading-dot {
  width: 8px;
  height: 8px;
  background: var(--color-accent-gold-start);
  border-radius: 50%;
  animation: bounce 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(1) { animation-delay: 0s; }
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* GPU acceleration for smooth animations */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .particle,
  .animated-gradient,
  .glow-pulse,
  .neon-text,
  .float-animation {
    animation: none !important;
  }
}
