/**
 * Animations UX - Vendre Ma Maison
 * CSS pur + Intersection Observer pour performances optimales
 * Utilise uniquement transform/opacity (GPU accelerated)
 */

/* ===== RESPECT PRÉFÉRENCES UTILISATEUR ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Variantes */
.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

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

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

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

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

/* Stagger pour les grilles */
.reveal-stagger {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  transition-delay: calc(var(--stagger-index, 0) * 0.1s);
}

.reveal-stagger.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== BOUTONS ===== */
.btn-animate {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-animate:hover {
  transform: translateY(-2px);
}

.btn-animate:active {
  transform: translateY(0) scale(0.98);
}

/* CTA pulse subtil */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(214, 162, 90, 0.4);
  }
  50% {
    box-shadow: 0 4px 24px rgba(214, 162, 90, 0.6);
  }
}

.btn-pulse {
  animation: pulse-glow 3s ease-in-out infinite;
}

.btn-pulse:hover {
  animation: none;
  box-shadow: 0 8px 28px rgba(214, 162, 90, 0.5);
}

/* ===== PANELS & MODALES ===== */
.panel-animate {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.35s ease;
}

.modal-animate {
  opacity: 0;
  transform: scale(0.96) translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.modal-animate.active {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.overlay-animate {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.overlay-animate.active {
  opacity: 1;
}

/* ===== INPUTS ===== */
.input-animate {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-animate:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* ===== CARTES ===== */
.card-animate {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-animate:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* ===== SHAKE ERROR ===== */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.shake {
  animation: shake 0.4s ease;
}
