/*
 * ============================================================
 *  AutoPrime — Cars Browse Page CSS
 *  cars.css
 *
 *  Depends on: autoprime-frontend.css (must load first)
 *  Used by: resources/views/frontend/cars.blade.php
 *
 *  Sections:
 *   1. Cars Hero Banner
 *   2. Filter Bar
 *   3. Car Grid Cards
 *   4. Car Detail Popup (centred modal overlay)
 *   5. Booking Modal (stacked over detail popup)
 *   6. Responsive Overrides
 * ============================================================
 */


/* ============================================================
   1. CARS HERO BANNER — shorter dark banner for the cars page
   ============================================================ */

.hero-trendy {
  background: linear-gradient(130deg, #101d33 0%, #182b4b 50%, #1d3557 100%);
  min-height: 55vh;
  display: flex;
  align-items: center;
  position: relative;
  isolation: isolate;
}

/* Faint car photo overlay for visual depth */
.hero-trendy::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?q=80&w=1983&auto=format&fit=crop')
              center / cover no-repeat;
  opacity: 0.2;
  z-index: -1;
  mix-blend-mode: overlay;
}

/* Glassmorphism stat cards inside dark hero */
.stat-modern {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 32px;
  padding: 1.8rem 0.8rem;
  color: #fff;
}

/* Large gradient number inside stat card */
.stat-modern .number {
  font-size: 2.6rem;
  font-weight: 700;
  background: linear-gradient(120deg, #fff, #d3e2ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* ============================================================
   2. FILTER BAR — search / fuel / price row
   ============================================================ */

/* Floating white card above the car grid */
.filter-bar {
  background: #fff;
  border-radius: 24px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 24px -10px rgba(20, 40, 80, 0.1);
  border: 1px solid #f0f3fa;
}

/* Pill-shaped inputs inside filter */
.filter-bar .form-control,
.filter-bar .form-select {
  border-radius: 50px;
  border: 1.5px solid var(--ap-border);
  padding: 0.6rem 1.2rem;
  font-size: 0.88rem;
  transition: border-color 0.2s;
}

.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
  border-color: var(--ap-navy);
  box-shadow: 0 0 0 3px rgba(30, 43, 79, 0.08);
}


/* ============================================================
   3. CAR GRID CARDS
   ============================================================ */

/* White rounded car listing card */
.car-card-modern {
  background: #fff;
  border-radius: 32px;
  padding: 1rem 1rem 1.5rem;
  box-shadow: var(--ap-shadow-card);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.02);
  cursor: pointer;
  height: 100%;
}

.car-card-modern:hover {
  transform: scale(1.02) translateY(-6px);
  box-shadow: 0 30px 45px -15px #0b1a33;
}

/* Car thumbnail — scales slightly on hover */
.car-card-modern img {
  border-radius: 24px;
  height: 200px;
  object-fit: cover;
  width: 100%;
  transition: transform 0.4s ease;
}

.car-card-modern:hover img {
  transform: scale(1.03);
}

/* Featured star badge overlay on thumbnail */
.featured-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--ap-navy);
  color: #fbbf24;
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
}


/* ============================================================
   4. CAR DETAIL POPUP — centred fullscreen modal
   ============================================================ */

/* Full-screen blurred backdrop */
.modal-fullscreen-modern {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 30, 45, 0.75);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1.5rem;
}

/* Main detail card */
.modal-card-modern {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 48px;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 40px 70px -10px #020617;
  padding: 2rem 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  scrollbar-width: thin;
  scrollbar-color: #7f8fa3 transparent;
}

