/* ===== ANIMATIONS CSS FLUIDES ET ESTHÉTIQUES ===== */

/* ===== VARIABLES D'ANIMATION ===== */
:root {
  --animation-duration: 0.6s;
  --animation-duration-slow: 1s;
  --animation-duration-fast: 0.3s;
  --easing-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --easing-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ===== SCROLL ANIMATIONS FLUIDES ===== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(60px);
  transition: all 1s var(--easing-smooth);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-80px);
  transition: all 1s var(--easing-smooth);
}

.scroll-reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(80px);
  transition: all 1s var(--easing-smooth);
}

.scroll-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-scale {
  opacity: 0;
  transform: scale(0.8) translateY(30px);
  transition: all 1s var(--easing-smooth);
}

.scroll-reveal-scale.revealed {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.scroll-reveal-rotate {
  opacity: 0;
  transform: rotate(-10deg) scale(0.9);
  transition: all 1.2s var(--easing-smooth);
}

.scroll-reveal-rotate.revealed {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ===== HOVER ANIMATIONS FLUIDES ===== */
.hover-lift {
  transition: all var(--animation-duration) var(--easing-smooth);
  will-change: transform, box-shadow;
}

.hover-lift:hover {
  transform: translateY(-15px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.hover-scale {
  transition: all var(--animation-duration) var(--easing-smooth);
  will-change: transform;
}

.hover-scale:hover {
  transform: scale(1.08);
}

.hover-rotate {
  transition: all var(--animation-duration) var(--easing-smooth);
  will-change: transform;
}

.hover-rotate:hover {
  transform: rotate(8deg) scale(1.05);
}

.hover-glow {
  transition: all var(--animation-duration) var(--easing-smooth);
  position: relative;
  overflow: hidden;
}

.hover-glow::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.8s var(--easing-smooth);
}

.hover-glow:hover::before {
  left: 100%;
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(var(--primary-color-rgb), 0.3);
}

/* ===== BUTTON ANIMATIONS AVANCÉES ===== */
.btn {
  position: relative;
  overflow: hidden;
  transition: all var(--animation-duration) var(--easing-smooth);
  will-change: transform, box-shadow;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.6s var(--easing-smooth);
}

.btn:hover::before {
  width: 400px;
  height: 400px;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(-1px);
  transition: all 0.1s ease;
}

.btn-pulse {
  animation: btnPulse 2s var(--easing-smooth) infinite;
}

@keyframes btnPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.7);
  }
  50% {
    box-shadow: 0 0 0 20px rgba(var(--primary-color-rgb), 0);
  }
}

.btn-bounce {
  animation: btnBounce 2s var(--easing-bounce) infinite;
}

@keyframes btnBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

