/* ==========================================
   Animations & Transitions
   ========================================== */

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

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

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Staggered children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.2s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.3s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.4s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.5s; }
.stagger-children .reveal:nth-child(7) { transition-delay: 0.6s; }
.stagger-children .reveal:nth-child(8) { transition-delay: 0.7s; }

/* ---------- Hover Effects ---------- */
.hover-lift {
  transition: transform var(--transition), box-shadow var(--transition);
}

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

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

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(0, 180, 216, 0.3);
}

/* ---------- Pulse ---------- */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

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

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

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

/* ---------- Wave animation for decorative elements ---------- */
@keyframes wave {
  0% { transform: translateX(0); }
  50% { transform: translateX(-25%); }
  100% { transform: translateX(0); }
}

/* ---------- Counter animation ---------- */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Spinner ---------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--light-gray);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}

/* ---------- Hero text animation ---------- */
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-content .hero-badge {
  animation: heroFadeIn 0.6s ease forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

.hero-content h1 {
  animation: heroFadeIn 0.6s ease forwards;
  animation-delay: 0.4s;
  opacity: 0;
}

.hero-content p {
  animation: heroFadeIn 0.6s ease forwards;
  animation-delay: 0.6s;
  opacity: 0;
}

.hero-content .hero-buttons {
  animation: heroFadeIn 0.6s ease forwards;
  animation-delay: 0.8s;
  opacity: 0;
}

/* ---------- Ripple effect ---------- */
@keyframes ripple {
  0% { box-shadow: 0 0 0 0 rgba(0, 180, 216, 0.3); }
  100% { box-shadow: 0 0 0 20px rgba(0, 180, 216, 0); }
}

.ripple {
  animation: ripple 1.5s ease-in-out infinite;
}

/* ---------- Slide in from side ---------- */
@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------- Lightbox animation ---------- */
@keyframes lightboxFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.lightbox.active .lightbox-content {
  animation: lightboxFadeIn 0.3s ease forwards;
}

/* ---------- Testimonial slide ---------- */
@keyframes testimonialFadeIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.testimonial-card.active {
  animation: testimonialFadeIn 0.4s ease forwards;
}

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

  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}
