/* Optimized Animations CSS */

/* Base animation keyframes */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translate3d(0, -20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translate3d(-20px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translate3d(20px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes breathe {
  0% {
    transform: scale(1);
    opacity: 0.2;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.25;
  }
  100% {
    transform: scale(1);
    opacity: 0.2;
  }
}

/* Optimized animation classes */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
  will-change: opacity;
}

.fade-in:nth-child(1) {
  animation-delay: 0.2s;
}

.fade-in:nth-child(2) {
  animation-delay: 0.3s;
}

.fade-in:nth-child(3) {
  animation-delay: 0.4s;
}

.fade-in:nth-child(4) {
  animation-delay: 0.5s;
}

.fade-in:nth-child(5) {
  animation-delay: 0.6s;
}

/* Optimized AOS (Animate On Scroll) */
[data-aos] {
  transition-property: transform, opacity;
  transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1.0);
  transition-duration: 0.6s;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

[data-aos="fade-up"] {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
}

[data-aos="fade-down"] {
  opacity: 0;
  transform: translate3d(0, -20px, 0);
}

[data-aos="fade-left"] {
  opacity: 0;
  transform: translate3d(-20px, 0, 0);
}

[data-aos="fade-right"] {
  opacity: 0;
  transform: translate3d(20px, 0, 0);
}

[data-aos="zoom-in"] {
  opacity: 0;
  transform: scale3d(0.9, 0.9, 1);
}

[data-aos].aos-animate {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
}

/* Optimized blur circle animations */
.blur-circle {
  will-change: transform, opacity;
}

.blur-circle-1,
.blur-circle-3,
.blur-circle-5,
.blur-circle-7 {
  animation: breathe 8s infinite ease-in-out;
}

.blur-circle-2,
.blur-circle-4,
.blur-circle-6,
.blur-circle-8 {
  animation: breathe 10s infinite ease-in-out;
  animation-delay: 1s;
}

/* Hero image animation */
.hero-image {
  animation: float 6s ease-in-out infinite;
  will-change: transform;
}

/* Scroll button animation */
.scroll-button i {
  animation: bounce 2s infinite;
  will-change: transform;
}

/* Page load animation */
body:not(.loaded) [data-aos] {
  opacity: 0;
}

body.loaded [data-aos].aos-animate {
  transition-delay: 0.1s;
}

/* Staggered animations for cards */
.service-card[data-aos],
.project-card[data-aos],
.testimonial-card[data-aos],
.feature-card[data-aos],
.contact-item[data-aos] {
  transition-duration: 0.4s;
}

/* Hover animations */
.service-card:hover,
.project-card:hover,
.testimonial-card:hover {
  transform: translateY(-8px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.social-link:hover,
.footer-social-link:hover {
  transform: scale(1.1) rotate(5deg);
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
  transition: width 0.3s ease;
}

.project-link:hover i {
  transform: translateX(4px);
  transition: transform 0.3s ease;
}

.footer-nav-link:hover {
  transform: translateX(5px);
  transition: transform 0.3s ease, color 0.3s ease;
}

/* Reduced animation for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

