/* ============================================
   ANIMATIONS & EFFETS VISUELS MODERNISÉS
   ============================================ */

/* --- KEYFRAMES AVANCÉS --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-60px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-60px) rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotate(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(60px) rotate(5deg);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotate(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.85) rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(150px) skewY(5deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) skewY(0);
  }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-20deg) scale(0.8);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

@keyframes gradient-blue-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes shimmer {
  0% {
    background-position: -2000px 0;
  }
  100% {
    background-position: 2000px 0;
  }
}

@keyframes spin {
  from { 
    transform: rotate(0deg); 
  }
  to { 
    transform: rotate(360deg); 
  }
}

@keyframes progress {
  from { 
    width: 0; 
  }
  to { 
    width: var(--progress-width, 100%); 
  }
}

@keyframes morph {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  50% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
}

@keyframes glitch {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-2px, -2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
  100% {
    transform: translate(0);
  }
}

/* --- ANIMATION DE TEXTE AMELIOREE --- */
@keyframes smooth-typing {
  0% {
    width: 0;
    opacity: 0;
    transform: translateY(10px);
  }
  10% {
    opacity: 1;
    transform: translateY(0);
  }
  90% {
    opacity: 1;
  }
  100% {
    width: 100%;
    opacity: 1;
  }
}

@keyframes text-glow {
  0%, 100% {
    text-shadow: 0 0 20px rgba(61, 139, 255, 0.5),
                 0 0 40px rgba(61, 139, 255, 0.3),
                 0 0 60px rgba(61, 139, 255, 0.1);
  }
  50% {
    text-shadow: 0 0 30px rgba(61, 139, 255, 0.7),
                 0 0 60px rgba(61, 139, 255, 0.5),
                 0 0 90px rgba(61, 139, 255, 0.3);
  }
}

/* --- ANIMATION DES VAGUES INVERSEES --- */
@keyframes wave-inverse {
  0% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-25%) translateY(15px);
  }
  100% {
    transform: translateX(0) translateY(0);
  }
}

/* --- ANIMATION DU CURSEUR AMELIOREE --- */
@keyframes cursor-pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.8;
  }
}

/* --- ANIMATION DES PARTICULES BLEUES --- */
@keyframes float-blue {
  0%, 100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 0.6;
  }
  25% {
    transform: translate(20px, -20px) scale(1.1) rotate(90deg);
    opacity: 0.8;
  }
  50% {
    transform: translate(40px, 0) scale(1) rotate(180deg);
    opacity: 0.6;
  }
  75% {
    transform: translate(20px, 20px) scale(0.9) rotate(270deg);
    opacity: 0.4;
  }
}

/* --- CLASSES D'ANIMATION MODERNES --- */
.fade-in-up {
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fade-in-down {
  animation: fadeInDown 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fade-in-left {
  animation: fadeInLeft 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fade-in-right {
  animation: fadeInRight 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.scale-in {
  animation: scaleIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.morph {
  animation: morph 8s ease-in-out infinite;
}

.glitch {
  animation: glitch 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

/* --- DELAYS POUR ANIMATIONS EN CASCADE --- */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

/* --- EFFETS AU SCROLL --- */
.reveal {
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-40px) rotate(-2deg);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-right {
  opacity: 0;
  transform: translateX(40px) rotate(2deg);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --- BACKGROUNDS ANIMÉS AVANCÉS --- */
.animated-gradient {
  background: linear-gradient(
    45deg,
    var(--navy),
    var(--electric-blue),
    var(--electric-blue-light),
    var(--navy)
  );
  background-size: 400% 400%;
  animation: gradient-blue-shift 15s ease infinite;
}

.mesh-gradient {
  background: 
    radial-gradient(circle at 20% 50%, rgba(31, 128, 255, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(66, 153, 255, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(0, 83, 207, 0.1) 0%, transparent 50%),
    var(--darker-bg);
  background-size: 400% 400%;
  animation: gradient-blue-shift 20s ease infinite;
}

/* --- SÉPARATEURS DE SECTION --- */
.section-divider {
  position: relative;
  height: 120px;
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(61, 139, 255, 0.05) 20%,
    rgba(61, 139, 255, 0.1) 50%,
    rgba(61, 139, 255, 0.05) 80%,
    transparent
  );
}

.section-divider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(61, 139, 255, 0.3),
    transparent
  );
  animation: shimmer 3s linear infinite;
}

/* --- EFFET SHIMMER --- */
.shimmer {
  background: linear-gradient(
    90deg,
    rgba(61, 139, 255, 0.1) 25%,
    rgba(61, 139, 255, 0.3) 50%,
    rgba(61, 139, 255, 0.1) 75%
  );
  background-size: 2000px 100%;
  animation: shimmer 3s infinite linear;
}

/* --- STAGGER CHILDREN --- */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.8s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.9s; }
.stagger-children > *:nth-child(10) { animation-delay: 1s; }

/* --- GRADIENT BORDER ANIMATION --- */
.gradient-border {
  position: relative;
  border-radius: inherit;
}

.gradient-border::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--gradient-primary);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gradient-border:hover::before {
  opacity: 1;
  animation: gradient-blue-shift 2s linear infinite;
}

/* --- PULSE RING EFFECT --- */
.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border: 2px solid var(--electric-blue);
  border-radius: 50%;
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0;
  }
}

/* --- LOADING SPINNER --- */
.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid transparent;
  border-top: 4px solid var(--electric-blue);
  border-right: 4px solid var(--electric-blue);
  border-bottom: 4px solid var(--electric-blue-light);
  border-left: 4px solid var(--electric-blue-light);
  border-radius: 50%;
  animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  position: relative;
}

.spinner::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border: 4px solid transparent;
  border-top: 4px solid rgba(61, 139, 255, 0.3);
  border-right: 4px solid rgba(61, 139, 255, 0.3);
  border-radius: 50%;
  animation: spin 2s linear infinite reverse;
}

