/* ============================================================
   ANIMATIONS — Clinique Vétérinaire Val de Loire
   ============================================================ */

/* ── Keyframes ─────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 98, 42, 0.4); }
  50%       { box-shadow: 0 0 0 12px rgba(232, 98, 42, 0); }
}

@keyframes pulseGreen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4); }
  50%       { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

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

/* ── Scroll animations ─────────────────────────────────────── */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
  will-change: opacity, transform;
}

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

/* Variantes directionnelles */
.animate-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.65s ease, transform 0.65s ease;
  will-change: opacity, transform;
}
.animate-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.65s ease, transform 0.65s ease;
  will-change: opacity, transform;
}
.animate-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}
.animate-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* ── Stagger delays pour grilles ───────────────────────────── */
.stagger-1 { transition-delay: 0.05s; }
.stagger-2 { transition-delay: 0.12s; }
.stagger-3 { transition-delay: 0.19s; }
.stagger-4 { transition-delay: 0.26s; }
.stagger-5 { transition-delay: 0.33s; }
.stagger-6 { transition-delay: 0.40s; }

/* Appliqué automatiquement aux cards dans les grilles */
.services-grid .service-card:nth-child(1),
.blog-grid .blog-card:nth-child(1),
.testimonials-grid .testimonial-card:nth-child(1) { transition-delay: 0.05s; }

.services-grid .service-card:nth-child(2),
.blog-grid .blog-card:nth-child(2),
.testimonials-grid .testimonial-card:nth-child(2) { transition-delay: 0.12s; }

.services-grid .service-card:nth-child(3),
.blog-grid .blog-card:nth-child(3),
.testimonials-grid .testimonial-card:nth-child(3) { transition-delay: 0.19s; }

.services-grid .service-card:nth-child(4) { transition-delay: 0.26s; }
.services-grid .service-card:nth-child(5) { transition-delay: 0.33s; }
.services-grid .service-card:nth-child(6) { transition-delay: 0.40s; }

/* ── Hover lifts ───────────────────────────────────────────── */
.card-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}
.card-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(27, 79, 138, 0.18);
}

/* ── Boutons pulsants ──────────────────────────────────────── */
.btn-urgence {
  animation: pulse 2.5s ease-in-out infinite;
  will-change: box-shadow;
}

.whatsapp-float {
  animation: pulseGreen 2.5s ease-in-out infinite;
  will-change: box-shadow;
}

/* ── Hero float ────────────────────────────────────────────── */
.hero-card {
  animation: float 4s ease-in-out infinite;
  will-change: transform;
}

/* ── Stat numbers ──────────────────────────────────────────── */
.stat-number {
  animation: countUp 0.6s ease forwards;
}

/* ── Fade-in global au chargement ──────────────────────────── */
.page-loaded .hero-text { animation: fadeInUp 0.8s ease 0.1s both; }
.page-loaded .hero-card { animation: slideInRight 0.8s ease 0.3s both; }
.page-loaded .trust-bar { animation: fadeIn 0.5s ease 0.5s both; }

/* ── Réduction de mouvement (accessibilité) ─────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .animate-on-scroll,
  .animate-left,
  .animate-right,
  .animate-scale {
    opacity: 1;
    transform: none;
  }
}
