/* ============================================
   ANIMATIONS MODERNES - Joseph Pirrera
   ============================================ */

/* === ANIMATIONS AU SCROLL === */
[data-aos] {
  pointer-events: auto;
}

/* Sans JavaScript (ou avant son exécution), aos.css masque les blocs [data-aos] :
   la classe no-js est retirée par un script inline en tête de <head> dès que JS tourne. */
.no-js [data-aos] {
  opacity: 1 !important;
  transform: none !important;
}

/* === HOVER EFFECTS AVANCÉS === */

/* Effet de levée 3D sur les cartes */
.card-3d {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.card-3d:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 25px 50px -12px rgba(0, 51, 102, 0.35);
}

/* Effet de brillance au survol */
.shine-effect {
  position: relative;
  overflow: hidden;
}

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

.shine-effect:hover::before {
  left: 100%;
}

/* Effet de gradient animé sur les boutons */
.btn-gradient-animated {
  background: linear-gradient(
    135deg,
    #F5A623 0%,
    #CF8418 50%,
    #F5A623 100%
  );
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
  transition: all 0.3s ease;
}

.btn-gradient-animated:hover {
  background-size: 150% 150%;
  animation-duration: 1.5s;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(245, 166, 35, 0.5);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* === EFFETS DE TEXTE === */

/* Effet de soulignement animé */
.underline-animated {
  position: relative;
  display: inline-block;
}

.underline-animated::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #F5A623, #CF8418);
  transition: width 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border-radius: 2px;
}

.underline-animated:hover::after {
  width: 100%;
}

/* Effet de typing pour les titres */
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  50% { border-color: transparent; }
}

.typing-effect {
  overflow: hidden;
  border-right: 3px solid #F5A623;
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

/* === EFFETS DE FOND === */

/* Gradient animé en arrière-plan */
.bg-gradient-animated {
  background: linear-gradient(
    -45deg,
    #001F4D,
    #003366,
    #0A4A87,
    #0B2F5B
  );
  background-size: 400% 400%;
  animation: gradientBg 15s ease infinite;
}

@keyframes gradientBg {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Effet de particules flottantes */
.floating-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(245, 166, 35, 0.3);
  animation: float-particle 20s infinite;
}

@keyframes float-particle {
  0% {
    transform: translateY(100vh) translateX(0) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) translateX(100px) scale(1);
    opacity: 0;
  }
}

/* === EFFETS DE CHARGEMENT === */

/* Skeleton loader */
.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

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

/* Ripple effect sur les boutons */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
}

/* === COMPTEURS ANIMÉS === */
.counter {
  font-variant-numeric: tabular-nums;
  transition: all 0.3s ease;
}

/* === PARALLAX === */
.parallax-element {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* === EFFETS DE BORDURE === */

/* Bordure animée */
.border-animated {
  position: relative;
  border: 2px solid transparent;
}

.border-animated::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, #F5A623, #003366, #F5A623);
  background-size: 200% 200%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: borderRotate 3s linear infinite;
}

@keyframes borderRotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* === EFFETS DE GLASSMORPHISM === */
.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(0, 51, 102, 0.15);
}

/* === ANIMATIONS DE SCROLL === */

/* Barre de progression de lecture */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #F5A623, #CF8418);
  z-index: 9999;
  transition: width 0.1s ease-out;
}

/* === EFFETS DE FOCUS === */
.focus-glow:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.5);
  transition: box-shadow 0.3s ease;
}

/* === ANIMATIONS DE CHARGEMENT === */
.pulse-ring {
  position: relative;
}

.pulse-ring::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #F5A623;
  transform: translate(-50%, -50%);
  animation: pulse-ring-animation 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

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

/* === EFFETS DE HOVER SUR IMAGES === */
.image-zoom {
  overflow: hidden;
}

.image-zoom img {
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.image-zoom:hover img {
  transform: scale(1.1);
}

/* Effet de zoom sur l'image hero */
.hero-image-container {
  overflow: hidden;
  border-radius: 24px;
}

.hero-image-container img {
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.hero-image-container:hover img {
  transform: scale(1.05);
}

/* === SMOOTH SCROLL === */
html {
  scroll-behavior: smooth;
}

/* === TEXTE ROTATIF === */
.rotating-text-container {
  display: inline-block;
  position: relative;
  min-width: 320px;
  height: 1.2em;
  vertical-align: bottom;
  text-align: left;
}

@media (max-width: 640px) {
  .rotating-text-container {
    min-width: 280px;
  }
}

.rotating-text {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  animation: rotateText 12s infinite;
  opacity: 0;
  transform: translateY(20px);
  font-weight: 700;
}

@keyframes rotateText {
  0%, 16.66% {
    opacity: 1;
    transform: translateY(0);
  }
  20%, 100% {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.rotating-text:nth-child(1) { animation-delay: 0s; }
.rotating-text:nth-child(2) { animation-delay: 2s; }
.rotating-text:nth-child(3) { animation-delay: 4s; }
.rotating-text:nth-child(4) { animation-delay: 6s; }
.rotating-text:nth-child(5) { animation-delay: 8s; }
.rotating-text:nth-child(6) { animation-delay: 10s; }

/* === RESPONSIVE === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === UTILITAIRES === */
.transition-all-smooth {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

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

.hover-rotate:hover {
  transform: rotate(5deg);
}
