/* ==========================================================================
   Bellad Tata Motors — Premium Animation Stylesheet
   Companion to js/animations.js. Every rule is additive and non-breaking;
   elements animate only when the JS engine is present and motion is allowed.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. SCROLL PROGRESS BAR
   -------------------------------------------------------------------------- */
#scrollProgressBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent-orange, #f07c01), #ffb36b);
  box-shadow: 0 0 12px rgba(240, 124, 1, 0.55);
  z-index: 99999;
  pointer-events: none;
  transition: width 0.1s linear;
}

/* --------------------------------------------------------------------------
   2. 3D TILT CARDS — parent needs perspective so children transform cleanly
   -------------------------------------------------------------------------- */
.tilt-wrap,
[data-tilt-wrap] {
  perspective: 1000px;
}

.tilt,
.tilt-card,
.loc-card,
[data-tilt],
.tiltable {
  transform-style: preserve-3d;
  will-change: transform;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

/* --------------------------------------------------------------------------
   3. BUTTON SHINE SWEEP
   -------------------------------------------------------------------------- */
.btn-shine,
.loc-btn-solid,
.btn-luxury,
.cta-btn,
.btn-primary,
.btn-custom {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn-shine::after,
.loc-btn-solid::after,
.btn-luxury::after,
.cta-btn::after,
.btn-primary::after,
.btn-custom::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
  transform: skewX(-20deg);
  z-index: 1;
  opacity: 0;
  pointer-events: none;
}

.btn-shine.shining::after,
.loc-btn-solid.shining::after,
.btn-luxury.shining::after,
.cta-btn.shining::after,
.btn-primary.shining::after,
.btn-custom.shining::after {
  animation: btnShineSweep 0.65s ease forwards;
}

@keyframes btnShineSweep {
  0% {
    left: -80%;
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    left: 130%;
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   4. CURSOR SPOTLIGHT GLOW — sections opt in with data-glow
   -------------------------------------------------------------------------- */
[data-glow] {
  position: relative;
  overflow: hidden;
}

[data-glow]::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  left: var(--glow-x, -100px);
  top: var(--glow-y, -100px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 124, 1, 0.09) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  transition: left 0.15s ease-out, top 0.15s ease-out;
}

/* --------------------------------------------------------------------------
   5. MARQUEE — duplicate track handled by JS; CSS provides the loop
   -------------------------------------------------------------------------- */
.marquee-track,
.scroll-marquee,
.marquee-inner,
[data-marquee] {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  animation: marqueeScroll var(--marquee-speed, 30s) linear infinite;
  will-change: transform;
}

.marquee-track:hover,
.scroll-marquee:hover,
.marquee-inner:hover,
[data-marquee]:hover {
  animation-play-state: paused;
}

@keyframes marqueeScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* --------------------------------------------------------------------------
   6. ANIMATED ACCENT GRADIENT TEXT
   -------------------------------------------------------------------------- */
.text-gradient-cyan,
.text-gradient,
.gradient-text {
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --------------------------------------------------------------------------
   7. NAVBAR HIDE-ON-SCROLL
   -------------------------------------------------------------------------- */
#mainNavbar.nav-hidden {
  transform: translateY(-100%);
}

#mainNavbar {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s ease, box-shadow 0.4s ease;
}

/* --------------------------------------------------------------------------
   8. ACCESSIBILITY — kill motion for reduced-motion users
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  #scrollProgressBar,
  .marquee-track,
  .scroll-marquee,
  .marquee-inner,
  [data-marquee],
  .btn-shine::after,
  .loc-btn-solid::after,
  .btn-luxury::after,
  .cta-btn::after,
  .btn-primary::after,
  .btn-custom::after {
    animation: none !important;
    transition: none !important;
  }

  .tilt,
  .tilt-card,
  .loc-card,
  [data-tilt],
  .tiltable {
    transform: none !important;
  }
}
