/* ========================================
   ANIMATIONS & EFFECTS
   Keyframes, Transitions, Scroll Reveals
   ======================================== */

/* ========================================
   GRADIENT SHIFT ANIMATION
   ======================================== */

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ========================================
   SCROLL REVEAL ANIMATIONS
   Safe, non-breaking animations that only use opacity and transform
   ======================================== */

/* Base animation - Fade up (default) */
[data-animate] {
  opacity: 0;
  transform: translateY(45px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fade from left */
[data-animate="fade-left"] {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate="fade-left"].is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Fade from right */
[data-animate="fade-right"] {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate="fade-right"].is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale up (zoom in) */
[data-animate="scale-up"] {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate="scale-up"].is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Fade in (simple) */
[data-animate="fade"] {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate="fade"].is-visible {
  opacity: 1;
}

/* Stagger children animations */
[data-animate-children] > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate-children].is-visible > *:nth-child(1) { 
  transition-delay: 0.1s; 
}
[data-animate-children].is-visible > *:nth-child(2) { 
  transition-delay: 0.2s; 
}
[data-animate-children].is-visible > *:nth-child(3) { 
  transition-delay: 0.3s; 
}
[data-animate-children].is-visible > *:nth-child(4) { 
  transition-delay: 0.4s; 
}
[data-animate-children].is-visible > *:nth-child(5) { 
  transition-delay: 0.5s; 
}
[data-animate-children].is-visible > *:nth-child(6) { 
  transition-delay: 0.6s; 
}

[data-animate-children].is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   ACCESSIBILITY: Respect reduced motion preference
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  [data-animate],
  [data-animate="fade-left"],
  [data-animate="fade-right"],
  [data-animate="scale-up"],
  [data-animate="fade"],
  [data-animate-children] > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ========================================
   MOBILE OPTIMIZATIONS
   Reduce animation complexity on mobile for better performance
   ======================================== */

@media (max-width: 768px) {
  /* Simplify animations - only fade, no transform */
  [data-animate],
  [data-animate="fade-left"],
  [data-animate="fade-right"],
  [data-animate="scale-up"] {
    transform: none !important;
    transition: opacity 0.4s ease !important;
  }
  
  [data-animate].is-visible,
  [data-animate="fade-left"].is-visible,
  [data-animate="fade-right"].is-visible,
  [data-animate="scale-up"].is-visible {
    transform: none !important;
  }
  
  /* Simplify stagger animations */
  [data-animate-children] > * {
    transform: none !important;
    transition: opacity 0.3s ease !important;
  }
  
  [data-animate-children].is-visible > * {
    transform: none !important;
  }
  
  /* Reduce stagger delays */
  [data-animate-children].is-visible > *:nth-child(1) { 
    transition-delay: 0.05s; 
  }
  [data-animate-children].is-visible > *:nth-child(2) { 
    transition-delay: 0.1s; 
  }
  [data-animate-children].is-visible > *:nth-child(3) { 
    transition-delay: 0.15s; 
  }
  [data-animate-children].is-visible > *:nth-child(4) { 
    transition-delay: 0.2s; 
  }
  [data-animate-children].is-visible > *:nth-child(5) { 
    transition-delay: 0.25s; 
  }
  [data-animate-children].is-visible > *:nth-child(6) { 
    transition-delay: 0.3s; 
  }
}

/* ========================================
   MARQUEE ANIMATION
   ======================================== */

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ========================================
   PULSE EFFECT (for future use)
   ======================================== */

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ========================================
   FADE IN (for future use)
   ======================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ========================================
   SLIDE UP (for future use)
   ======================================== */

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
