/* ==========================================================================
   TAQWA MOTORS - ADVANCED ANIMATIONS & MICRO-INTERACTIONS
   Smooth Text Entrances, Image Zoom & Hover Physics, Number Counters, 
   Micro-animations & Scroll Reveal Engine
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. KEYFRAME DEFINITIONS
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes pulseGlowRed {
  0% {
    box-shadow: 0 0 10px rgba(211, 47, 47, 0.25);
  }
  50% {
    box-shadow: 0 0 24px rgba(211, 47, 47, 0.6);
  }
  100% {
    box-shadow: 0 0 10px rgba(211, 47, 47, 0.25);
  }
}

@keyframes pulseGlowGreen {
  0% {
    box-shadow: 0 0 8px rgba(37, 211, 102, 0.3);
  }
  50% {
    box-shadow: 0 0 22px rgba(37, 211, 102, 0.7);
  }
  100% {
    box-shadow: 0 0 8px rgba(37, 211, 102, 0.3);
  }
}

@keyframes shimmerSweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes badgePop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   2. SCROLL REVEAL ENGINE
   -------------------------------------------------------------------------- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered Delay Utility Classes */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }

/* --------------------------------------------------------------------------
   3. TEXT ANIMATIONS
   -------------------------------------------------------------------------- */
.hero-badge-wrap {
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-title {
  animation: fadeInUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.hero-subtitle {
  animation: fadeInUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.hero-cta-group {
  animation: fadeInUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.hero-search-box {
  animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

/* Section Title Entrance */
.section-title {
  position: relative;
  display: inline-block;
  transition: transform 0.3s ease;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: badgePop 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Text Hover Micro-interactions */
.nav-link {
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   4. IMAGE ANIMATIONS & HOVER PHYSICS
   -------------------------------------------------------------------------- */
/* Vehicle Card Image Zoom on Hover */
.car-image-container {
  overflow: hidden;
  position: relative;
}

.car-image {
  transition: transform 0.55s cubic-bezier(0.25, 1, 0.5, 1), filter 0.4s ease;
  will-change: transform;
}

.car-card:hover .car-image {
  transform: scale(1.08);
}

/* Image Shimmer / Gleam Effect */
.car-image-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transform: translateX(-100%);
  pointer-events: none;
  transition: transform 0.7s ease;
}

.car-card:hover .car-image-container::after {
  transform: translateX(100%);
}

/* Brand Logo Gentle Floating Animation */
.brand-logo-wrapper {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.brand-logo-wrapper:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 4px 18px rgba(211, 47, 47, 0.45);
}

/* Modal Gallery Image Transitions */
.modal-main-image {
  transition: opacity 0.25s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-thumb {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.gallery-thumb:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------------------------------------
   5. NUMBER COUNTER ANIMATION STYLES
   -------------------------------------------------------------------------- */
.trust-stat-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.trust-stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(211, 47, 47, 0.5);
  box-shadow: 0 8px 24px rgba(211, 47, 47, 0.18);
}

.stat-number {
  font-variant-numeric: tabular-nums;
  display: inline-block;
  transition: transform 0.2s ease;
}

.trust-stat-card:hover .stat-number {
  transform: scale(1.06);
}

/* --------------------------------------------------------------------------
   6. BUTTON & CARD MICRO-INTERACTIONS
   -------------------------------------------------------------------------- */
/* Call Now Button Pulse on Hover */
.btn-call-now {
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-call-now:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(211, 47, 47, 0.4);
}

.btn-call-now:active {
  transform: translateY(0);
}

/* WhatsApp Card Button Hover */
.btn-whatsapp-card {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-whatsapp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
}

/* Filter Tab Buttons Hover & Active Transition */
.tab-btn {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, background-color;
}

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

.tab-btn:active {
  transform: translateY(0) scale(0.97);
}

.tab-btn.active {
  animation: badgePop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Vehicle Cards Grid Item Entrance */
.car-card {
  animation: cardEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}

.car-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
  border-color: rgba(211, 47, 47, 0.35);
}

/* Floating WhatsApp Pulse */
.floating-whatsapp-btn {
  animation: pulseGlowGreen 3.5s infinite, floatGentle 4s ease-in-out infinite;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-whatsapp-btn:hover {
  transform: scale(1.12);
}

/* Pulsing Badge */
.pulse-badge {
  animation: pulseGlowRed 3s infinite;
}

.floating-element {
  animation: floatGentle 4s ease-in-out infinite;
}
