/**
 * Animations - Energy Empire
 * Consolidated animation library
 * All keyframes and animation classes in one place
 */

/* ========================================
   CORE ANIMATIONS
   ======================================== */

/* Pulse - Generic pulsing effect */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.02); }
}

/* Pulse with glow */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 5px var(--accent-blue);
    opacity: 0.8;
  }
  50% {
    box-shadow: 0 0 20px var(--accent-blue), 0 0 30px var(--accent-blue);
    opacity: 1;
  }
}

/* Pulse dot - for indicators */
@keyframes pulse-dot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.7;
  }
}

/* Shake - horizontal shake */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Vertical shake */
@keyframes shake-vertical {
  0%, 100% { transform: translateY(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateY(-3px); }
  20%, 40%, 60%, 80% { transform: translateY(3px); }
}

/* ========================================
   FADE ANIMATIONS
   ======================================== */

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-down {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-out {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* ========================================
   SLIDE ANIMATIONS
   ======================================== */

@keyframes slide-in-left {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-in-right {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-in-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slide-in-down {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slide-out-right {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ========================================
   SCALE ANIMATIONS
   ======================================== */

@keyframes scale-in {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes scale-out {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0);
    opacity: 0;
  }
}

@keyframes pop-in {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  70% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes bounce-in {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ========================================
   BOUNCE & SPRING ANIMATIONS
   ======================================== */

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes bounce-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes spring {
  0% { transform: scale(1); }
  30% { transform: scale(1.15); }
  50% { transform: scale(0.95); }
  70% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ========================================
   ROTATION ANIMATIONS
   ======================================== */

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spin-reverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

/* ========================================
   GLOW ANIMATIONS
   ======================================== */

@keyframes glow-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 5px currentColor);
  }
  50% {
    filter: drop-shadow(0 0 15px currentColor) drop-shadow(0 0 25px currentColor);
  }
}

@keyframes glow-blue {
  0%, 100% {
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.6), 0 0 25px rgba(0, 212, 255, 0.3);
  }
}

@keyframes glow-green {
  0%, 100% {
    box-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.6), 0 0 25px rgba(0, 255, 136, 0.3);
  }
}

@keyframes glow-gold {
  0%, 100% {
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6), 0 0 25px rgba(255, 215, 0, 0.3);
  }
}

@keyframes glow-purple {
  0%, 100% {
    box-shadow: 0 0 5px rgba(155, 89, 182, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.6), 0 0 25px rgba(155, 89, 182, 0.3);
  }
}

/* ========================================
   FLOAT ANIMATIONS
   ======================================== */

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes float-rotate {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(5deg);
  }
}

/* ========================================
   PROGRESS & LOADING ANIMATIONS
   ======================================== */

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes progress-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

@keyframes loading-dots {
  0%, 20% { opacity: 0; }
  40% { opacity: 1; }
  100% { opacity: 0; }
}

/* ========================================
   RIPPLE & WAVE ANIMATIONS
   ======================================== */

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.6;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes ripple-expand {
  0% {
    width: 0;
    height: 0;
    opacity: 1;
  }
  100% {
    width: 200px;
    height: 200px;
    margin: -100px 0 0 -100px;
    opacity: 0;
  }
}

@keyframes wave {
  0% { transform: translateX(0) translateY(0); }
  25% { transform: translateX(5px) translateY(-5px); }
  50% { transform: translateX(0) translateY(0); }
  75% { transform: translateX(-5px) translateY(5px); }
  100% { transform: translateX(0) translateY(0); }
}

/* ========================================
   NOTIFICATION ANIMATIONS
   ======================================== */

@keyframes notification-enter {
  from {
    transform: translateX(100%) scale(0.8);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes notification-exit {
  from {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateX(100%) scale(0.8);
    opacity: 0;
  }
}

@keyframes badge-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(255, 71, 87, 0);
  }
}

/* ========================================
   SPECIAL EFFECTS
   ======================================== */

@keyframes flash {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0; }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.3); }
  28% { transform: scale(1); }
  42% { transform: scale(1.3); }
  70% { transform: scale(1); }
}

@keyframes jello {
  0%, 100% { transform: scale3d(1, 1, 1); }
  30% { transform: scale3d(1.25, 0.75, 1); }
  40% { transform: scale3d(0.75, 1.25, 1); }
  50% { transform: scale3d(1.15, 0.85, 1); }
  65% { transform: scale3d(0.95, 1.05, 1); }
  75% { transform: scale3d(1.05, 0.95, 1); }
}

/* ========================================
   ANIMATION CLASSES
   ======================================== */

/* Core */
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }
.animate-shake { animation: shake 0.4s ease-in-out; }
.animate-bounce { animation: bounce 1s ease infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-wiggle { animation: wiggle 0.5s ease-in-out; }

/* Fade */
.animate-fade-in { animation: fade-in var(--duration-normal) ease-out; }
.animate-fade-out { animation: fade-out var(--duration-normal) ease-out; }
.animate-fade-in-up { animation: fade-in-up var(--duration-normal) ease-out; }
.animate-fade-in-down { animation: fade-in-down var(--duration-normal) ease-out; }

/* Slide */
.animate-slide-in-left { animation: slide-in-left var(--duration-normal) ease-out; }
.animate-slide-in-right { animation: slide-in-right var(--duration-normal) ease-out; }
.animate-slide-in-up { animation: slide-in-up var(--duration-normal) ease-out; }
.animate-slide-in-down { animation: slide-in-down var(--duration-normal) ease-out; }

/* Scale */
.animate-scale-in { animation: scale-in var(--duration-normal) ease-out; }
.animate-pop-in { animation: pop-in var(--duration-normal) cubic-bezier(0.34, 1.56, 0.64, 1); }
.animate-bounce-in { animation: bounce-in var(--duration-slow) ease-out; }

/* Glow */
.animate-glow-blue { animation: glow-blue 2s ease-in-out infinite; }
.animate-glow-green { animation: glow-green 2s ease-in-out infinite; }
.animate-glow-gold { animation: glow-gold 2s ease-in-out infinite; }
.animate-glow-purple { animation: glow-purple 2s ease-in-out infinite; }

/* Float */
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-float-slow { animation: float-slow 4s ease-in-out infinite; }

/* Special */
.animate-flash { animation: flash 1s ease-in-out; }
.animate-heartbeat { animation: heartbeat 1.5s ease-in-out infinite; }
.animate-jello { animation: jello 1s ease; }

/* ========================================
   ANIMATION MODIFIERS
   ======================================== */

.animation-delay-100 { animation-delay: 100ms; }
.animation-delay-200 { animation-delay: 200ms; }
.animation-delay-300 { animation-delay: 300ms; }
.animation-delay-500 { animation-delay: 500ms; }
.animation-delay-1000 { animation-delay: 1000ms; }

.animation-duration-fast { animation-duration: var(--duration-fast); }
.animation-duration-normal { animation-duration: var(--duration-normal); }
.animation-duration-slow { animation-duration: var(--duration-slow); }

.animation-fill-forwards { animation-fill-mode: forwards; }
.animation-fill-backwards { animation-fill-mode: backwards; }
.animation-fill-both { animation-fill-mode: both; }

.animation-infinite { animation-iteration-count: infinite; }
.animation-once { animation-iteration-count: 1; }

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
