/* =============================================================================
   ANIMATIONS APPLE-STYLE AVANCÉES POUR TAAKODE
   Animations fluides avec cubic-bezier personnalisés et effets de blur
============================================================================= */

/* Variables d'animation Apple */
:root {
  --apple-timing-1: cubic-bezier(0.4, 0, 0.2, 1);
  --apple-timing-2: cubic-bezier(0.16, 1, 0.3, 1);
  --apple-timing-3: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --apple-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* =============================================================================
   ANIMATIONS KEYFRAMES APPLE
============================================================================= */

/* Apparition avec blur progressif */
@keyframes appleBlurIn {
  0% {
    opacity: 0;
    filter: blur(20px);
    transform: scale(0.9) translateY(40px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1) translateY(0);
  }
}

/* Scale avec blur subtil */
@keyframes appleScaleReveal {
  0% {
    opacity: 0;
    transform: scale(0.85);
    filter: blur(10px) brightness(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0) brightness(1);
  }
}

/* Slide from bottom avec ease custom */
@keyframes appleSlideFade {
  0% {
    opacity: 0;
    transform: translateY(60px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Glow pulsing subtil */
@keyframes appleGlowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(93, 141, 110, 0.15),
                0 0 40px rgba(93, 141, 110, 0.08),
                0 4px 12px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow: 0 0 30px rgba(93, 141, 110, 0.3),
                0 0 60px rgba(93, 141, 110, 0.15),
                0 8px 24px rgba(0, 0, 0, 0.15);
  }
}

/* Rotation 3D subtile */
@keyframes appleRotate3D {
  0% {
    transform: perspective(1000px) rotateY(5deg) rotateX(2deg);
    opacity: 0;
  }
  100% {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
    opacity: 1;
  }
}

/* Float animation douce */
@keyframes appleFloat {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-12px) scale(1.01);
  }
}

/* Shimmer effect Apple */
@keyframes appleShimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* =============================================================================
   CLASSES UTILITAIRES APPLE
============================================================================= */

/* Reveal avec blur */
.apple-blur-reveal {
  animation: appleBlurIn 1s var(--apple-timing-2) both;
}

.apple-blur-reveal-delay-1 {
  animation: appleBlurIn 1s var(--apple-timing-2) 0.1s both;
}

.apple-blur-reveal-delay-2 {
  animation: appleBlurIn 1s var(--apple-timing-2) 0.2s both;
}

.apple-blur-reveal-delay-3 {
  animation: appleBlurIn 1s var(--apple-timing-2) 0.3s both;
}

/* Scale reveal */
.apple-scale {
  animation: appleScaleReveal 0.8s var(--apple-timing-2) both;
}

/* Slide fade */
.apple-slide {
  animation: appleSlideFade 0.8s var(--apple-timing-2) both;
}

/* Glow effect */
.apple-glow {
  animation: appleGlowPulse 3s ease-in-out infinite;
}

/* Float effect */
.apple-float {
  animation: appleFloat 4s ease-in-out infinite;
}

/* =============================================================================
   EFFETS HOVER APPLE
============================================================================= */

/* Hover avec lift et glow */
.apple-lift-hover {
  transition: all 0.6s var(--apple-timing-2);
  will-change: transform, box-shadow;
}

.apple-lift-hover:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 20px 60px rgba(30, 79, 58, 0.2),
              0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Hover avec scale subtil */
.apple-scale-hover {
  transition: transform 0.5s var(--apple-timing-2);
}

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

/* Hover avec blur inversé */
.apple-blur-hover {
  transition: filter 0.4s var(--apple-timing-2);
}

.apple-blur-hover:hover {
  filter: brightness(1.05) contrast(1.02);
}

/* =============================================================================
   EFFETS DE SCROLL APPLE
============================================================================= */

/* Parallaxe layers */
.apple-parallax-slow {
  will-change: transform;
  transition: transform 0.5s var(--apple-timing-3);
}

.apple-parallax-fast {
  will-change: transform;
  transition: transform 0.3s var(--apple-timing-1);
}

/* Sticky header effect */
.apple-sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.4s var(--apple-timing-2);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.apple-sticky-header.scrolled {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

/* =============================================================================
   EFFETS GLASSMORPHISM APPLE
============================================================================= */

.apple-glass {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 0.5px solid rgba(255, 255, 255, 0.3);
}

.apple-glass-dark {
  background: rgba(26, 26, 26, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
}

/* =============================================================================
   BOUTONS STYLE APPLE
============================================================================= */

.btn-apple {
  background: linear-gradient(135deg, #2d5a47 0%, #3d6b54 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s var(--apple-timing-2);
  box-shadow: 0 4px 12px rgba(30, 79, 58, 0.25);
  position: relative;
  overflow: hidden;
}

.btn-apple::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 var(--apple-timing-2);
}

.btn-apple:hover::before {
  left: 100%;
}

.btn-apple:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(30, 79, 58, 0.35),
              0 4px 12px rgba(30, 79, 58, 0.2);
  filter: brightness(1.08);
}

.btn-apple:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(30, 79, 58, 0.3);
}

/* =============================================================================
   CARDS STYLE APPLE
============================================================================= */

.card-apple {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  transition: all 0.6s var(--apple-timing-2);
  border: 1px solid rgba(30, 79, 58, 0.1);
  will-change: transform, box-shadow;
}

.card-apple:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 48px rgba(30, 79, 58, 0.15),
              0 6px 16px rgba(0, 0, 0, 0.1);
  border-color: rgba(30, 79, 58, 0.2);
}

/* =============================================================================
   TEXTE GRADIENT APPLE
============================================================================= */

.text-gradient-apple {
  background: linear-gradient(135deg, 
    var(--sage-green) 0%, 
    var(--olive-green) 50%,
    var(--accent-green) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: appleShimmer 3s linear infinite;
  background-size: 200% auto;
}

/* =============================================================================
   LOADING SPINNER APPLE
============================================================================= */

@keyframes appleSpinnerRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes appleSpinnerDash {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -35px;
  }
  100% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -124px;
  }
}

.apple-spinner {
  width: 40px;
  height: 40px;
  animation: appleSpinnerRotate 2s linear infinite;
}

.apple-spinner circle {
  stroke: var(--accent-green);
  stroke-linecap: round;
  animation: appleSpinnerDash 1.5s ease-in-out infinite;
}

/* =============================================================================
   RESPONSIVE
============================================================================= */

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

@media (max-width: 768px) {
  .apple-lift-hover:hover {
    transform: translateY(-6px) scale(1.01);
  }
  
  .card-apple:hover {
    transform: translateY(-4px) scale(1.01);
  }
}
