/* ==========================================================================
   DRIVEON — Luxury Car Rental Platform
   Animations & Cinematic Motion Stylesheet
   ========================================================================== */

/* ==========================================================================
   1. CINEMATIC PRELOADER
   ========================================================================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
}

.preloader-curtain {
  position: absolute;
  top: 0;
  width: 50.5%;
  height: 100%;
  background: #040404;
  z-index: 1;
  transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.preloader-curtain-left {
  left: 0;
  border-right: 1px solid rgba(198, 161, 91, 0.3);
}

.preloader-curtain-right {
  right: 0;
  border-left: 1px solid rgba(198, 161, 91, 0.3);
}

.preloader.is-loaded .preloader-curtain-left {
  transform: translateX(-100%);
}

.preloader.is-loaded .preloader-curtain-right {
  transform: translateX(100%);
}

.preloader.is-loaded {
  pointer-events: none;
}

.preloader-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.preloader.is-loaded .preloader-content {
  opacity: 0;
  transform: scale(0.95);
}

.preloader-brand {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.55em;
  color: var(--ivory);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: flex;
  overflow: hidden;
}

.preloader-brand span {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  animation: letterReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.preloader-brand span:nth-child(1) { animation-delay: 0.1s; }
.preloader-brand span:nth-child(2) { animation-delay: 0.2s; }
.preloader-brand span:nth-child(3) { animation-delay: 0.3s; }
.preloader-brand span:nth-child(4) { animation-delay: 0.4s; }
.preloader-brand span:nth-child(5) { animation-delay: 0.5s; }
.preloader-brand span:nth-child(6) { animation-delay: 0.6s; }
.preloader-brand span:nth-child(7) { animation-delay: 0.7s; }

.preloader-tagline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  color: var(--gold-primary);
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeIn 0.8s ease 0.8s forwards;
}

/* Luxury Soundwave Visualizer */
.preloader-visualizer {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  margin-bottom: 2rem;
}

.sound-bar {
  width: 2px;
  height: 100%;
  background: var(--gold-primary);
  border-radius: 2px;
  animation: soundPulse 1.2s ease-in-out infinite alternate;
}

.sound-bar:nth-child(1) { animation-delay: 0.1s; height: 30%; }
.sound-bar:nth-child(2) { animation-delay: 0.3s; height: 65%; }
.sound-bar:nth-child(3) { animation-delay: 0.5s; height: 100%; }
.sound-bar:nth-child(4) { animation-delay: 0.2s; height: 80%; }
.sound-bar:nth-child(5) { animation-delay: 0.4s; height: 45%; }
.sound-bar:nth-child(6) { animation-delay: 0.6s; height: 90%; }
.sound-bar:nth-child(7) { animation-delay: 0.15s; height: 50%; }

.preloader-progress-wrap {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.preloader-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--gold-primary);
  transition: width 0.1s linear;
}

.preloader-counter {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ivory);
  margin-top: 1rem;
}

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

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

@keyframes soundPulse {
  0% { transform: scaleY(0.2); opacity: 0.4; }
  100% { transform: scaleY(1); opacity: 1; }
}

/* ==========================================================================
   2. HERO SECTION & CAR DRIVE-IN
   ========================================================================== */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  padding-bottom: 6rem;
  overflow: hidden;
  background: radial-gradient(circle at 75% 50%, #161410 0%, #080808 45%, #050505 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 10;
  min-height: calc(100vh - var(--header-height) - 6rem);
}

.hero-content {
  position: relative;
  z-index: 10;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 1.25rem;
  background: rgba(198, 161, 91, 0.1);
  border: 1px solid var(--gold-border);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 1.75rem;
}

.hero-badge-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
  animation: pulseGold 2s infinite;
}

.hero-title {
  font-size: clamp(3rem, 7.5vw, 6.8rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
  text-transform: uppercase;
}

.hero-title .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  filter: blur(10px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo), filter 0.7s ease;
}

.hero-title.revealed .char {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.hero-desc {
  font-size: 1.25rem;
  color: var(--ivory-muted);
  max-width: 520px;
  margin-bottom: 2.75rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Hero Stage & Drive-in Car */
.hero-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 550px;
  height: 350px;
  background: radial-gradient(ellipse, rgba(198, 161, 91, 0.18) 0%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
}

.hero-car-wrapper {
  position: relative;
  width: 100%;
  max-width: 720px;
  z-index: 5;
  will-change: transform, filter;
}

/* Drive-in animation simulation */
.hero-car-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.95));
  position: relative;
  z-index: 2;
  user-select: none;
  pointer-events: none;
}

