/* Entrance animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes bounceIn { 0% { transform: scale(0.3); opacity: 0; } 50% { transform: scale(1.05); opacity: 0.8; } 70% { transform: scale(0.9); } 100% { transform: scale(1); opacity: 1; } }
@keyframes slideRight { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes markerBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.animate-fade-up { animation: fadeUp 0.4s ease both; }
.animate-fade-in { animation: fadeIn 0.3s ease both; }
.animate-scale-in { animation: scaleIn 0.3s ease both; }
.animate-bounce-in { animation: bounceIn 0.5s ease both; }

/* Stagger delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* Loading spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
.spinner-primary {
  border-color: rgba(27,67,50,0.2);
  border-top-color: var(--color-primary);
}
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }

/* Map marker bounce on hover */
.leaflet-marker-icon:hover { animation: markerBounce 0.6s ease infinite; }

/* Parallax hero image */
.parallax { transform-style: preserve-3d; }
.parallax-bg { will-change: transform; }

/* Card hover effects */
.card-hover-lift { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card-hover-lift:hover { transform: translateY(-6px); box-shadow: 0 20px 60px rgba(0,0,0,0.15); }

/* Ripple effect on buttons */
.btn-ripple { position: relative; overflow: hidden; }
.btn-ripple::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
  transform: scale(0);
  transition: transform 0.3s ease;
}
.btn-ripple:active::after { transform: scale(2); }

/* Page transition */
.page-enter { animation: fadeUp 0.3s ease; }

/* Number counter animation */
@keyframes countUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.count-up { animation: countUp 0.5s ease; }

/* Floating chat button */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.btn-float { animation: float 3s ease infinite; }
.btn-float:hover { animation-play-state: paused; }

/* Notification bell */
@keyframes bell { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-15deg); } 40% { transform: rotate(15deg); } 60% { transform: rotate(-10deg); } 80% { transform: rotate(10deg); } }
.bell-ring { animation: bell 0.8s ease; }

/* Image loading fade */
img.loading { opacity: 0; transition: opacity 0.3s ease; }
img.loaded { opacity: 1; }

/* Swipe hint on mobile */
@keyframes swipeHint { 0%, 100% { transform: translateX(0); opacity: 1; } 50% { transform: translateX(8px); opacity: 0.5; } }
.swipe-hint { animation: swipeHint 2s ease infinite; }

/* Progress bar */
@keyframes progressFill { from { width: 0; } to { width: var(--progress); } }
.progress-bar { height: 4px; background: var(--color-border); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--color-primary); border-radius: 2px; animation: progressFill 1s ease; }

/* Map ping */
@keyframes ping { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(2.5); opacity: 0; } }
.map-ping::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: ping 2s ease infinite;
  opacity: 0.4;
}

/* === MOUVEMENT RÉDUIT ===
   Réglage système, pas préférence esthétique : le mouvement déclenche des
   nausées chez une partie des utilisateurs. On neutralise sans supprimer les
   états, sinon les éléments animés à l'apparition resteraient invisibles.
   Le défilement fluide passe aussi en saut direct. */
@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;
  }
  html { scroll-behavior: auto; }
  .animate-fade-up,
  .animate-fade-in,
  .animate-scale-in { opacity: 1 !important; transform: none !important; }
}
