/**
 * Animation Keyframes
 * Reusable animation keyframes for consistent UI animations
 * Consolidated from list-spot-3step.css and other CSS files
 */

/* ============================================================================
   LOADING ANIMATIONS
   ============================================================================ */

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

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

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================================================
   SLIDE ANIMATIONS (MIGRATED FROM UNIFIED ANIMATION MANAGER)
   ============================================================================ */

@keyframes slideInLeft {
  0% { transform: translateX(-100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutLeft {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(-100%); opacity: 0; }
}

@keyframes slideOutRight {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

/* ============================================================================
   SCALE ANIMATIONS (MIGRATED FROM UNIFIED ANIMATION MANAGER)
   ============================================================================ */

@keyframes scaleIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes scaleOut {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}

/* ============================================================================
   FEEDBACK ANIMATIONS
   ============================================================================ */

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes bounce {
  0%, 20%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-30px); }
  60% { transform: translateY(-15px); }
}

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

.animate-fade-in-up {
  animation: fade-in-up 0.5s ease forwards;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease-out;
}

.animate-fadeInScale {
  animation: fadeInScale 0.3s ease-out;
}

.animate-fadeInStep {
  animation: fadeInStep 0.3s ease-out;
}

/* ============================================================================
   SLIDE ANIMATION CLASSES (MIGRATED FROM UNIFIED ANIMATION MANAGER)
   ============================================================================ */

.animate-slideInLeft {
  animation: slideInLeft 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.animate-slideInRight {
  animation: slideInRight 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.animate-slideOutLeft {
  animation: slideOutLeft 0.3s cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

.animate-slideOutRight {
  animation: slideOutRight 0.3s cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

/* ============================================================================
   SCALE ANIMATION CLASSES (MIGRATED FROM UNIFIED ANIMATION MANAGER)
   ============================================================================ */

.animate-scaleIn {
  animation: scaleIn 0.2s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.animate-scaleOut {
  animation: scaleOut 0.2s cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

/* ============================================================================
   ENHANCED ANIMATIONS FROM CUSTOM.CSS
   ============================================================================ */

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

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

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

/* Scale animations from custom.css */
@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Shimmer loading animation from custom.css */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

/* Modal fade effects from custom.css */
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ============================================================================
   FADEOUT ANIMATION CLASS (MIGRATED FROM UNIFIED ANIMATION MANAGER)
   ============================================================================ */

.animate-fadeOut {
  animation: fadeOut 0.3s ease-in;
}

@keyframes ripple {
  from { transform: scale(0); opacity: 1; }
  to { transform: scale(2); opacity: 0; }
}

/* Loading states from custom.css */
@keyframes loading-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.02);
  }
}

/* ============================================================================
   ENHANCED UTILITY ANIMATION CLASSES
   ============================================================================ */

/* Utility classes */
.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-fade-in-down { animation: fadeInDown 0.3s ease-out; }
.animate-fade-in-left { animation: fadeInLeft 0.3s ease-out; }
.animate-fade-in-right { animation: fadeInRight 0.3s ease-out; }
.animate-scale-in { animation: fadeInScale 0.3s ease-out; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-bounce { animation: bounce 1s infinite; }

/* Modal fade effects */
.modal-fade-out {
  animation: fadeOut 0.3s ease-in-out;
}

/* Loading states */
.loading-pulse {
  animation: loading-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Shimmer effect */
.shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

html.dark .shimmer {
  background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  background-size: 200px 100%;
}

/* ============================================================================
   ANIMATION DELAYS
   ============================================================================ */

/* Animation delays from custom.css */
.animate-delay-50 { animation-delay: 50ms; }
.animate-delay-100 { animation-delay: 100ms; }
.animate-delay-200 { animation-delay: 200ms; }
.animate-delay-300 { animation-delay: 300ms; }
.animate-delay-500 { animation-delay: 500ms; }
.animate-delay-700 { animation-delay: 700ms; }
.animate-delay-1000 { animation-delay: 1000ms; }

/* ============================================================================
   DARK MODE ANIMATIONS
   ============================================================================ */

/* Dark mode toggle animations from custom.css */
.animate-ripple::after {
  animation: ripple-effect 0.6s linear;
}

.animate-to-dark {
  animation: fade-in-dark var(--transition-slow) ease-in-out;
}

.animate-to-light {
  animation: fade-in-light var(--transition-slow) ease-in-out;
}

/* Theme switching animations from custom.css */
.theme-switching #theme-toggle {
  animation: pulse 0.6s ease-in-out;
}

/* Page-wide dark mode transition animation */
html.dark-mode-transitioning * {
  transition: background-color var(--transition-slow) ease-in-out,
              color var(--transition-slow) ease-in-out,
              border-color var(--transition-slow) ease-in-out !important;
}

/* ============================================================================
   ACCESSIBILITY: REDUCED MOTION SUPPORT
   ============================================================================ */

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