/* ============================================================
   ANIMATIONS.CSS — Micro-interactions & Transitions
   ============================================================ */

/* ============================================================
   KEYFRAMES
   ============================================================ */

/* Fade in from bottom */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

/* Simple fade */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Slide up */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Number counting pulse */
@keyframes numberPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* Particle float */
@keyframes particleFloat {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0.6;
  }
  25% {
    transform: translateY(-30px) translateX(15px);
    opacity: 1;
  }
  50% {
    transform: translateY(-10px) translateX(-10px);
    opacity: 0.4;
  }
  75% {
    transform: translateY(-50px) translateX(5px);
    opacity: 0.8;
  }
}

/* Shimmer effect */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

/* Pulse ring */
@keyframes pulseRing {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Bounce */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* Float gently */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Glow pulse */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(37, 211, 102, 0.2); }
  50% { box-shadow: 0 0 40px rgba(37, 211, 102, 0.4); }
}

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

/* Slide in from bottom (for modal) */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Toast slide in */
@keyframes toastSlideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Arrow bounce */
@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

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

/* Ripple effect */
@keyframes ripple {
  from {
    transform: scale(0);
    opacity: 0.6;
  }
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ============================================================
   ANIMATION UTILITIES
   ============================================================ */

/* Scroll-triggered animation class */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Staggered children */
.stagger-children > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.3s; }

/* Static utility classes */
.anim-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

.anim-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.anim-scale-in {
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

.anim-glow-pulse {
  animation: glowPulse 2s ease-in-out infinite;
}

/* Delay utilities */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* ============================================================
   HERO PARTICLE SYSTEM
   ============================================================ */
.hero-particle { animation: particleFloat 6s ease-in-out infinite; }
.hero-particle:nth-child(1) { animation-duration: 7s; animation-delay: 0s; }
.hero-particle:nth-child(2) { animation-duration: 5s; animation-delay: -1s; }
.hero-particle:nth-child(3) { animation-duration: 9s; animation-delay: -2s; }
.hero-particle:nth-child(4) { animation-duration: 6s; animation-delay: -3s; }
.hero-particle:nth-child(5) { animation-duration: 8s; animation-delay: -4s; }
.hero-particle:nth-child(6) { animation-duration: 5.5s; animation-delay: -0.5s; }
.hero-particle:nth-child(7) { animation-duration: 7.5s; animation-delay: -1.5s; }
.hero-particle:nth-child(8) { animation-duration: 10s; animation-delay: -2.5s; }

/* ============================================================
   HOVER EFFECTS
   ============================================================ */

/* Lift on hover */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* Glow on hover */
.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* Scale on hover */
.hover-scale {
  transition: transform var(--transition-fast);
}

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

/* ============================================================
   BUTTON RIPPLE EFFECT
   ============================================================ */
.btn {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  margin-left: -10px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  pointer-events: none;
  animation: ripple 0.6s ease-out;
}

/* ============================================================
   INDICATOR ARROWS
   ============================================================ */
.scroll-arrow {
  display: inline-block;
  animation: arrowBounce 1.5s ease-in-out infinite;
}

/* ============================================================
   CARD SHINE EFFECT
   ============================================================ */
.card-shine {
  position: relative;
  overflow: hidden;
}

.card-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 30%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.04) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}

.card-shine:hover::after {
  left: 130%;
}

/* ============================================================
   LOADING STATES
   ============================================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: var(--radius-sm);
}

/* ============================================================
   GRADIENT BACKGROUND ANIMATION
   ============================================================ */
.animated-gradient {
  background: linear-gradient(-45deg, #0D0D1A, #1A1A2E, #0F3460, #25D366);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

/* ============================================================
   COUNTER INCREMENT ANIMATION
   ============================================================ */
.counter-value {
  display: inline-block;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.counter-value.bump {
  animation: numberPulse 0.3s ease;
}

/* ============================================================
   RECOMMENDED PLAN HIGHLIGHT ANIMATION
   ============================================================ */
.plan-card.recommended-active {
  animation: glowPulse 1.5s ease-in-out 3;
}