.hero-car-drive-in {
  transform: translateX(-140%) scale(0.9);
  filter: blur(8px);
  opacity: 0;
  animation: driveInCinematic 1.8s cubic-bezier(0.16, 1, 0.3, 1) 1.2s forwards;
}

@keyframes driveInCinematic {
  0% {
    transform: translateX(-140%) scale(0.9);
    filter: blur(12px);
    opacity: 0;
  }
  60% {
    transform: translateX(3%) scale(1.02);
    filter: blur(1px);
    opacity: 1;
  }
  80% {
    transform: translateX(-1%) scale(0.99);
    filter: blur(0);
  }
  100% {
    transform: translateX(0) scale(1);
    filter: blur(0);
    opacity: 1;
  }
}

/* Headlight Beam Simulation */
.headlight-beam {
  position: absolute;
  top: 45%;
  left: -20%;
  width: 250px;
  height: 120px;
  background: radial-gradient(ellipse at 80% 50%, rgba(245, 241, 232, 0.6) 0%, rgba(229, 201, 133, 0.2) 40%, transparent 80%);
  transform: rotate(-15deg);
  pointer-events: none;
  opacity: 0;
  animation: headlightFlicker 1.4s ease 2.8s forwards;
  z-index: 6;
}

@keyframes headlightFlicker {
  0% { opacity: 0; }
  30% { opacity: 0.7; }
  45% { opacity: 0.2; }
  60% { opacity: 0.9; }
  100% { opacity: 0.75; }
}

/* Wheel rotation effect */
.wheel-blur-effect {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
  animation: wheelSpin 1.8s cubic-bezier(0.16, 1, 0.3, 1) 1.2s forwards;
}

@keyframes wheelSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(720deg); }
}

/* Road Dust Effect */
.car-ground-shadow {
  position: absolute;
  bottom: 5%;
  left: 10%;
  width: 80%;
  height: 25px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9) 0%, transparent 75%);
  filter: blur(6px);
  z-index: 1;
}

/* ==========================================================================
   3. SCROLL-DRIVEN CAR SECTION
   ========================================================================== */
.scroll-car-section {
  position: relative;
  padding: 8rem 0;
  background: #070707;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

.scroll-track-container {
  position: relative;
  width: 100%;
  height: 280px;
  margin: 4rem 0 2rem;
  display: flex;
  align-items: center;
}

.scroll-track-line {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-border), var(--gold-primary), var(--gold-border), transparent);
  transform: translateY(-50%);
}

.scroll-driven-car {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 320px;
  height: auto;
  z-index: 10;
  will-change: transform;
}

.scroll-marker {
  position: absolute;
  top: calc(50% + 20px);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  transform: translateX(-50%);
}

.scroll-marker.start { left: 5%; }
.scroll-marker.mid { left: 50%; }
.scroll-marker.end { left: 95%; }

/* ==========================================================================
   4. ROAD JOURNEY SECTION
   ========================================================================== */
.road-journey-section {
  padding: 8rem 0;
  background: #050505;
  position: relative;
  overflow: hidden;
}

.road-scene-wrap {
  position: relative;
  width: 100%;
  height: 440px;
  background: #0c0c0c;
  border-radius: var(--radius-md);
  border: 1px solid var(--gold-border);
  overflow: hidden;
  margin-top: 3rem;
  display: flex;
  align-items: center;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.9);
}

.road-perspective {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #111 0%, #181818 50%, #0a0a0a 100%);
}

/* Moving Highway Lines */
.road-dashed-lines {
  position: absolute;
  top: 50%;
  left: 0;
  width: 200%;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--gold-primary) 0, var(--gold-primary) 60px, transparent 60px, transparent 120px);
  animation: highwayMove 2s linear infinite;
  transform: translateY(-50%);
  opacity: 0.6;
}

@keyframes highwayMove {
  0% { transform: translate(0, -50%); }
  100% { transform: translate(-50%, -50%); }
}

.journey-car-actor {
  position: absolute;
  left: 15%;
  top: 45%;
  transform: translateY(-50%);
  width: 320px;
  z-index: 10;
  transition: transform 0.2s ease-out;
}

