/* ===================================
   ANIMATION ENHANCEMENTS
   Clean, non-interfering animations
   =================================== */

/* Smooth fade-in animations */
.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

.slide-up {
  animation: slideUp 0.8s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Stagger delays for multiple elements */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* Enhanced button hover with lift effect */
.btn {
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
              box-shadow 0.3s ease;
}

.btn:hover {
  transform: translateY(-4px);
}

.btn:active {
  transform: translateY(-2px);
}

/* Smooth scale on card hover */
.product-card,
.solution-card,
.stat,
.mission-card {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.product-card:hover,
.solution-card:hover {
  transform: translateY(-8px) scale(1.02);
}

.stat:hover {
  transform: translateY(-5px) scale(1.03);
}

/* Reveal animation for scroll */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Smooth image loading */
img.lazy {
  opacity: 0;
  transition: opacity 0.4s ease-in;
}

img.lazy.loaded {
  opacity: 1;
}

/* Number counter animation */
@keyframes countUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.stat strong {
  display: inline-block;
  animation: countUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Pulse effect for WhatsApp button */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
  }
}

.whatsapp-fab {
  animation: pulse 2s ease-in-out infinite;
}

/* Smooth underline effect for nav links */
.nav-links a {
  position: relative;
}

.nav-links a::after {
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Card tilt effect on hover */
.product-card.active {
  animation: float 3s ease-in-out infinite;
}

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

/* Gradient animation for hero */
.hero::before {
  animation: gradientFloat 15s ease-in-out infinite;
}

@keyframes gradientFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(20px, -20px) scale(1.1);
    opacity: 0.8;
  }
}

/* Smooth transitions for interior images */
.interior {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.4s ease;
}

.interior:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Loading skeleton (optional) */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Page transition effect */
body {
  animation: pageLoad 0.6s ease-out;
}

@keyframes pageLoad {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Carousel navigation button hover */
.carousel-nav {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.carousel-nav:hover {
  transform: translateY(-50%) scale(1.15);
}

/* Stats grid animation */
.stats .stat {
  animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(var(--i, 0) * 0.15s);
}

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

/* Add stagger to stats */
.stats .stat:nth-child(1) { --i: 0; }
.stats .stat:nth-child(2) { --i: 1; }
.stats .stat:nth-child(3) { --i: 2; }

/* Solution cards entrance */
.solution-card {
  opacity: 0;
  transform: translateY(30px);
  animation: slideUp 0.7s ease-out forwards;
  animation-delay: calc(var(--i, 0) * 0.1s);
}

.solutions-grid .solution-card:nth-child(1) { --i: 0; }
.solutions-grid .solution-card:nth-child(2) { --i: 1; }
.solutions-grid .solution-card:nth-child(3) { --i: 2; }
.solutions-grid .solution-card:nth-child(4) { --i: 3; }
.solutions-grid .solution-card:nth-child(5) { --i: 4; }

/* Enhanced Product Carousel Animations */
.product-card.active {
  animation: float 3s ease-in-out infinite, cardGlow 2s ease-in-out infinite;
}

@keyframes cardGlow {
  0%, 100% {
    box-shadow: 0 30px 80px rgba(10, 95, 122, 0.35), 0 0 0 1px rgba(10, 95, 122, 0.1);
  }
  50% {
    box-shadow: 0 35px 90px rgba(10, 95, 122, 0.45), 0 0 0 1px rgba(10, 95, 122, 0.2), 0 0 30px rgba(10, 95, 122, 0.1);
  }
}

/* Carousel indicator dots (optional enhancement) */
.carousel-indicators {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 2rem;
}

.carousel-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(10, 95, 122, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}

.carousel-indicator.active {
  background: var(--accent);
  width: 30px;
  border-radius: 5px;
}

/* Mobile touch feedback and optimizations */
@media (max-width: 768px) {
  .carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
  }
  
  .product-card.active {
    animation: mobileFloat 3s ease-in-out infinite;
    box-shadow: 0 20px 60px rgba(10, 95, 122, 0.3), 0 0 0 1px rgba(10, 95, 122, 0.1) !important;
  }
  
  @keyframes mobileFloat {
    0%, 100% {
      transform: translate(-50%, -50%) scale(1) translateY(0);
    }
    50% {
      transform: translate(-50%, -50%) scale(1) translateY(-6px);
    }
  }
  
  /* Make active card more prominent on mobile */
  .product-card.active::before {
    opacity: 1;
    height: 5px;
  }
  
  /* Adjust carousel indicators for mobile */
  .carousel-indicators {
    margin-top: 1.5rem;
    gap: 10px;
  }
  
  .carousel-indicator {
    width: 12px;
    height: 12px;
  }
  
  .carousel-indicator.active {
    width: 36px;
  }
}
