/**
 * ANIMATIONS.CSS - Animations et Transitions
 * Agence Archimède - Architecture CSS Modulaire
 */

/* ===== KEYFRAMES OPTIMISÉES ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ===== ANIMATIONS HERO SIMPLIFIÉES ===== */
.hero__title {
  animation: fadeInUp 0.6s ease-out;
}

.hero__subtitle {
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero__cta {
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* ===== TRANSITIONS OPTIMISÉES ===== */
.btn {
  transition: background-color 0.2s ease, color 0.2s ease;
}

.service-card {
  transition: box-shadow 0.2s ease;
}

.section-image {
  transition: opacity 0.2s ease;
}

.about__feature {
  transition: box-shadow 0.2s ease;
}

.new-why-choose__item {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.new-why-choose__image {
  transition: opacity 0.2s ease;
}

.new-why-choose__image img {
  transition: opacity 0.2s ease;
}

.concept__item {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.concept__icon {
  transition: background-color 0.2s ease;
}

.timeline__circle {
  transition: all 0.3s ease;
}

.timeline__circle::before {
  transition: opacity 0.3s ease;
}

.footer__link {
  transition: color 0.3s ease;
}

.footer__social-link {
  transition: all 0.3s ease;
}

.footer__legal-link {
  transition: color 0.3s ease;
}

/* ===== EFFETS HOVER SIMPLIFIÉS ===== */
.btn--primary:hover {
  background-color: var(--primary-hover);
}

.btn--secondary:hover {
  background-color: var(--surface);
}

.service-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.section-image:hover {
  opacity: 0.9;
}

.about__feature:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.new-why-choose__item:hover {
  border-color: #6f64db;
  box-shadow: 0 8px 25px rgba(111, 100, 219, 0.15);
}

/* Animations de survol des éléments concept supprimées */

.timeline__step:hover .timeline__circle {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(111, 100, 219, 0.4);
}

.timeline__step:hover .timeline__circle::before {
  opacity: 0.2;
}

.footer__link:hover {
  color: var(--primary-color);
}

.footer__social-link:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.footer__legal-link:hover {
  color: var(--primary-color);
}

/* ===== ANIMATIONS SECTION PROCESSUS ===== */

/* Keyframes pour les animations du processus */
@keyframes processSlideIn {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes processLineGrow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes iconBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-10px) scale(1.1);
  }
  60% {
    transform: translateY(-5px) scale(1.05);
  }
}

@keyframes durationCount {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.6);
  }
}

/* États initiaux pour les animations */
.process-step {
  opacity: 0;
  transform: translateY(50px) scale(0.9);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.process-line {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

.process-icon {
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.process-duration {
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Classes d'animation activées */
.process-step.animate-in {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation-delay: var(--animation-delay, 0s);
}

.process-line.animate-in {
  transform: scaleY(1);
}

.process-icon.icon-animate {
  opacity: 1;
  transform: scale(1);
  animation: iconBounce 0.8s ease-out 0.2s;
}

.process-duration.duration-animate {
  opacity: 1;
  transform: scale(1);
  animation: durationCount 0.6s ease-out 0.4s;
}

/* Animation continue pour la ligne */
.process-line.animate-in::after {
  animation: pulseGlow 3s ease-in-out infinite;
}

/* ===== OPTIMISATION GLOBALE DES PERFORMANCES ===== */
/* Désactivation des animations lourdes pour améliorer les performances */
* {
  will-change: auto !important;
}

/* Optimisation des propriétés coûteuses */
.hero__image-img,
.new-why-choose__image,
.concept__icon,
.why-choose__card,
.section-image {
  will-change: auto;
  backface-visibility: hidden;
  perspective: 1000px;
}

/* ===== RESPECT DES PRÉFÉRENCES D'ANIMATION ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .process-step,
  .process-line,
  .process-icon,
  .process-duration {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== OPTIMISATION DU SCROLL ===== */
html {
  scroll-behavior: auto;
}

body {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Suppression des animations pendant le scroll */
.scrolling * {
  animation-play-state: paused !important;
  transition-duration: 0s !important;
}