.journey-destination-markers {
  position: absolute;
  bottom: 2rem;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  padding: 0 4rem;
  z-index: 15;
}

.dest-marker {
  text-align: center;
  background: rgba(11, 11, 11, 0.85);
  border: 1px solid var(--gold-border);
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-xs);
  backdrop-filter: blur(12px);
}

.dest-city {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--ivory);
}

.dest-distance {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gold-primary);
}

/* ==========================================================================
   5. LUXURY GARAGE REVEAL
   ========================================================================== */
.garage-reveal-section {
  position: relative;
  min-height: 80vh;
  background: #030303;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

.garage-doors-container {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 20;
  pointer-events: none;
}

.garage-door {
  width: 50%;
  height: 100%;
  background: linear-gradient(135deg, #0e0e0e 0%, #060606 100%);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  position: relative;
  transition: transform 1.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.garage-door-left {
  justify-content: flex-end;
  border-right: 2px solid var(--gold-primary);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
}

.garage-door-right {
  justify-content: flex-start;
  border-left: 2px solid var(--gold-primary);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
}

.garage-doors-container.opened .garage-door-left {
  transform: translateX(-100%);
}

.garage-doors-container.opened .garage-door-right {
  transform: translateX(100%);
}

.garage-chamber {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 4rem 2rem;
}

.garage-spotlight {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 100%;
  background: radial-gradient(ellipse at 50% 0%, rgba(198, 161, 91, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.garage-reveal-car {
  max-width: 820px;
  margin: 0 auto 2.5rem;
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.95));
  transition: transform 1.2s var(--ease-out-expo);
}

/* ==========================================================================
   6. HORIZONTAL SCROLL CAR SHOWCASE
   ========================================================================== */
.horizontal-scroll-section {
  position: relative;
  overflow: hidden;
  background: #080808;
  padding: 6rem 0;
}

.horizontal-track-wrap {
  overflow: hidden;
  width: 100%;
  cursor: grab;
}

.horizontal-track-wrap:active {
  cursor: grabbing;
}

.horizontal-fleet-container {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  padding: 2rem var(--container-pad);
  will-change: transform;
}

.horizontal-car-panel {
  width: clamp(340px, 45vw, 560px);
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 2.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition-fast), transform var(--transition-smooth);
}

.horizontal-car-panel:hover {
  border-color: var(--gold-border-bright);
  transform: translateY(-6px);
}

.panel-car-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-xs);
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   7. FLY TO CART ANIMATION & WISHLIST
   ========================================================================== */
.flying-cart-ghost {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  border: 1px solid var(--gold-primary);
  box-shadow: 0 10px 30px rgba(198, 161, 91, 0.4);
  transition: all 0.9s cubic-bezier(0.25, 1, 0.5, 1);
}

.cart-icon-bounce {
  animation: cartBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cartBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.35) rotate(-10deg); color: var(--gold-primary); }
}

.wishlist-heart-pop {
  animation: heartPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); color: var(--gold-primary); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   8. STATS COUNTER
   ========================================================================== */
.stats-section {
  padding: 6rem 0;
  background: #050505;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem;
  text-align: center;
}

.stat-item {
  position: relative;
}

.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -1.5rem;
  top: 20%;
  height: 60%;
  width: 1px;
  background: var(--border-subtle);
}

.stat-number {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 6vw, 4.8rem);
  font-weight: 600;
  color: var(--ivory);
  line-height: 1;
  margin-bottom: 0.75rem;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-primary);
}

/* ==========================================================================
   9. PAGE TRANSITION OVERLAY
   ========================================================================== */
.page-transition-curtain {
  position: fixed;
  inset: 0;
  background: #040404;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(100%);
  transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.3s ease;
}

.page-transition-curtain.active {
  pointer-events: all;
  opacity: 1;
  transform: translateY(0%);
}

.page-transition-logo {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  letter-spacing: 0.35em;
  color: var(--gold-primary);
  text-transform: uppercase;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.4s ease 0.2s;
}

.page-transition-curtain.active .page-transition-logo {
  opacity: 1;
  transform: scale(1);
}

/* Pulse animation utility */
@keyframes pulseGold {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(198, 161, 91, 0.6); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(198, 161, 91, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(198, 161, 91, 0); }
}
