/* Animation Keyframes */

@keyframes fadeInUp {
  from {
    opacity: 0;
    translate: 0 30px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    translate: -30px 0;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    translate: 30px 0;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    scale: 0.9;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}

@keyframes float {
  0%, 100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -10px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    translate: 0 -20px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

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

/* Animation Utility Classes */

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: var(--delay, 0s);
}

.animate-slide-in-left {
  animation: slideInLeft 0.6s ease-out forwards;
  animation-delay: var(--delay, 0s);
}

.animate-slide-in-right {
  animation: slideInRight 0.6s ease-out forwards;
  animation-delay: var(--delay, 0s);
}

.animate-scale-in {
  animation: scaleIn 0.5s ease-out forwards;
  animation-delay: var(--delay, 0s);
}

.animate-float {
  animation: float 3s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
  animation-delay: var(--delay, 0s);
}

.animate-slide-down {
  animation: slideDown 0.4s ease-out forwards;
  animation-delay: var(--delay, 0s);
}

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

/* Delay utilities */
.delay-100 { --delay: 0.1s; }
.delay-200 { --delay: 0.2s; }
.delay-300 { --delay: 0.3s; }
.delay-400 { --delay: 0.4s; }
.delay-500 { --delay: 0.5s; }

/* Hover animations */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.hover-scale {
  transition: transform 0.3s ease;
}

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

/* Scroll reveal animation (apply to elements that should animate on scroll) */
.scroll-reveal {
  opacity: 0;
  translate: 0 30px;
  transition: opacity 0.6s ease-out, translate 0.6s ease-out;
}

.scroll-reveal.visible {
  opacity: 1;
  translate: 0 0;
}

/* Staggered children animation */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.8s; }

/* 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;
  }

  .animate-fade-in-up,
  .animate-slide-in-left,
  .animate-slide-in-right,
  .animate-scale-in,
  .animate-float,
  .animate-fade-in,
  .animate-slide-down,
  .scroll-reveal {
    animation: none;
    opacity: 1;
    translate: none;
    scale: none;
  }

  .hover-lift:hover,
  .hover-scale:hover {
    transform: none;
  }

  .stagger-children > * {
    animation: none;
    opacity: 1;
  }
}
