/* Enhanced Scroll-Triggered Animations */
/* Professional and smooth animations for AeroSys Engineering */

/* ===== BASE ANIMATION CLASSES ===== */

/* Fade in from bottom with smooth easing */
.animate-fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-fade-in.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Slide in from left */
.animate-slide-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: all 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-slide-left.animate-in {
  opacity: 1;
  transform: translateX(0);
}

/* Slide in from right */
.animate-slide-right {
  opacity: 0;
  transform: translateX(60px);
  transition: all 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-slide-right.animate-in {
  opacity: 1;
  transform: translateX(0);
}

/* Scale and fade in */
.animate-scale-in {
  opacity: 0;
  transform: scale(0.8) translateY(30px);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-scale-in.animate-in {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ===== TEXT ANIMATIONS ===== */

/* Staggered text reveal */
.animate-text-stagger {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-text-stagger.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Typewriter effect for headings */
@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--color-secondary); }
}

.animate-typewriter {
  overflow: hidden;
  border-right: 2px solid var(--color-secondary);
  white-space: nowrap;
  animation:
    typewriter 2s steps(40, end),
    blink-caret 0.75s step-end infinite;
}

/* ===== IMAGE ANIMATIONS ===== */

/* Image reveal with scale */
.animate-image-reveal {
  opacity: 0;
  transform: scale(1.1) rotate(2deg);
  transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
}

.animate-image-reveal.animate-in {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Image slide reveal */
.animate-image-slide {
  position: relative;
  overflow: hidden;
}

.animate-image-slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  transition: left 0.8s ease-out;
}

.animate-image-slide.animate-in::before {
  left: 100%;
}

/* ===== CARD ANIMATIONS ===== */

/* Card entrance with hover effect */
.animate-card-entrance {
  opacity: 0;
  transform: translateY(50px) rotateX(10deg);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-card-entrance.animate-in {
  opacity: 1;
  transform: translateY(0) rotateX(0deg);
}

.animate-card-entrance:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

/* Staggered card animation */
.animate-card-stagger {
  opacity: 0;
  transform: translateY(60px) scale(0.9);
  transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-card-stagger.animate-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ===== ADVANCED ANIMATIONS ===== */

/* Parallax scroll effect */
.animate-parallax {
  transform: translateY(0);
  transition: transform 0.3s ease-out;
}

.animate-parallax[data-speed] {
  will-change: transform;
}

/* Floating animation */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Pulse glow effect */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(212, 169, 55, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(212, 169, 55, 0.8);
  }
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ===== STAGGERED ANIMATIONS ===== */

/* Staggered children animation */
.animate-stagger-children > * {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-stagger-children.animate-in > *:nth-child(1) {
  animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.animate-stagger-children.animate-in > *:nth-child(2) {
  animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s forwards;
}

.animate-stagger-children.animate-in > *:nth-child(3) {
  animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s forwards;
}

.animate-stagger-children.animate-in > *:nth-child(4) {
  animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s forwards;
}

.animate-stagger-children.animate-in > *:nth-child(5) {
  animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s forwards;
}

/* ===== KEYFRAME ANIMATIONS ===== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(100px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== UTILITY CLASSES ===== */

/* Animation delays */
.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-400 { animation-delay: 0.4s; }
.animate-delay-500 { animation-delay: 0.5s; }

/* Animation durations */
.animate-duration-300 { animation-duration: 0.3s; }
.animate-duration-500 { animation-duration: 0.5s; }
.animate-duration-700 { animation-duration: 0.7s; }
.animate-duration-1000 { animation-duration: 1s; }

/* ===== MOBILE OPTIMIZATIONS ===== */

/* Mobile optimizations - only disable performance-heavy animations */
@media (max-width: 768px) {
  .animate-image-reveal,
  .animate-parallax,
  .animate-pulse-glow,
  .animate-float {
    animation: none;
    opacity: 1;
    transform: none;
  }

  /* Keep essential animations but reduce delays */
  .animate-stagger-children > * {
    animation-delay: 0s;
  }
}

/* ===== ACCESSIBILITY ===== */

/* Respect user's motion preferences */
@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;
  }

  .animate-fade-in,
  .animate-slide-left,
  .animate-slide-right,
  .animate-scale-in,
  .animate-text-stagger,
  .animate-image-reveal,
  .animate-card-entrance,
  .animate-card-stagger {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* Use will-change for better performance */
.animate-fade-in,
.animate-slide-left,
.animate-slide-right,
.animate-scale-in {
  will-change: transform, opacity;
}

.animate-fade-in.animate-in,
.animate-slide-left.animate-in,
.animate-slide-right.animate-in,
.animate-scale-in.animate-in {
  will-change: auto;
}
