/* ==========================================================================
   Kickoff Abroad — Scroll Animations
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Base Scroll Animation
   -------------------------------------------------------------------------- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity, transform;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* --------------------------------------------------------------------------
   2. Direction Variants
   -------------------------------------------------------------------------- */
.animate-on-scroll.from-left {
  transform: translateX(-50px);
}

.animate-on-scroll.from-right {
  transform: translateX(50px);
}

.animate-on-scroll.from-bottom {
  transform: translateY(40px);
}

.animate-on-scroll.scale-in {
  transform: scale(0.9);
}

.animate-on-scroll.fade-only {
  transform: none;
}

/* --------------------------------------------------------------------------
   3. Stagger Delays
   -------------------------------------------------------------------------- */
.animate-on-scroll.delay-1 {
  transition-delay: 0.15s;
}

.animate-on-scroll.delay-2 {
  transition-delay: 0.3s;
}

.animate-on-scroll.delay-3 {
  transition-delay: 0.45s;
}

.animate-on-scroll.delay-4 {
  transition-delay: 0.6s;
}

/* --------------------------------------------------------------------------
   4. Keyframe Animations
   -------------------------------------------------------------------------- */

/* Floating animation for decorative elements */
@keyframes floating {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.float {
  animation: floating 3s ease-in-out infinite;
}

.float-delayed {
  animation: floating 3s ease-in-out infinite;
  animation-delay: 1s;
}

/* Pulse animation for CTA buttons */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 8px 24px rgba(3, 70, 148, 0.3);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 12px 32px rgba(3, 70, 148, 0.45);
  }
}

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

/* Header fade-in from top */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-down {
  animation: fadeInDown 0.6s ease-out;
}

/* Hero scroll indicator bounce */
@keyframes heroScrollBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-12px);
  }
  60% {
    transform: translateX(-50%) translateY(-6px);
  }
}

.hero-scroll-indicator {
  animation: heroScrollBounce 2.5s ease-in-out infinite;
}

/* Shimmer effect for loading states */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--color-light) 25%,
    var(--color-white) 50%,
    var(--color-light) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* Rotate for spinner/loading */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

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

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

.gradient-animated {
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

/* Scale in with bounce */
@keyframes scaleInBounce {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  60% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Counter number animation helper */
.counter-animate {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   5. Page Transition
   -------------------------------------------------------------------------- */
body {
  opacity: 1;
  transition: opacity 0.3s ease;
}

body:not(.loaded) {
  opacity: 0;
}

body.loaded {
  opacity: 1;
}

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

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

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

  .float,
  .float-delayed,
  .pulse,
  .hero-scroll-indicator {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}
