/* ===================================
   CCSE Simulado — Animations
   =================================== */

/* =========== Keyframes =========== */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

@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(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

@keyframes progressFill {
  from { width: 0%; }
  to { width: 48%; }
}

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.3); }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(198, 11, 30, 0.2); }
  50% { box-shadow: 0 0 40px rgba(198, 11, 30, 0.4); }
}

/* =========== Animation Classes =========== */
.animate-fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

.animate-slide-up {
  opacity: 0;
  animation: slideUp 0.8s ease forwards;
}

.animate-slide-left {
  opacity: 0;
  animation: slideLeft 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }

/* =========== Scroll Reveal =========== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

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

/* =========== Interactive Animations =========== */

/* Phone mockup entrance */
.phone-mockup {
  animation: bounceIn 1s ease forwards;
  animation-delay: 0.5s;
  opacity: 0;
}

/* Progress bar fill animation */
.mock-progress-fill {
  animation: progressFill 2s ease forwards;
  animation-delay: 1.5s;
  width: 0%;
}

/* Mock choice selection animation */
.mock-choice-selected {
  animation: fadeIn 0.5s ease forwards;
  animation-delay: 2s;
}

/* Pricing featured card glow */
.pricing-featured {
  animation: glow 3s ease-in-out infinite;
}

/* Hover effects with smooth transitions */
.feature-card,
.testimonial-card,
.pricing-card,
.step-card {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease;
}

/* Button ripple effect */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
  transform: scale(0);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.3s ease;
  border-radius: inherit;
}

.btn:active::after {
  transform: scale(2);
  opacity: 1;
  transition: transform 0s, opacity 0s;
}

/* Stat numbers count animation */
.stats-bar.visible .stat-number {
  animation: countUp 0.8s ease forwards;
}

/* Nav toggle animation */
.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Smooth scroll indicator */
@keyframes scrollDown {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(8px); opacity: 0.5; }
}

/* Parallax-like subtle effect on hero elements */
@media (prefers-reduced-motion: no-preference) {
  .floating-el {
    will-change: transform;
  }

  .phone-mockup {
    will-change: transform;
  }
}

/* Reduce animations for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-left {
    opacity: 1;
  }
}
