/* =============================================
   NEXT-LEVEL BADASS ANIMATIONS
   World-class motion design
   ============================================= */

/* Smooth scroll with momentum */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* ==================== 
   PARTICLE EFFECTS 
   ==================== */
@keyframes particleFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.6;
  }
  25% {
    transform: translate(10px, -10px) scale(1.05);
    opacity: 0.8;
  }
  50% {
    transform: translate(-5px, -20px) scale(0.95);
    opacity: 1;
  }
  75% {
    transform: translate(-10px, -10px) scale(1.02);
    opacity: 0.7;
  }
}

/* ==================== 
   CARD ENTRANCE ANIMATIONS 
   ==================== */
@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(60px) scale(0.9) rotateX(10deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0deg);
  }
}

@keyframes cardPop {
  0% {
    opacity: 0;
    transform: scale(0.8) rotateZ(-5deg);
  }
  50% {
    transform: scale(1.05) rotateZ(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateZ(0deg);
  }
}

/* ==================== 
   TEXT ANIMATIONS 
   ==================== */
@keyframes textGlow {
  0%, 100% {
    text-shadow: 0 0 20px rgba(255, 193, 7, 0.3),
                 0 0 40px rgba(255, 193, 7, 0.2);
  }
  50% {
    text-shadow: 0 0 30px rgba(255, 193, 7, 0.6),
                 0 0 60px rgba(255, 193, 7, 0.4),
                 0 0 80px rgba(255, 193, 7, 0.2);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ==================== 
   HOVER MICRO-INTERACTIONS 
   ==================== */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::after {
  width: 300px;
  height: 300px;
  transition: width 0s, height 0s;
}

/* Card tilt effect */
.product-card,
.solution-card,
.mission-card {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.product-card.active:hover {
  transform: translate(-50%, -50%) scale(1) perspective(1000px) rotateY(2deg) rotateX(-2deg) !important;
}

/* ==================== 
   LOADING ANIMATIONS 
   ==================== */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #f8f8f8 50%,
    #f0f0f0 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
}

/* ==================== 
   SCROLL-TRIGGERED REVEALS 
   ==================== */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Staggered reveals */
.stagger-children > * {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }

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

/* ==================== 
   PARALLAX SCROLL EFFECTS 
   ==================== */
.parallax-element {
  transition: transform 0.1s ease-out;
  will-change: transform;
}

/* ==================== 
   CAROUSEL ENHANCEMENTS 
   ==================== */
@keyframes carouselGlow {
  0%, 100% {
    box-shadow: 0 30px 80px rgba(10, 95, 122, 0.35),
                0 0 0 1px rgba(10, 95, 122, 0.1),
                0 0 40px rgba(10, 95, 122, 0);
  }
  50% {
    box-shadow: 0 35px 90px rgba(10, 95, 122, 0.45),
                0 0 0 1px rgba(10, 95, 122, 0.2),
                0 0 60px rgba(10, 95, 122, 0.3);
  }
}

.product-card.active {
  animation: carouselGlow 3s ease-in-out infinite;
}

/* Smooth card transitions */
.product-card {
  transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==================== 
   NUMBER COUNTER ANIMATION 
   ==================== */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat strong,
.stat-value {
  animation: countUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==================== 
   IMAGE EFFECTS 
   ==================== */
.card-image-wrapper {
  position: relative;
  overflow: hidden;
}

.card-image-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
  z-index: 1;
}

.product-card.active:hover .card-image-wrapper::before {
  left: 100%;
}

/* Image zoom on hover */
.card-image-wrapper img,
.interior img,
.gallery-grid img {
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.product-card.active:hover .card-image-wrapper img,
.interior:hover img,
.gallery-grid figure:hover img {
  transform: scale(1.1);
}

/* ==================== 
   BUTTON HOVER EFFECTS 
   ==================== */
.btn {
  position: relative;
  z-index: 1;
}

.btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

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

/* ==================== 
   NAVBAR EFFECTS 
   ==================== */
.site-header {
  transition: all 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.98);
}

/* Nav links hover effect */
.nav-links a {
  position: relative;
}

.nav-links a::before {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #ffc107, #ff9800);
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-links a:hover::before {
  width: 100%;
}

/* ==================== 
   WHATSAPP FAB 
   ==================== */
@keyframes fabPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.6),
                0 0 40px rgba(37, 211, 102, 0.3);
  }
}

.whatsapp-fab {
  animation: fabPulse 2s ease-in-out infinite;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.whatsapp-fab:hover {
  animation: none;
  transform: scale(1.15) rotate(10deg);
}

/* ==================== 
   STATS COUNTER EFFECT 
   ==================== */
.stat {
  transform-origin: center;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat:hover {
  transform: translateY(-8px) scale(1.05);
}

/* ==================== 
   SOLUTION CARDS 
   ==================== */
.solution-card {
  opacity: 0;
  animation: cardSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.solution-card:nth-child(1) { animation-delay: 0.1s; }
.solution-card:nth-child(2) { animation-delay: 0.2s; }
.solution-card:nth-child(3) { animation-delay: 0.3s; }
.solution-card:nth-child(4) { animation-delay: 0.4s; }
.solution-card:nth-child(5) { animation-delay: 0.5s; }

/* ==================== 
   HERO ANIMATIONS 
   ==================== */
@keyframes heroFloat {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(30px, -30px) rotate(2deg);
  }
  66% {
    transform: translate(-20px, 20px) rotate(-2deg);
  }
}

.hero::before {
  animation: heroFloat 20s ease-in-out infinite;
}

/* Hero title animation */
@keyframes titleSlide {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero-title {
  animation: titleSlide 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==================== 
   CAROUSEL INDICATORS 
   ==================== */
.carousel-indicators {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 1.5rem 0;
}

.carousel-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(10, 95, 122, 0.3);
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.carousel-indicator::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.3s ease;
}

.carousel-indicator:hover::before {
  background: rgba(10, 95, 122, 0.1);
}

.carousel-indicator.active {
  width: 40px;
  border-radius: 6px;
  background: linear-gradient(90deg, #0a5f7a, #0d7ea8);
  box-shadow: 0 4px 12px rgba(10, 95, 122, 0.4);
}

/* ==================== 
   MOBILE OPTIMIZATIONS 
   ==================== */
@media (max-width: 768px) {
  /* Reduce motion for better performance */
  .product-card.active {
    animation: none;
  }
  
  /* Simpler hover effects */
  .btn:hover {
    transform: translateY(-2px);
  }
  
  /* Touch-friendly animations */
  .carousel-nav:active {
    transform: translateY(-50%) scale(0.9);
  }
}

/* ==================== 
   PERFORMANCE OPTIMIZATIONS 
   ==================== */
.product-card,
.solution-card,
.mission-card,
.btn {
  will-change: transform;
}

/* GPU acceleration */
.card-image-wrapper img,
.interior img {
  transform: translateZ(0);
  backface-visibility: hidden;
}
