/**
 * Mesada Landing - Animations
 * Keyframes and animation utility classes
 */

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

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

/* ===== Pulse Ring (CTA Button) ===== */
@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* ===== CTA Bounce ===== */
@keyframes cta-bounce {
  0%, 100% {
    transform: scale(1);
  }
  2% {
    transform: scale(1.12);
  }
  4% {
    transform: scale(0.94);
  }
  6% {
    transform: scale(1.06);
  }
  8% {
    transform: scale(0.98);
  }
  10% {
    transform: scale(1);
  }
}

/* ===== Gradient Text Shift ===== */
@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.gradient-text {
  background: linear-gradient(90deg, #22C55E, #34D399, #22C55E);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 3s ease infinite;
}

/* ===== Fade In Up ===== */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fade-in-up 0.6s ease-out forwards;
}

/* ===== Fade In ===== */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fade-in 0.4s ease-out forwards;
}

/* ===== Scale In ===== */
@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scale-in {
  animation: scale-in 0.3s ease-out forwards;
}

/* ===== Slide Down (FAQ) ===== */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Applied to FAQ content when open */
details[open] > .faq-content {
  animation: slideDown 0.3s ease-out;
}

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

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

/* ===== Stagger Animation Delays ===== */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* ===== Section Flash (Attention Grabber) ===== */
@keyframes section-flash {
  0%, 49%, 60%, 100% {
    background-color: var(--color-white);
  }
  50% {
    background-color: #FEF9C3; /* pastel yellow */
  }
  52% {
    background-color: var(--color-white);
  }
  54% {
    background-color: #FEF9C3;
  }
  56% {
    background-color: var(--color-white);
  }
  58% {
    background-color: #FEF9C3;
  }
}

.flash-attention {
  animation: section-flash 5s linear infinite;
}

.flash-attention:focus-within {
  animation: none;
  background-color: var(--color-white);
}

/* ===== Reduce Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .float-animation {
    animation: none;
  }
}
