/* ============================================
   JHL.ma — Animations CSS
   Reveal, Stagger, Keyframes, Transitions
   ============================================ */

/* ============================================
   REVEAL ANIMATIONS (Intersection Observer)
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s var(--easing-smooth),
              transform 0.7s var(--easing-smooth);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s var(--easing-smooth),
              transform 0.6s var(--easing-smooth);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s var(--easing-smooth),
              transform 0.7s var(--easing-smooth);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s var(--easing-smooth),
              transform 0.7s var(--easing-smooth);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================
   STAGGER ANIMATIONS
   ============================================ */
.stagger-children .reveal:nth-child(1) { transition-delay: 0ms; }
.stagger-children .reveal:nth-child(2) { transition-delay: 100ms; }
.stagger-children .reveal:nth-child(3) { transition-delay: 200ms; }
.stagger-children .reveal:nth-child(4) { transition-delay: 300ms; }
.stagger-children .reveal:nth-child(5) { transition-delay: 400ms; }
.stagger-children .reveal:nth-child(6) { transition-delay: 500ms; }
.stagger-children .reveal:nth-child(7) { transition-delay: 600ms; }
.stagger-children .reveal:nth-child(8) { transition-delay: 700ms; }

/* ============================================
   SPLIT TEXT REVEAL (Hero titles)
   ============================================ */
.split-line {
  display: block;
  overflow: hidden;
}

.split-line span {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  animation: splitReveal 0.8s var(--easing-smooth) forwards;
}

.split-line:nth-child(1) span { animation-delay: 0.2s; }
.split-line:nth-child(2) span { animation-delay: 0.35s; }
.split-line:nth-child(3) span { animation-delay: 0.5s; }

@keyframes splitReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   GRADIENT ANIMATIONS
   ============================================ */
@keyframes meshMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animated-gradient {
  background-size: 200% 200%;
  animation: meshMove 15s ease infinite;
}

/* ============================================
   PULSE ANIMATIONS
   ============================================ */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   DOT PULSE (Badge)
   ============================================ */
@keyframes dotPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.badge__dot {
  animation: dotPulse 2s ease-in-out infinite;
}

/* ============================================
   CREATIVE VECTORS ANIMATIONS
   ============================================ */

/* Float Animation pour icônes code */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

.creative-vector[data-animation="float"] {
  animation: float 4s ease-in-out infinite;
}

/* Pulse Animation pour ampoule */
@keyframes creativePulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.creative-vector[data-animation="pulse"] {
  animation: creativePulse 2.5s ease-in-out infinite;
}

/* Draw Animation pour stylo */
@keyframes draw {
  0%, 100% {
    transform: rotate(0deg) translateX(0);
  }
  25% {
    transform: rotate(-5deg) translateX(-5px);
  }
  75% {
    transform: rotate(5deg) translateX(5px);
  }
}

.creative-vector[data-animation="draw"] {
  animation: draw 3s ease-in-out infinite;
}

/* Color Shift Animation pour palette */
@keyframes colorshift {
  0%, 100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

.creative-vector[data-animation="colorshift"] circle {
  animation: colorshift 2s ease-in-out infinite;
}

.creative-vector[data-animation="colorshift"] circle:nth-child(2) {
  animation-delay: 0.2s;
}

.creative-vector[data-animation="colorshift"] circle:nth-child(3) {
  animation-delay: 0.4s;
}

.creative-vector[data-animation="colorshift"] circle:nth-child(4) {
  animation-delay: 0.6s;
}

.creative-vector[data-animation="colorshift"] circle:nth-child(5) {
  animation-delay: 0.8s;
}

.creative-vector[data-animation="colorshift"] circle:nth-child(6) {
  animation-delay: 1s;
}

/* Move Animation pour curseur */
@keyframes move {
  0%, 100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(15px, -10px);
  }
  50% {
    transform: translate(30px, 5px);
  }
  75% {
    transform: translate(15px, 20px);
  }
}

.creative-vector[data-animation="move"] {
  animation: move 5s ease-in-out infinite;
}

/* Slide Animation pour écran */
@keyframes slide {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(10px);
  }
}

.creative-vector[data-animation="slide"] {
  animation: slide 4s ease-in-out infinite;
}

/* Launch Animation pour fusée */
@keyframes launch {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-25px);
  }
}

.creative-vector[data-animation="launch"] {
  animation: launch 3s ease-in-out infinite;
}

/* Stack Animation pour layers */
@keyframes stack {
  0%, 100% {
    transform: translateY(0);
  }
  33% {
    transform: translateY(-3px);
  }
  66% {
    transform: translateY(3px);
  }
}

.creative-vector[data-animation="stack"] rect:nth-child(1) {
  animation: stack 2s ease-in-out infinite;
  animation-delay: 0s;
}

.creative-vector[data-animation="stack"] rect:nth-child(2) {
  animation: stack 2s ease-in-out infinite;
  animation-delay: 0.2s;
}

.creative-vector[data-animation="stack"] rect:nth-child(3) {
  animation: stack 2s ease-in-out infinite;
  animation-delay: 0.4s;
}

/* Sparkle Animation pour étoiles */
@keyframes sparkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.2) rotate(180deg);
  }
}

.creative-vector[data-animation="sparkle"] {
  animation: sparkle 2s ease-in-out infinite;
}

/* Conteneur des vecteurs créatifs */
.creative-vectors-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.creative-vectors-container svg {
  width: 100%;
  height: 100%;
  opacity: 0.6;
}

/* Responsive : masquer certains vecteurs sur mobile */
@media (max-width: 768px) {
  .creative-vectors-container {
    opacity: 0.3;
  }
  
  /* Masquer quelques vecteurs pour réduire la charge visuelle */
  .creative-vector[data-animation="move"],
  .creative-vector[data-animation="slide"],
  .creative-vector[data-animation="colorshift"] {
    display: none;
  }
}

/* ============================================
   COUNTER ANIMATIONS
   ============================================ */
@keyframes counterPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.counter-animated {
  display: inline-block;
  animation: counterPulse 1s ease-in-out;
}

/* ============================================
   FLOAT ANIMATION
   ============================================ */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* ============================================
   FADE IN
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 1s ease-in;
}

/* ============================================
   ROTATE CONTINUOUS
   ============================================ */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.rotate-slow {
  animation: rotate 20s linear infinite;
}

/* ============================================
   SHIMMER EFFECT (Loading cards)
   ============================================ */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--color-card) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    var(--color-card) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */
.hover-lift {
  transition: transform 0.3s var(--easing-smooth),
              box-shadow 0.3s var(--easing-smooth);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

.hover-scale {
  transition: transform 0.3s var(--easing-smooth);
}

.hover-scale:hover {
  transform: scale(1.02);
}

/* ============================================
   LOADING SPINNER
   ============================================ */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ============================================
   SLIDE IN ANIMATIONS
   ============================================ */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-left {
  animation: slideInLeft 0.8s var(--easing-smooth);
}

.slide-in-right {
  animation: slideInRight 0.8s var(--easing-smooth);
}

/* ============================================
   BOUNCE ON LOAD
   ============================================ */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.bounce-in {
  animation: bounceIn 0.8s var(--easing-smooth);
}

/* ============================================
   GLOW EFFECT
   ============================================ */
@keyframes glow {
  0%, 100% {
    filter: drop-shadow(0 0 5px var(--color-accent));
  }
  50% {
    filter: drop-shadow(0 0 20px var(--color-accent));
  }
}

.glow-pulse {
  animation: glow 2s ease-in-out infinite;
}

/* ============================================
   RESPONSIVE ANIMATION PREFERENCES
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
