/**
 * Animation System
 * Scroll-triggered animations and micro-interactions
 */

/* ============================================
   FADE-IN ANIMATIONS
   ============================================ */

/* Base fade-in-up animation */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Faster variation */
.fade-in-up-fast {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

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

/* ============================================
   STAGGER ANIMATIONS
   ============================================ */

/* Stagger children with delays */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

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

/* ============================================
   SECTION TITLE UNDERLINE ANIMATION
   ============================================ */

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg,
    var(--color-gold-medium),
    var(--color-gold-light)
  );
  transition: transform 0.6s ease-out;
  transform-origin: center;
}

.section-title.visible::after {
  transform: translateX(-50%) scaleX(1);
}

/* ============================================
   TABLE ROW ANIMATIONS
   ============================================ */

.comparison-table tbody tr {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.comparison-table.visible tbody tr {
  opacity: 1;
  transform: translateX(0);
}

.comparison-table.visible tbody tr:nth-child(1) { transition-delay: 0.1s; }
.comparison-table.visible tbody tr:nth-child(2) { transition-delay: 0.2s; }
.comparison-table.visible tbody tr:nth-child(3) { transition-delay: 0.3s; }
.comparison-table.visible tbody tr:nth-child(4) { transition-delay: 0.4s; }
.comparison-table.visible tbody tr:nth-child(5) { transition-delay: 0.5s; }

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

@media (prefers-reduced-motion: reduce) {
  .fade-in-up,
  .fade-in-up-fast,
  .stagger-children > *,
  .section-title::after,
  .comparison-table tbody tr {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn-primary {
    animation: none;
  }

  .value-prop-item:hover .value-prop-icon i,
  .metric-card:hover .metric-card-icon i,
  .btn:hover .btn-icon {
    transform: none;
  }
}

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

/* Subtle float animation for decorative elements */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Gradient shift for hero background */
@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Gentle pulse for primary button */
@keyframes gentlePulse {
  0%, 100% {
    box-shadow: 0 4px 14px 0 rgba(212, 175, 55, 0.4);
  }
  50% {
    box-shadow: 0 6px 20px 0 rgba(212, 175, 55, 0.6);
  }
}

/* Scale in animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
