/* Animation Fixes - Prevent double animations and ensure smooth transitions */

/* Ensure animations only run once and maintain final state */
.animated-once,
.wow.animate,
[class*="fadeIn"],
[class*="animate__"] {
  animation-fill-mode: forwards !important;
  animation-iteration-count: 1 !important;
}

/* Prevent re-triggering of animations */
.animated-complete {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

/* Fix for elements that might have multiple animation classes */
.wow {
  visibility: visible !important;
}

/* Ensure smooth initial state for animated elements */
[data-wow-delay],
[data-wow-duration] {
  visibility: visible !important;
}

/* Override animate.css defaults to prevent conflicts */
.animate__animated {
  animation-fill-mode: forwards !important;
  animation-iteration-count: 1 !important;
}

/* Disable WOW.js visibility handling since we're not using it */
.wow:not(.animate) {
  visibility: visible !important;
  animation: none !important;
}

/* Ensure fadeIn animations complete properly */
@keyframes fadeInOnce {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fadeIn,
.fadeInUp,
.fadeInDown,
.fadeInLeft,
.fadeInRight {
  animation-name: fadeInOnce !important;
  animation-duration: 0.6s !important;
  animation-fill-mode: forwards !important;
  animation-iteration-count: 1 !important;
}

/* Prevent GSAP ScrollTrigger from conflicting */
[data-gsap],
.gsap-animated {
  will-change: auto !important;
}

/* Fix for portfolio items */
.portfolio-item,
.service-card,
.team-card {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Ensure transitions work properly */
* {
  transition-property: opacity, transform;
  transition-duration: 0.3s;
  transition-timing-function: ease-out;
}

/* Reset any transform issues */
.section-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}