/* Animation spécifiques pour la section "Comment Bloom transforme vos appels" */

/* Texte avec effet de dégradé */
.gradient-text {
  background: linear-gradient(to right, #6366f1, #8b5cf6, #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Animation de rebond pour les pastilles */
@keyframes bounce {
  0%, 100% { 
    transform: scale(1);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: scale(1.15);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

/* Perspective 3D pour les cartes */
.card-perspective-wrapper {
  perspective: 1000px;
  perspective-origin: center center;
  transform-style: preserve-3d;
}

/* Animation configuration handled by ScrollObserver */
#why-section .animate-on-scroll {
  will-change: transform, opacity;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  backface-visibility: hidden;
}

@media (max-width: 768px) {
  #why-section .animate-on-scroll {
    transition: opacity 0.6s ease, transform 0.6s ease !important;
  }
}

/* Configuration de la section pour de meilleures performances */
#why-section {
  /* Section sous la ligne de flottaison -> ne la peins que quand visible */
  content-visibility: auto;
  contain-intrinsic-size: 1000px; /* hauteur d'approx pour le pré-layout */
  
  /* Optimisations pour le rendu */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  backface-visibility: hidden;
  background: transparent; /* Utilise le background partagé de la page */
  position: relative;
}


@keyframes fadeInTransition {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Styles pour les cartes avec effet 3D (Thème Sombre) */
.step-card {
  transition: transform 0.5s cubic-bezier(0.25, 0.5, 0.25, 1),
              box-shadow 0.5s cubic-bezier(0.25, 0.5, 0.25, 1),
              border-color 0.3s ease;
  position: relative;
  padding: 2rem 1.75rem 1.75rem;
  border-radius: 1.5rem;
  height: 320px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  
  /* Limite la propagation de style/paint */
  contain: content;
  
  /* Style "Glassmorphism" sombre inspiré de la section Hero */
  background: rgba(15, 23, 42, 0.5);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid rgba(167, 139, 250, 0.3);
  box-shadow: 0px 8px 16px -8px rgba(0, 0, 0, 0.5), 
              inset 0 0 1px 1px rgba(0,0,0,0.4),
              0 0 12px 2px rgba(138, 43, 226, 0.12);

  /* transform-style: preserve-3d; SUPPRIMÉ car inutile hors hover */
  transform: perspective(1000px) translateZ(0);
  /* will-change: transform, box-shadow; SUPPRIMÉ pour éviter promotion permanente */
  backface-visibility: hidden;
}

.step-card:hover {
  /* Promotion temporaire uniquement au hover */
  will-change: transform;
  
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0px 12px 24px -8px rgba(0, 0, 0, 0.5), 
              inset 0 0 1px 1px rgba(0,0,0,0.5),
              0 0 18px 4px rgba(138, 43, 226, 0.18);
  transform: perspective(1000px) translateY(-10px) rotateX(2deg) rotateY(2deg) scale(1.02);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.3s ease;
}

/* Style pour aligner les traits horizontaux en bas des cartes */
.step-card > .relative {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.step-card .relative > p {
  flex-grow: 1;
  margin-bottom: 0;
}

.step-card .relative > div:last-child {
  margin-top: auto;
  margin-bottom: 0.5rem;
}

/* Style des textes et éléments dans les cartes (Thème Sombre) */
.step-card h3 {
  color: #f9fafb; /* text-gray-50 */
  transition: transform 0.35s ease, color 0.3s ease;
  will-change: transform, color;
}

.step-card p {
  color: #d1d5db; /* text-gray-300 */
  transition: opacity 0.4s ease;
  will-change: opacity;
  opacity: 0.9;
}

.step-card:hover h3 {
  transform: translateY(-2px);
  color: #c4b5fd; /* text-violet-300 */
}

.step-card:hover p {
  opacity: 1;
}

/* Styles pour les pastilles avec numéros (inchangé) */
.step-number {
  width: 4.5rem !important;
  height: 4.5rem !important;
  margin: 0 auto 1.5rem !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem !important;
  font-weight: 700;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 1, 0.3, 1);
  position: relative;
  z-index: 1;
  color: white;
  border: none !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Effet de bulle organique sur la pastille au survol de la carte */
.step-card:hover .step-number {
  animation: bubble 1.2s ease-out forwards;
  will-change: transform, box-shadow;
  backface-visibility: hidden;
  -webkit-font-smoothing: subpixel-antialiased;
  transform: translateZ(0);
}

/* Indicateur discret au survol (barre inférieure) (inchangé) */
.step-card .w-10.h-1 {
  transition: all 0.3s ease;
  opacity: 0;
  transform: scale(0);
  transform-origin: left;
  background: linear-gradient(to right, #818cf8, #a855f7);
}

.step-card:hover .w-10.h-1 {
  opacity: 1;
  transform: scale(1);
}

/* Animation d'entrée pour les éléments non gérés par ScrollObserver */
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: cardEnter 0.5s ease-out forwards;
}

/* Animation de bulle organique ultra fluide (inchangé) */
@keyframes bubble {
  0% { 
    transform: translateY(0) scale(1);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
    animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
  }
  30% { 
    transform: translateY(-6px) scale(1.06);
    box-shadow: 0 6px 25px rgba(124, 58, 237, 0.35);
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }
  60% { 
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 22px rgba(124, 58, 237, 0.32);
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }
  100% { 
    transform: translateY(0) scale(1);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
  }
}

/* S'assurer que les titres sont visibles */
#why-section-title,
.why-section-subtitle {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Animation d'effet de brillance (inchangé) */
@keyframes hiw-shine {
  0% { left: -100%; opacity: 0; }
  25% { left: -50%; opacity: 0.5; }
  50% { left: 0%; opacity: 1; }
  75% { left: 50%; opacity: 0.5; }
  100% { left: 110%; opacity: 0; }
}

.shine-effect {
  position: relative;
  overflow: hidden;
}

.shine-effect::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -100%;
  width: 60%;
  height: 200%;
  background: linear-gradient(
    to right, 
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  animation: hiw-shine 6s infinite linear;
  pointer-events: none;
}