/* ===== CARD ANIMATIONS FLUIDES ===== */
.card {
  transition: all var(--animation-duration) var(--easing-smooth);
  will-change: transform, box-shadow;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity var(--animation-duration) var(--easing-smooth);
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-icon {
  transition: all var(--animation-duration) var(--easing-bounce);
}

.card:hover .card-icon {
  transform: scale(1.2) rotate(10deg);
}

/* ===== NAVIGATION ANIMATIONS ===== */
.nav-link {
  position: relative;
  transition: all var(--animation-duration-fast) var(--easing-smooth);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: all var(--animation-duration-fast) var(--easing-smooth);
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link:hover {
  transform: translateY(-2px);
}

/* ===== HERO ANIMATIONS ===== */
.hero-content {
  animation: heroSlideIn 1.2s var(--easing-smooth) both;
}

@keyframes heroSlideIn {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-text h1 {
  animation: heroTitleSlide 1.5s var(--easing-smooth) 0.3s both;
}

@keyframes heroTitleSlide {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero-text p {
  animation: heroTextSlide 1.5s var(--easing-smooth) 0.6s both;
}

@keyframes heroTextSlide {
  from {
    opacity: 0;
    transform: translateX(-80px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero-cta {
  animation: heroCtaSlide 1.5s var(--easing-smooth) 0.9s both;
}

@keyframes heroCtaSlide {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-image {
  animation: heroImageSlide 1.8s var(--easing-smooth) 0.4s both;
}

@keyframes heroImageSlide {
  from {
    opacity: 0;
    transform: translateX(100px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* ===== SECTION ANIMATIONS ===== */
.section-header {
  animation: sectionHeaderSlide 1s var(--easing-smooth) both;
}

@keyframes sectionHeaderSlide {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-title {
  animation: sectionTitleSlide 1.2s var(--easing-smooth) 0.2s both;
}

@keyframes sectionTitleSlide {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-subtitle {
  animation: sectionSubtitleSlide 1.2s var(--easing-smooth) 0.4s both;
}

@keyframes sectionSubtitleSlide {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== GRID STAGGER ANIMATIONS ===== */
.grid-2 > *, .grid-3 > *, .grid-4 > * {
  animation: gridItemSlide 1s var(--easing-smooth) both;
}

.grid-2 > *:nth-child(1) { animation-delay: 0.1s; }
.grid-2 > *:nth-child(2) { animation-delay: 0.2s; }

.grid-3 > *:nth-child(1) { animation-delay: 0.1s; }
.grid-3 > *:nth-child(2) { animation-delay: 0.2s; }
.grid-3 > *:nth-child(3) { animation-delay: 0.3s; }

.grid-4 > *:nth-child(1) { animation-delay: 0.1s; }
.grid-4 > *:nth-child(2) { animation-delay: 0.2s; }
.grid-4 > *:nth-child(3) { animation-delay: 0.3s; }
.grid-4 > *:nth-child(4) { animation-delay: 0.4s; }

@keyframes gridItemSlide {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== FLOATING ANIMATIONS ===== */
.floating {
  animation: floating 4s ease-in-out infinite;
}

@keyframes floating {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(2deg);
  }
}

.floating-slow {
  animation: floating 6s ease-in-out infinite;
}

.floating-fast {
  animation: floating 2s ease-in-out infinite;
}

/* ===== PULSE ANIMATIONS ===== */
.pulse {
  animation: pulse 3s var(--easing-smooth) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.7);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(var(--primary-color-rgb), 0);
  }
}

/* ===== LOADING ANIMATIONS ===== */
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-dots {
  display: inline-block;
}

.loading-dots::after {
  content: '';
  animation: dots 2s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% {
    content: '.';
  }
  40% {
    content: '..';
  }
  60% {
    content: '...';
  }
  80%, 100% {
    content: '';
  }
}

/* ===== TYPEWRITER EFFECT ===== */
.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--primary-color);
  white-space: nowrap;
  animation: typewriter 4s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary-color);
  }
}

/* ===== COUNTER ANIMATION ===== */
.counter {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-color);
  transition: all var(--animation-duration) var(--easing-smooth);
}

.counter:hover {
  transform: scale(1.1);
  text-shadow: 0 0 20px rgba(var(--primary-color-rgb), 0.5);
}

/* ===== PROGRESS BAR ANIMATION ===== */
.progress-bar {
  width: 100%;
  height: 10px;
  background: linear-gradient(90deg, #f0f0f0, #e0e0e0);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 10px;
  transform: translateX(-100%);
  transition: transform 2s var(--easing-smooth);
  position: relative;
  overflow: hidden;
}

.progress-fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressShine 2s ease-in-out infinite;
}

.progress-fill.animate {
  transform: translateX(0);
}

@keyframes progressShine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ===== MORPHING SHAPES ===== */
.morphing-shape {
  width: 120px;
  height: 120px;
  background: var(--gradient-primary);
  border-radius: 50%;
  animation: morphing 5s var(--easing-smooth) infinite;
  filter: blur(1px);
}

@keyframes morphing {
  0%, 100% {
    border-radius: 50%;
    transform: rotate(0deg) scale(1);
  }
  25% {
    border-radius: 30%;
    transform: rotate(90deg) scale(1.1);
  }
  50% {
    border-radius: 0%;
    transform: rotate(180deg) scale(0.9);
  }
  75% {
    border-radius: 30%;
    transform: rotate(270deg) scale(1.1);
  }
}

/* ===== GLITCH EFFECT ===== */
.glitch {
  position: relative;
  animation: glitch 3s infinite;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  animation: glitch-1 0.6s infinite;
  color: #ff0000;
  z-index: -1;
}

.glitch::after {
  animation: glitch-2 0.6s infinite;
  color: #00ff00;
  z-index: -2;
}

@keyframes glitch {
  0%, 100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-3px, 3px);
  }
  40% {
    transform: translate(-3px, -3px);
  }
  60% {
    transform: translate(3px, 3px);
  }
  80% {
    transform: translate(3px, -3px);
  }
}

@keyframes glitch-1 {
  0%, 100% {
    transform: translate(0);
  }
  20% {
    transform: translate(3px, -3px);
  }
  40% {
    transform: translate(-3px, 3px);
  }
  60% {
    transform: translate(-3px, -3px);
  }
  80% {
    transform: translate(3px, 3px);
  }
}

@keyframes glitch-2 {
  0%, 100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-3px, -3px);
  }
  40% {
    transform: translate(3px, -3px);
  }
  60% {
    transform: translate(3px, 3px);
  }
  80% {
    transform: translate(-3px, 3px);
  }
}

/* ===== TEXT ANIMATIONS ===== */
.text-reveal {
  overflow: hidden;
  position: relative;
}

.text-reveal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-color);
  transform: translateX(-100%);
  animation: textReveal 1.5s var(--easing-smooth) both;
}

@keyframes textReveal {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ===== ICON ANIMATIONS ===== */
.icon-spin {
  animation: iconSpin 2s linear infinite;
}

@keyframes iconSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.icon-bounce {
  animation: iconBounce 1s var(--easing-bounce) infinite;
}

@keyframes iconBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ===== FORM ANIMATIONS ===== */
.form-input {
  transition: all var(--animation-duration) var(--easing-smooth);
}

.form-input:focus {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ===== RESPONSIVE ANIMATIONS ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}