/**
 * SimCrise - Animations & Transitions
 * Index Page Animations
 * 
 * Description: Toutes les animations @keyframes, transitions Material Design et micro-interactions
 * Usage: Importé après design-system.css pour accéder aux variables CSS
 * Version: 1.0.0
 */

/* 🎭 NIVEAU 3: ANIMATIONS ET MICRO-INTERACTIONS */

/* Animation au survol pour cartes */
.card-animated {
  transition: var(--transition-normal);
  transform-origin: center;
}

.card-animated:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Animation au focus pour accessibilité */
.card-animated:focus-within {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Animation de bounce pour les boutons */
.btn-bounce {
  transition: var(--transition-bounce);
}

.btn-bounce:active {
  transform: scale(0.95);
}

/* Micro-animations pour les éléments interactifs */
.interactive-scale {
  transition: var(--transition-fast);
}

.interactive-scale:hover {
  transform: scale(1.05);
}

.interactive-scale:active {
  transform: scale(0.98);
}

/* 🎭 NIVEAU 4: MICRO-ANIMATIONS CONTEXTUELLES AVANCÉES */

/* Animation d'apparition avec Intersection Observer */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* Classes d'animation contextuelle - SÉCURISÉ */
.animate-on-scroll {
  /* Par défaut visible pour éviter contenu invisible */
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--motion-duration-slow) var(--motion-easing-decelerated),
              transform var(--motion-duration-slow) var(--motion-easing-decelerated);
}

/* Animation seulement si JavaScript est actif ET élément marqué pour animation */
.js-enabled .animate-on-scroll:not(.visible) {
  opacity: 0;
  transform: translateY(30px);
}

/* SÉCURITÉ: Assurer que tout le contenu reste visible */
.card, .orientation-option, body, main {
  opacity: 1 !important;
  visibility: visible !important;
}

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

/* États de chargement avec skeleton screens */
.skeleton {
  background: linear-gradient(90deg, 
    hsl(0 0% 90%) 25%, 
    hsl(0 0% 95%) 50%, 
    hsl(0 0% 90%) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Interactions gestuelles avancées */
.swipeable {
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}

.swipeable:active {
  cursor: grabbing;
}

/* Feedback haptique visuel */
.haptic-feedback:active {
  transform: scale(0.98);
  box-shadow: inset 0 2px 4px hsl(0 0% 0% / 0.1);
}

/* États de focus améliorés */
.focus-ring:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Animation menu mobile slide up */
@keyframes menu-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Animation pulse subtile pour boutons spéciaux */
@keyframes pulse-subtle {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.3);
  }
  50% {
    transform: translateX(-50%) scale(1.02);
    box-shadow: 0 6px 16px rgba(71, 85, 105, 0.4);
  }
}

/* Animation tooltips */
@keyframes tooltip-appear {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
