/**
 * ============================================
 * ANIMATIONS & KEYFRAMES
 * ============================================
 * All animation definitions in one place
 * Uses timing variables from config.css
 */

/* ==================== PAGE LOAD ANIMATIONS ==================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}


/* ==================== CONTINUOUS ANIMATIONS ==================== */

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(0.95);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes glow {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.2);
  }
}


/* ==================== ROTATION ANIMATIONS ==================== */

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}


/* ==================== SHAKE ANIMATIONS ==================== */

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

@keyframes shakeVertical {
  0%, 100% {
    transform: translateY(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateY(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateY(5px);
  }
}


/* ==================== SCALE ANIMATIONS ==================== */

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.8);
  }
}


/* ==================== RIPPLE EFFECT ==================== */

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}


/* ==================== SHIMMER EFFECT ==================== */

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}


/* ==================== COUNTDOWN NUMBER FLIP ==================== */

@keyframes flipIn {
  from {
    transform: perspective(400px) rotateX(90deg);
    opacity: 0;
  }
  to {
    transform: perspective(400px) rotateX(0deg);
    opacity: 1;
  }
}

@keyframes flipOut {
  from {
    transform: perspective(400px) rotateX(0deg);
    opacity: 1;
  }
  to {
    transform: perspective(400px) rotateX(-90deg);
    opacity: 0;
  }
}


/* ==================== UTILITY ANIMATION CLASSES ==================== */

/* Apply these classes via JavaScript for dynamic animations */

.animate-bounce {
  animation: bounce 2s var(--ease-in-out) infinite;
}

.animate-pulse {
  animation: pulse 2s var(--ease-in-out) infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-float {
  animation: float 3s var(--ease-in-out) infinite;
}

.animate-shake {
  animation: shake 0.5s var(--ease-in-out);
}

.animate-glow {
  animation: glow 2s var(--ease-in-out) infinite;
}


/* ==================== TRANSITION UTILITIES ==================== */

.transition-all {
  transition: all var(--duration-fast) var(--ease-out);
}

.transition-colors {
  transition: 
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.transition-transform {
  transition: transform var(--duration-fast) var(--ease-bounce);
}

.transition-opacity {
  transition: opacity var(--duration-fast) var(--ease-out);
}


/* ==================== HOVER EFFECTS ==================== */

.hover-lift {
  transition: transform var(--duration-fast) var(--ease-out);
}

.hover-lift:hover {
  transform: translateY(-5px);
}

.hover-grow {
  transition: transform var(--duration-fast) var(--ease-bounce);
}

.hover-grow:hover {
  transform: scale(1.05);
}

.hover-glow {
  transition: filter var(--duration-fast) var(--ease-out);
}

.hover-glow:hover {
  filter: brightness(1.1);
}


/* ==================== ACCESSIBILITY: REDUCED MOTION ==================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .countdown-number {
    text-shadow: none !important;
  }
  
  .value-icon {
    animation: none !important;
  }
}