/* ==================== KEYFRAME ANIMATIONS ==================== */

/* Page Load Hero Animation */
@keyframes heroSlideIn {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Page Load Classes */
body.loaded .hero-title {
  animation: heroSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.loaded .hero-subtitle,
body.loaded .hero p {
  animation: fadeSlideUp 0.3s ease forwards;
  animation-delay: 0.15s;
  opacity: 0;
}

body.loaded .hero-buttons {
  animation: fadeSlideUp 0.3s ease forwards;
  animation-delay: 0.25s;
  opacity: 0;
}

body.loaded .hero-stats {
  animation: fadeSlideUp 0.4s ease forwards;
  animation-delay: 0.35s;
  opacity: 0;
}

/* Scroll-triggered fade-in */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Pulsing glow for login button */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(88, 101, 242, 0.8);
  }
}

.btn-discord.pulse {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* Number counter animation */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-number.counting {
  animation: countUp 0.4s ease;
}

/* Ripple effect for buttons */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.6);
  width: 20px;
  height: 20px;
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

/* Bounce animation for medals */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.battle-medal:hover {
  animation: bounce 0.6s ease-in-out;
}

/* Flip animation for achievement unlock */
@keyframes flipIn {
  from {
    transform: perspective(400px) rotateY(-90deg);
    opacity: 0;
  }
  to {
    transform: perspective(400px) rotateY(0deg);
    opacity: 1;
  }
}

.achievement-badge.unlocking {
  animation: flipIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Neon border draw-in */
@keyframes borderDraw {
  from {
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.neon-border-animate {
  stroke-dasharray: 1000;
  animation: borderDraw 1.2s ease forwards;
}

/* Progress bar fill */
@keyframes progressFill {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.progress-bar-fill {
  animation: progressFill 1.5s ease forwards;
}

/* Shimmer loading effect */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton-loader {
  background: linear-gradient(
    90deg,
    rgba(15, 15, 15, 1) 0%,
    rgba(0, 240, 255, 0.1) 50%,
    rgba(15, 15, 15, 1) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Text glow pulse */
@keyframes textGlow {
  0%, 100% {
    text-shadow: 0 0 10px currentColor;
  }
  50% {
    text-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
  }
}

.text-glow-pulse {
  animation: textGlow 2s ease-in-out infinite;
}

/* Rotation hover utility */
.rotate-hover {
  transition: transform var(--transition-base);
}

.rotate-hover:hover {
  transform: rotate(calc(var(--rotate-deg, 1) * 1deg));
}

/* Scale on hover */
.scale-hover {
  transition: transform var(--transition-fast);
}

.scale-hover:hover {
  transform: scale(1.05);
}

/* Glow intensify on hover */
.glow-hover {
  transition: all var(--transition-base);
}

.glow-hover:hover {
  filter: drop-shadow(0 0 20px currentColor);
}