.modal-card-modern::-webkit-scrollbar       { width: 6px; }
.modal-card-modern::-webkit-scrollbar-thumb { background: #7f8fa3; border-radius: 20px; }

/* Circular close button */
.close-modal {
  background: #fff;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  font-size: 1.1rem;
  color: var(--ap-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.close-modal:hover {
  background: var(--ap-navy);
  color: #fff;
}

/* Thumbnail image strip in popup */
.modal-thumb {
  width: 68px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  opacity: 0.65;
}

.modal-thumb:hover,
.modal-thumb.active {
  border-color: var(--ap-navy);
  opacity: 1;
}

/* Feature keyword tags */
.feat-pill {
  display: inline-block;
  background: #f0f4ff;
  color: var(--ap-navy);
  border-radius: 50px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.28rem 0.85rem;
  margin: 0.2rem;
}

/* Spec chip row + chips */
.spec-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.spec-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f5f7fb;
  border: 1px solid var(--ap-border);
  border-radius: 50px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  color: var(--ap-text);
  font-weight: 500;
}

.spec-chip i { color: var(--ap-navy); }


/* ============================================================
   5. BOOKING MODAL — stacked over detail popup (z-index: 3000)
   ============================================================ */

/* Slightly darker backdrop for second modal layer */
.book-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Compact booking card */
.book-card {
  background: #fff;
  border-radius: 32px;
  max-width: 560px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 30px 60px -10px #020617;
  padding: 2rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.book-card::-webkit-scrollbar       { width: 5px; }
.book-card::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* Input fields inside booking card */
.book-card .form-control,
.book-card .form-select {
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  font-size: 0.88rem;
  transition: border-color 0.2s;
}

.book-card .form-control:focus,
.book-card .form-select:focus {
  border-color: var(--ap-navy);
  box-shadow: 0 0 0 3px rgba(30, 43, 79, 0.08);
}


/* ============================================================
   6. RESPONSIVE OVERRIDES
   ============================================================ */

@media (max-width: 768px) {
  .modal-card-modern {
    border-radius: 28px;
    padding: 1.5rem;
    max-height: 95vh;
  }

  .hero-trendy {
    min-height: 45vh;
  }
}

@media (max-width: 480px) {
  .car-card-modern img {
    height: 160px;
  }
}


/* ============================================================
   LIVE FILTER BAR
   ============================================================ */

.live-filter-bar {
  background: white;
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
  border: 1.5px solid var(--ap-border);
}

/* Row 1 ── search + selects + count */
.lfb-row1 {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Search box */
.lfb-search-wrap {
  position: relative;
  flex: 1 1 260px;
  min-width: 200px;
}
.lfb-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ap-muted);
  font-size: .88rem;
  pointer-events: none;
}
.lfb-search {
  width: 100%;
  border: 1.5px solid var(--ap-border);
  border-radius: 50px;
  padding: 10px 38px 10px 38px;
  font-size: .9rem;
  font-family: inherit;
  color: var(--ap-navy);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.lfb-search:focus {
  border-color: var(--ap-navy);
  box-shadow: 0 0 0 3px rgba(30,43,79,.08);
}
.lfb-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--ap-muted);
  font-size: .78rem;
  cursor: pointer;
  display: none;
  padding: 2px 4px;
}

/* Selects */
.lfb-select {
  flex: 0 0 auto;
  min-width: 140px;
  border: 1.5px solid var(--ap-border);
  border-radius: 50px;
  padding: 10px 36px 10px 16px;
  font-size: .88rem;
  font-family: inherit;
  color: var(--ap-navy);
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%231e2b4f' d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") no-repeat right 14px center;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
}
.lfb-select:focus { border-color: var(--ap-navy); }

/* Result count */
.lfb-count {
  margin-left: auto;
  font-size: .85rem;
  color: var(--ap-muted);
  white-space: nowrap;
  font-weight: 500;
}
.lfb-count #liveCountNum { font-weight: 800; color: var(--ap-navy); font-size: 1.05rem; }

/* Row 2 ── price range slider */
.lfb-price-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1.5px solid var(--ap-border);
  flex-wrap: wrap;
}

.lfb-price-label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ap-navy);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Slider track container */
.lfb-slider-wrap {
  position: relative;
  flex: 1 1 200px;
  height: 36px;
  display: flex;
  align-items: center;
  min-width: 160px;
}

.lfb-track {
  position: absolute;
  left: 0; right: 0;
  height: 5px;
  background: var(--ap-border);
  border-radius: 10px;
  pointer-events: none;
}

.lfb-range-fill {
  position: absolute;
  height: 100%;
  background: var(--ap-navy);
  border-radius: 10px;
}

/* Both range inputs stacked */
.lfb-range {
  position: absolute;
  left: 0; right: 0;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  height: 5px;
  outline: none;
}
.lfb-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 2.5px solid var(--ap-navy);
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: transform .15s;
}
.lfb-range::-webkit-slider-thumb:hover { transform: scale(1.2); }
.lfb-range::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: white;
  border: 2.5px solid var(--ap-navy);
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* Price value labels */
.lfb-price-vals {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.lfb-price-tag {
  background: var(--ap-bg);
  border: 1.5px solid var(--ap-border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--ap-navy);
  min-width: 72px;
  text-align: center;
}
.lfb-price-sep { color: var(--ap-muted); font-size: .85rem; }

.lfb-reset-btn {
  background: none;
  border: 1.5px solid var(--ap-border);
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem;
  color: var(--ap-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .2s, color .2s;
}
.lfb-reset-btn:hover { border-color: var(--ap-navy); color: var(--ap-navy); }

/* No-results message */
.live-no-results {
  display: none;
  text-align: center;
  padding: 60px 20px;
  grid-column: 1/-1;
}
.live-no-results i { font-size: 3rem; color: #cbd5e1; }
.live-no-results h5 { color: #475569; margin-top: 14px; font-weight: 700; }
.live-no-results p  { color: #94a3b8; font-size: .9rem; }
.live-no-results button {
  margin-top: 16px;
  background: var(--ap-navy);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 28px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}

/* Card hide animation */
.car-card-col {
  transition: opacity .18s, transform .18s;
}
.car-card-col.hidden {
  display: none;
}

@media (max-width: 576px) {
  .lfb-row1 { flex-direction: column; align-items: stretch; }
  .lfb-count { margin-left: 0; }
  .lfb-price-row { flex-direction: column; align-items: stretch; }
  .lfb-price-vals { justify-content: center; }
}
