/* css/style.css */

/* ::::::::::::::::::::::::::::::::::::::::::::::
   1. GLOBAL & VARIABLES
   :::::::::::::::::::::::::::::::::::::::::::::: */
:root {
  --jbl-blue: #15304e;
  --jbl-red: #ce1e20;
  --jbl-dark-blue: #0f233a;
  --jbl-light: #f8fafc;

  /* PREMIUM PHYSICS EASING (The Secret Sauce) */
  /* Starts fast, slows down gently */
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  /* Bouncy but controlled */
  --ease-out-back: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

html {
  scroll-padding-top: 100px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased; /* Sharper text on Mac */
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-feature-settings: "cv11", "ss01";
  overflow-x: hidden; /* Prevent horizontal scroll triggers */
}

/* Brand Selection Color */
::selection {
  background-color: var(--jbl-red);
  color: #ffffff;
}

/* ::::::::::::::::::::::::::::::::::::::::::::::
   2. CUSTOM UTILITIES & BUTTONS
   :::::::::::::::::::::::::::::::::::::::::::::: */

.post-hero-section {
  padding-top: 8rem !important;
}

/* Enhanced Glassmorphism */
.glass-nav {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
  transition: all 0.4s var(--ease-out-expo);
}

.text-shadow {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* --- MODERN BUTTONS (Physics Based) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 4px;
  transition: all 0.6s var(--ease-out-expo); /* Slower, smoother transition */
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-align: center;
  z-index: 1;
}

.btn-primary {
  background-color: var(--jbl-red);
  color: white;
  box-shadow: 0 10px 30px -10px rgba(206, 30, 32, 0.4);
}

.btn-primary:hover {
  background-color: #b91517;
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -10px rgba(206, 30, 32, 0.5);
}

.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px -5px rgba(206, 30, 32, 0.5);
  transition-duration: 0.1s;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: white;
  backdrop-filter: blur(4px);
}

.btn-outline:hover {
  background-color: white;
  color: var(--jbl-blue);
  border-color: white;
  transform: translateY(-4px);
  box-shadow: 0 15px 35px -10px rgba(255, 255, 255, 0.3);
}

/* ::::::::::::::::::::::::::::::::::::::::::::::
   3. COMPONENT STYLES
   :::::::::::::::::::::::::::::::::::::::::::::: */

/* --- Navigation Links --- */
.nav-link {
  position: relative;
  font-weight: 500;
  transition: color 0.3s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--jbl-red);
  transition: width 0.4s var(--ease-out-expo);
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* --- Social & Contact Icons (Rounded) --- */
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: all 0.4s var(--ease-out-back); /* Bouncy effect */
  backface-visibility: hidden;
}

.social-icon:hover {
  background-color: var(--jbl-red);
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 8px 20px rgba(206, 30, 32, 0.3);
}

/* Header Contact Info Pills */
.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 50px;
  background-color: rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.contact-pill:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* --- Cards (Super Smooth Hover) --- */
.service-card {
  transition:
    transform 0.5s var(--ease-out-expo),
    box-shadow 0.5s var(--ease-out-expo),
    border-color 0.3s ease;
  will-change: transform;
}
.service-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 25px 50px -12px rgba(21, 48, 78, 0.15);
  border-color: rgba(206, 30, 32, 0.1);
}
.service-card:hover .icon-box {
  background-color: var(--jbl-red);
  color: white;
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 15px 30px rgba(206, 30, 32, 0.25);
  transition: all 0.5s var(--ease-out-expo);
}

.fleet-card img {
  transition: transform 1.2s var(--ease-out-expo);
  will-change: transform;
}
.fleet-card:hover img {
  transform: scale(1.15);
}

/* --- Forms --- */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--jbl-blue);
  box-shadow: 0 0 0 4px rgba(21, 48, 78, 0.1);
  transition:
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

/* ::::::::::::::::::::::::::::::::::::::::::::::
   4. SCROLLBAR & ANIMATIONS
   :::::::::::::::::::::::::::::::::::::::::::::: */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: var(--jbl-blue);
  border-radius: 10px;
  border: 2px solid #f1f1f1;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--jbl-red);
}

/* Fade Up Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
.animate-fade-in-up {
  animation-name: fadeInUp;
  animation-duration: 1.2s;
  animation-timing-function: var(--ease-out-expo);
  animation-fill-mode: both;
}

/* Truck Animation */
@keyframes drive-right {
  0% {
    transform: translateX(-15vw);
  }
  100% {
    transform: translateX(105vw);
  }
}
@keyframes bounce-truck {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

.moving-truck {
  animation: drive-right 25s linear infinite;
  will-change: transform;
  z-index: 20;
  pointer-events: none;
  position: absolute;
  bottom: -1px;
  left: 0;
}

.truck-icon {
  display: inline-block;
  animation: bounce-truck 0.6s ease-in-out infinite;
  color: var(--jbl-red);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Preloader */
#preloader {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}
.loader-spin {
  border: 3px solid rgba(21, 48, 78, 0.1);
  border-top: 3px solid var(--jbl-red);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Toast */
#toast {
  visibility: hidden;
  min-width: 300px;
  background-color: var(--jbl-blue);
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 16px 24px;
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 20px);
  opacity: 0;
  transition: all 0.5s var(--ease-out-expo);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
  font-weight: 600;
  letter-spacing: 0.02em;
}
#toast.show {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
  bottom: 50px;
}

/* ::::::::::::::::::::::::::::::::::::::::::::::
   5. GSAP HELPERS & SLIDER CSS
   :::::::::::::::::::::::::::::::::::::::::::::: */

.gs-reveal {
  opacity: 0;
  transform: translateY(50px);
  /* IMPORTANT: Hints browser to prepare GPU for these props */
  will-change: opacity, transform;
}

/* Fallback if JS is disabled */
@media (prefers-reduced-motion: reduce) {
  .gs-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* HERO SLIDER (Premium) */
.hero-slider-container {
  position: relative;
  height: 90vh;
  width: 100%;
  overflow: hidden;
  background-color: #0f172a;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  /* Extremely slow crossfade for premium feel */
  transition:
    opacity 1.8s ease-in-out,
    visibility 1.8s;
  z-index: 0;
  will-change: opacity;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 10;
}

/* Ken Burns Effect */
.slide-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1);
  /* 20s slow zoom */
  transition: transform 20s ease-out;
  will-change: transform;
}

.hero-slide.active .slide-image {
  transform: scale(1.15);
}

/* Text Content Staggered Reveal */
.slide-content {
  opacity: 0;
  transform: translateY(40px);
  transition: all 1.4s var(--ease-out-expo);
  transition-delay: 0.3s;
}

.hero-slide.active .slide-content {
  opacity: 1;
  transform: translateY(0);
}

/* Individual elements delay */
.hero-slide.active .slide-content h1 {
  transition-delay: 0.4s;
}
.hero-slide.active .slide-content p {
  transition-delay: 0.6s;
}
.hero-slide.active .slide-content .btns {
  transition-delay: 0.8s;
}

/* Progress Bar Loader */
.slide-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  width: 0%;
  will-change: width;
}

.slide-control.active .slide-progress-bar {
  width: 100%;
  transition: width 6s linear; /* Matches JS interval */
}

/* Hover Slide Up Helper */
.hover-slide-up {
  transition:
    transform 0.5s var(--ease-out-expo),
    box-shadow 0.5s var(--ease-out-expo);
}
.hover-slide-up:hover {
  transform: translateY(-12px);
  box-shadow: 0 25px 50px -10px rgba(21, 48, 78, 0.15);
}
