/* ============================================================
   ETS FOFANA DDP SERVICES — animations.css
   Effets, transitions, keyframes
   ============================================================ */

/* ============================================================
   1. KEYFRAMES
   ============================================================ */

/* Pulse WhatsApp */
@keyframes pulse-whatsapp {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(37,211,102,0.4), 0 0 0 0 rgba(37,211,102,0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(37,211,102,0.4), 0 0 0 12px rgba(37,211,102,0);
  }
}

/* Fade in depuis le bas */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in depuis la gauche */
@keyframes fade-in-left {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade in depuis la droite */
@keyframes fade-in-right {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

/* Shimmer (ligne rouge sous titre) */
@keyframes shimmer-line {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* Compteur chiffres */
@keyframes count-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Glow rouge pulsant */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(227,0,0,0.3); }
  50%       { box-shadow: 0 0 20px rgba(227,0,0,0.6); }
}

/* Flottement léger (hero visuel) */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

/* Rotation lente */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============================================================
   2. CLASSES D'ANIMATION AU SCROLL (Intersection Observer)
   ============================================================ */

/* État initial — avant animation */
.animate {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

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

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

.animate--scale {
  opacity: 0;
  transform: scale(0.94);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

/* État final — après animation (classe ajoutée par JS) */
.animate.is-visible,
.animate--left.is-visible,
.animate--right.is-visible,
.animate--scale.is-visible {
  opacity: 1;
  transform: none;
}

/* Délais échelonnés pour grilles */
.animate--delay-1 { transition-delay: 0.1s; }
.animate--delay-2 { transition-delay: 0.2s; }
.animate--delay-3 { transition-delay: 0.3s; }
.animate--delay-4 { transition-delay: 0.4s; }
.animate--delay-5 { transition-delay: 0.5s; }
.animate--delay-6 { transition-delay: 0.6s; }
.animate--delay-7 { transition-delay: 0.7s; }
.animate--delay-8 { transition-delay: 0.8s; }

/* ============================================================
   3. HERO — ANIMATIONS AU CHARGEMENT
   ============================================================ */
.hero__badge {
  animation: fade-in-up 0.6s ease 0.1s both;
}

.hero__title {
  animation: fade-in-up 0.7s ease 0.2s both;
}

.hero__subtitle {
  animation: fade-in-up 0.7s ease 0.3s both;
}

.hero__description {
  animation: fade-in-up 0.7s ease 0.4s both;
}

.hero__cta {
  animation: fade-in-up 0.7s ease 0.5s both;
}

.hero__meta {
  animation: fade-in-up 0.7s ease 0.6s both;
}

/* ============================================================
   4. NAVBAR — TRANSITION AU SCROLL
   ============================================================ */
.navbar {
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.navbar--scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

/* ============================================================
   5. LIGNE DÉCORATIVE ROUGE (section headers)
   ============================================================ */
.section__header::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background-color: var(--color-primary);
  margin: var(--space-2) auto 0;
  border-radius: 2px;
  animation: shimmer-line 0.6s ease both;
}

.section__header.text-left::after {
  margin-left: 0;
}

/* ============================================================
   6. HOVER EFFETS BOUTONS (complément de style.css)
   ============================================================ */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: inherit;
}

.btn:active::after {
  opacity: 1;
}

/* ============================================================
   7. CARTE HOVER — EFFET GLOW ROUGE
   ============================================================ */
.card,
.activity-card,
.piece-card,
.contact-card,
.location-card {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

/* ============================================================
   8. STAT COUNTER — ANIMATION CHIFFRES
   ============================================================ */
.stat__number[data-target] {
  animation: count-up 0.5s ease both;
}

/* ============================================================
   9. DOT LOCATION — PULSE
   ============================================================ */
.location-card__dot {
  animation: glow-pulse 2s ease-in-out infinite;
}

/* ============================================================
   10. LOADING SKELETON (pour images manquantes)
   ============================================================ */
@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-02) 25%,
    var(--surface-03) 37%,
    var(--surface-02) 63%
  );
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

/* ============================================================
   11. PAGE TRANSITION (fade in général)
   ============================================================ */
main {
  animation: fade-in 0.4s ease both;
}

/* ============================================================
   12. ACCESSIBILITY — prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .animate,
  .animate--left,
  .animate--right,
  .animate--scale {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__badge,
  .hero__title,
  .hero__subtitle,
  .hero__description,
  .hero__cta,
  .hero__meta {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .whatsapp-float {
    animation: none;
  }

  .location-card__dot {
    animation: none;
  }

  .skeleton {
    animation: none;
    background: var(--surface-02);
  }

  main {
    animation: none;
  }
}
