/* Animations - Scroll animations and transitions */

/* ========================================
   BASE ANIMATION STATES
   ======================================== */

/* All animated elements start hidden */
[class*="animate-"] {
  opacity: 0;
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

/* When visible */
[class*="animate-"].is-visible {
  opacity: 1;
}

/* ========================================
   FADE ANIMATIONS
   ======================================== */

/* Fade Up */
.animate-fade-up {
  transform: translateY(40px);
}

.animate-fade-up.is-visible {
  transform: translateY(0);
}

/* Fade Down */
.animate-fade-down {
  transform: translateY(-40px);
}

.animate-fade-down.is-visible {
  transform: translateY(0);
}

/* Fade Left (comes from right) */
.animate-fade-left {
  transform: translateX(40px);
}

.animate-fade-left.is-visible {
  transform: translateX(0);
}

/* Fade Right (comes from left) */
.animate-fade-right {
  transform: translateX(-40px);
}

.animate-fade-right.is-visible {
  transform: translateX(0);
}

/* Fade Scale */
.animate-scale {
  transform: scale(0.9);
}

.animate-scale.is-visible {
  transform: scale(1);
}

/* ========================================
   STAGGERED ANIMATIONS
   ======================================== */

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

/* Grid stagger for product cards, benefit cards, etc. */
.benefits__grid .benefit-card:nth-child(1) { transition-delay: 0.1s; }
.benefits__grid .benefit-card:nth-child(2) { transition-delay: 0.2s; }
.benefits__grid .benefit-card:nth-child(3) { transition-delay: 0.3s; }
.benefits__grid .benefit-card:nth-child(4) { transition-delay: 0.4s; }

.products__grid .product-card:nth-child(1) { transition-delay: 0.1s; }
.products__grid .product-card:nth-child(2) { transition-delay: 0.2s; }
.products__grid .product-card:nth-child(3) { transition-delay: 0.3s; }

.testimonials__grid .testimonial-card:nth-child(1) { transition-delay: 0.1s; }
.testimonials__grid .testimonial-card:nth-child(2) { transition-delay: 0.2s; }
.testimonials__grid .testimonial-card:nth-child(3) { transition-delay: 0.3s; }

.faq__list .faq-item:nth-child(1) { transition-delay: 0.05s; }
.faq__list .faq-item:nth-child(2) { transition-delay: 0.1s; }
.faq__list .faq-item:nth-child(3) { transition-delay: 0.15s; }
.faq__list .faq-item:nth-child(4) { transition-delay: 0.2s; }
.faq__list .faq-item:nth-child(5) { transition-delay: 0.25s; }
.faq__list .faq-item:nth-child(6) { transition-delay: 0.3s; }
.faq__list .faq-item:nth-child(7) { transition-delay: 0.35s; }

/* ========================================
   HOVER ANIMATIONS
   ======================================== */

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

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

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

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

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

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(var(--color-accent-rgb), 0.4);
}

/* ========================================
   SPECIAL ANIMATIONS
   ======================================== */

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

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

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

.animate-shimmer {
  background: linear-gradient(
    90deg,
    var(--color-bg-alt) 25%,
    var(--color-bg) 50%,
    var(--color-bg-alt) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Attention pulse */
@keyframes attention-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--color-accent-rgb), 0.4);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 20px 10px rgba(var(--color-accent-rgb), 0);
  }
}

.animate-attention {
  animation: attention-pulse 2s ease-in-out infinite;
}

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

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

/* ========================================
   TEXT ANIMATIONS
   ======================================== */

/* Typing effect cursor */
@keyframes blink-cursor {
  0%, 50% {
    border-color: transparent;
  }
  51%, 100% {
    border-color: var(--color-accent);
  }
}

.typing-cursor::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  border-right: 2px solid var(--color-accent);
  animation: blink-cursor 1s infinite;
}

/* ========================================
   COUNTER ANIMATION
   ======================================== */

/* Counter numbers get a special treatment */
.stat-item__number {
  transition: transform 0.3s ease;
}

.stat-item:hover .stat-item__number {
  transform: scale(1.1);
}

/* ========================================
   PAGE LOAD ANIMATION
   ======================================== */

/* Initial load animation for hero elements */
.hero__badge {
  animation: slideInDown 0.6s ease-out 0.2s both;
}

.hero__title {
  animation: slideInUp 0.6s ease-out 0.4s both;
}

.hero__subtitle {
  animation: slideInUp 0.6s ease-out 0.6s both;
}

.hero__cta {
  animation: slideInUp 0.6s ease-out 0.8s both;
}

.hero__trust-badges {
  animation: slideInUp 0.6s ease-out 1s both;
}

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

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

/* ========================================
   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;
  }

  [class*="animate-"] {
    opacity: 1;
    transform: none;
  }

  .hero__badge,
  .hero__title,
  .hero__subtitle,
  .hero__cta,
  .hero__trust-badges {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .whatsapp-float::after {
    animation: none;
  }

  .offer__badge {
    animation: none;
  }

  .countdown__separator {
    animation: none;
    opacity: 1;
  }
}