/* --- BADGE ANIMÉ --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, rgba(61, 139, 255, 0.2), rgba(102, 166, 255, 0.1));
  color: var(--electric-blue);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid rgba(61, 139, 255, 0.3);
  backdrop-filter: blur(10px);
  animation: pulse 2s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s ease;
}

.badge:hover::before {
  left: 100%;
}

.badge:hover {
  animation: none;
  transform: scale(1.05);
  border-color: var(--electric-blue);
}

/* --- ANIMATION DE TEXTE --- */
.text-reveal {
  position: relative;
  overflow: hidden;
}

.text-reveal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  transform: translateX(-100%);
  animation: text-reveal 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes text-reveal {
  to {
    transform: translateX(101%);
  }
}

/* --- EFFET PARALLAX --- */
.parallax-element {
  transition: transform 0.3s ease-out;
}

/* --- ANIMATION D'ICÔNES --- */
.icon-float {
  animation: float 4s ease-in-out infinite;
}

.icon-float:nth-child(2) {
  animation-delay: 1s;
}

.icon-float:nth-child(3) {
  animation-delay: 2s;
}

.icon-float:nth-child(4) {
  animation-delay: 3s;
}

/* --- LOADING BAR ANIMATION --- */
.loading-bar {
  height: 4px;
  background: linear-gradient(90deg, 
    transparent,
    var(--electric-blue),
    var(--electric-blue-light),
    transparent
  );
  background-size: 200% 100%;
  animation: loading 2s linear infinite;
}

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

/* --- GLITCH EFFECT ON HOVER --- */
.hover-glitch {
  position: relative;
  transition: all 0.3s ease;
}

.hover-glitch:hover {
  animation: glitch 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1;
}

/* --- FLOATING ELEMENTS GRID --- */
.floating-grid > * {
  animation: float 6s ease-in-out infinite;
}

.floating-grid > *:nth-child(2) { animation-delay: 1s; }
.floating-grid > *:nth-child(3) { animation-delay: 2s; }
.floating-grid > *:nth-child(4) { animation-delay: 3s; }
.floating-grid > *:nth-child(5) { animation-delay: 4s; }
.floating-grid > *:nth-child(6) { animation-delay: 5s; }

/* --- TOOLTIP MODERNE --- */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 150%;
  left: 50%;
  transform: translateX(-50%) translateY(10px) scale(0.9);
  padding: 1rem 1.5rem;
  background: rgba(10, 24, 41, 0.95);
  backdrop-filter: blur(10px);
  color: var(--white);
  border-radius: 12px;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  min-width: 200px;
  text-align: center;
}

.tooltip::after {
  content: '';
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%) translateY(10px) scale(0.9);
  border: 8px solid transparent;
  border-top-color: var(--glass-border);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tooltip:hover::before,
.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}