/* ===========================
   ANIMATION STYLES
   =========================== */

/* Elements that animate on scroll start hidden */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(50px);
}

/* Badge Animation */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border-radius: 100px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 71, 187, 0.15);
  animation: fadeInUp 0.8s ease forwards;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.badge-text {
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.95);
  }
}

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

/* Scroll Indicator Bounce */
@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Feature Icon Animations */
.feature-icon {
  font-size: 2rem;
  filter: grayscale(0.2);
  transition: filter 0.3s ease, transform 0.3s ease;
  animation: float 3s ease-in-out infinite;
}

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

.hero-feature-item:hover .feature-icon,
.numbered-feature:hover .feature-number {
  animation: none;
  transform: scale(1.1);
}

/* Carousel Slide Transitions */
.carousel-slide {
  animation: fadeIn 0.5s ease;
}

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

/* Chart Bar Animation */
.chart-bar {
  animation: growUp 1s ease forwards;
  transform-origin: bottom;
}

@keyframes growUp {
  from {
    transform: scaleY(0);
    opacity: 0;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

.chart-bar:nth-child(1) {
  animation-delay: 0.1s;
}
.chart-bar:nth-child(2) {
  animation-delay: 0.2s;
}
.chart-bar:nth-child(3) {
  animation-delay: 0.3s;
}
.chart-bar:nth-child(4) {
  animation-delay: 0.4s;
}
.chart-bar:nth-child(5) {
  animation-delay: 0.5s;
}
.chart-bar:nth-child(6) {
  animation-delay: 0.6s;
}
.chart-bar:nth-child(7) {
  animation-delay: 0.7s;
}

/* Rotating Text Animation Classes (used by GSAP) */
.headline-letter-exit {
  animation: letterOut 0.3s ease forwards;
}

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

.headline-letter-enter {
  animation: letterIn 0.3s ease forwards;
}

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

/* Form Submit Button Loading State */
.form-submit.loading {
  pointer-events: none;
  opacity: 0.7;
}

.form-submit.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Back to Top Button Animation */
.back-to-top {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-to-top:not(.visible) {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Hover State Transitions */
.numbered-feature,
.carousel-btn,
.form-submit,
.nav-link,
.info-link {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 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;
    scroll-behavior: auto !important;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }

  .badge,
  .scroll-indicator,
  .feature-icon,
  .chart-bar {
    animation: none;
  }
}

/* Stagger delays for numbered features (applied by GSAP) */
.numbered-feature:nth-child(1) {
  transition-delay: 0s;
}
.numbered-feature:nth-child(2) {
  transition-delay: 0.1s;
}
.numbered-feature:nth-child(3) {
  transition-delay: 0.2s;
}
.numbered-feature:nth-child(4) {
  transition-delay: 0.3s;
}
.numbered-feature:nth-child(5) {
  transition-delay: 0.4s;
}
.numbered-feature:nth-child(6) {
  transition-delay: 0.5s;
}
