/* Animation Classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Ensure elements are visible by default if no animation class */
.hero-usp .usp-card,
.step-card,
.mode-card,
.feature-card,
.strategy-card,
.review-card,
.faq-item {
  opacity: 1;
  transform: translateY(0);
}

/* Fallback for when JavaScript is disabled or fails to load */
.no-js .animate-on-scroll {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Ensure visibility after a delay if animations don't trigger */
.animate-on-scroll:not(.visible) {
  animation: fallbackFadeIn 0.6s ease 2s forwards;
}

@keyframes fallbackFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.animate-slide-up {
  animation: slideUp 0.6s ease forwards;
}

.animate-slide-left {
  animation: slideLeft 0.6s ease forwards;
}

.animate-slide-right {
  animation: slideRight 0.6s ease forwards;
}

.animate-scale {
  animation: scale 0.6s ease forwards;
}

/* Keyframe Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideLeft {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Button Animations */
.btn-pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 176, 80, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 176, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 176, 80, 0);
  }
}

.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::before {
  width: 300px;
  height: 300px;
}

/* Card Hover Animations */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Floating Ball Animations */
.ball-trail {
  position: absolute;
  pointer-events: none;
  opacity: 0.3;
  animation: trailFade 0.4s ease-out forwards;
}

@keyframes trailFade {
  from {
    opacity: 0.3;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.6);
  }
}

.ball-particles {
  position: absolute;
  pointer-events: none;
  animation: particles 0.8s ease-out forwards;
}

@keyframes particles {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.3) translateY(-50px);
  }
}

.ball-bounce {
  animation: ballBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ballBounce {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Loading Animations */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--color-white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Stagger Animation Delays */
.animate-delay-1 {
  animation-delay: 0.1s;
}

.animate-delay-2 {
  animation-delay: 0.2s;
}

.animate-delay-3 {
  animation-delay: 0.3s;
}

.animate-delay-4 {
  animation-delay: 0.4s;
}

.animate-delay-5 {
  animation-delay: 0.5s;
}

.animate-delay-6 {
  animation-delay: 0.6s;
}

/* Mobile Pulse Animation for Floating Ball */
@media (max-width: 768px) {
  .floating-ball-pulse {
    animation: mobilePulse 3s infinite;
  }
  
  @keyframes mobilePulse {
    0%, 90%, 100% {
      transform: scale(1);
    }
    95% {
      transform: scale(1.1);
    }
  }
}

/* Preloader Animations */
.preloader-ball-spin {
  animation: ballSpin 1s linear infinite;
}

@keyframes ballSpin {
  from {
    transform: translateX(-50%) rotate(0deg);
  }
  to {
    transform: translateX(-50%) rotate(360deg);
  }
}

.preloader-goal-glow {
  animation: goalGlow 2s ease-in-out infinite alternate;
}

@keyframes goalGlow {
  from {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  }
  to {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
  }
}

/* Success Animations */
.success-checkmark {
  animation: checkmark 0.6s ease-in-out;
}

@keyframes checkmark {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Shake Animation */
.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Glow Effects */
.glow-green {
  box-shadow: 0 0 20px rgba(0, 176, 80, 0.6);
}

.glow-gold {
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.glow-blue {
  box-shadow: 0 0 20px rgba(0, 166, 255, 0.6);
}

/* Floating Animation */
.float {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Counter Animation */
.counter {
  font-variant-numeric: tabular-nums;
}

/* Smooth Transitions */
.smooth-transition {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus Animations */
.focus-ring {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
