/* ==========================================================================
   Design System & Global Variables - Premium Light Mode
   ========================================================================== */
:root {
  /* Color Palettes */
  --bg-dark: #f6f8fb;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  
  --text-main: #0f172a;       /* Slate 900 */
  --text-muted: #334155;      /* Slate 700 */
  --text-dim: #64748b;        /* Slate 500 */
  
  /* Accent Colors */
  --primary: #4f46e5;         /* Premium Indigo */
  --primary-glow: rgba(79, 70, 229, 0.12);
  --secondary: #0ea5e9;       /* Sky Blue */
  --secondary-glow: rgba(14, 165, 233, 0.12);
  
  /* Deal Rating Colors (Soft premium pastel style for light mode) */
  --color-excellent: #10b981;  /* Emerald */
  --color-excellent-bg: #ecfdf5;
  --color-excellent-text: #047857;
  
  --color-good: #8b5cf6;       /* Violet */
  --color-good-bg: #f5f3ff;
  --color-good-text: #6d28d9;
  
  --color-fair: #3b82f6;       /* Blue */
  --color-fair-bg: #eff6ff;
  --color-fair-text: #1d4ed8;
  
  --color-overpriced: #f59e0b; /* Amber */
  --color-overpriced-bg: #fffbeb;
  --color-overpriced-text: #b45309;
  
  --color-bad: #ef4444;        /* Red */
  --color-bad-bg: #fef2f2;
  --color-bad-text: #b91c1c;

  /* Border and Shadows */
  --border-light: rgba(99, 102, 241, 0.08);
  --border-focus: rgba(79, 70, 229, 0.4);
  --shadow-main: 0 10px 30px -10px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(99, 102, 241, 0.02);
  --shadow-glow: 0 10px 25px rgba(79, 70, 229, 0.08);
}

/* ==========================================================================
   Global Reset & Base Rules
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   Background Ambient Glowing Spheres - Soft Pastels
   ========================================================================== */
.glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.glow-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.3;
  animation: pulse-glow 15s infinite alternate ease-in-out;
}

.glow-1 {
  top: -10%;
  right: 15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #c7d2fe 0%, transparent 70%); /* Light indigo */
}

.glow-2 {
  bottom: 10%;
  left: 5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #bae6fd 0%, transparent 70%); /* Light blue */
  animation-delay: -5s;
}

@keyframes pulse-glow {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.2;
  }
  50% {
    transform: translate(40px, -20px) scale(1.08);
    opacity: 0.35;
  }
  100% {
    transform: translate(-20px, 30px) scale(0.95);
    opacity: 0.2;
  }
}

/* ==========================================================================
   Typography & Layout Containers
   ========================================================================== */
.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.animated-gauge {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 2px 6px rgba(99, 102, 241, 0.3));
}

.gauge-needle {
  color: #0f172a;
  transform-origin: 12px 14px;
  animation: rev-needle 3s ease-in-out infinite alternate;
}

@keyframes rev-needle {
  0% { transform: rotate(-70deg); }
  25% { transform: rotate(-20deg); }
  50% { transform: rotate(-35deg); }
  75% { transform: rotate(10deg); }
  100% { transform: rotate(30deg); }
}

.logo-text h1 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  color: #0f172a;
}

.logo-text h1 span {
  font-weight: 800;
  background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-left: 1px;
}

.logo-text p {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 400;
  margin-top: 0;
}

/* ==========================================================================
   Glassmorphism Card Style
   ========================================================================== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  padding: 2rem;
  box-shadow: var(--shadow-main);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

/* ==========================================================================
   Search / Scrape Section
   ========================================================================== */
.search-section {
  margin-bottom: 2rem;
  position: relative;
  overflow: visible;
}

.search-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.search-section h2 {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.search-section h2 i, .search-section h2 svg {
  color: var(--primary);
  width: 22px;
}

.section-desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.category-tabs {
  display: flex;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  gap: 0.25rem;
  flex-shrink: 0;
  height: 48px;
  align-items: center;
  box-sizing: border-box;
}

.category-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; /* Compact square width */
  height: 40px; /* Compact square height */
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.category-tab span {
  display: none; /* Hide text to make it icon-only while maintaining accessibility */
}

.category-tab:hover {
  color: var(--text-main);
  background: rgba(79, 70, 229, 0.04);
}

.category-tab.active {
  background: rgba(79, 70, 229, 0.08); /* Soft primary tint */
  color: var(--primary) !important;
}

.category-tab i, .category-tab svg {
  width: 18px;
  height: 18px;
  color: currentColor;
  transition: transform 0.15s ease;
}

.category-tab.active i, .category-tab.active svg {
  transform: scale(1.05);
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.url-input-wrapper {
  position: relative;
  width: 100%;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.url-input-wrapper input {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 6px;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.url-input-wrapper input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: flex-end;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.pages-group select {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  font-size: 0.95rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.pages-group select:focus {
  border-color: var(--primary);
}

.alert-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.alert-input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

/* Preset templates buttons */
.presets-container {
  margin-top: 1.5rem;
  border-top: 1px solid rgba(99, 102, 241, 0.08);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preset-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  padding: 0.85rem 1.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
}

.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: rotate(45deg);
  transition: 0.5s;
}

.btn-glow:hover::after {
  left: 120%;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.15);
  color: var(--text-muted);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btn-secondary:hover {
  background: #ffffff;
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-preset {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.brand-logo-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
  transition: transform 0.2s ease;
}

.btn-preset:hover .brand-logo-img {
  transform: scale(1.1);
}

.btn-preset:hover {
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
}

.btn-preset.active {
  background: rgba(79, 70, 229, 0.12) !important;
  color: var(--primary) !important;
  font-weight: 600;
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.22s ease, transform 0.22s ease;
}

.btn-text::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1.5px;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-text:hover {
  color: #4338ca;
  transform: translateY(-0.5px);
}

.btn-text:hover::after {
  transform: scaleX(1);
  transform-origin: left;
  background-color: #4338ca;
}

.btn-full {
  width: 100%;
  padding: 1rem;
}

/* ==========================================================================
   Loading & Error States
   ========================================================================== */
.loader-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.5rem;
  margin-bottom: 2rem;
}

.loader-section h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.loader-section p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.spinner {
  width: 60px;
  height: 60px;
  position: relative;
}

.double-bounce1, .double-bounce2 {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--secondary);
  opacity: 0.6;
  position: absolute;
  top: 0;
  left: 0;
  animation: sk-bounce 2.0s infinite ease-in-out;
}

.double-bounce2 {
  background-color: var(--primary);
  animation-delay: -1.0s;
}

@keyframes sk-bounce {
  0%, 100% { 
    transform: scale(0.0);
  } 50% { 
    transform: scale(1.0);
  }
}

.error-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem;
  margin-bottom: 2rem;
  border-color: rgba(239, 68, 68, 0.2);
}

.error-icon {
  width: 64px;
  height: 64px;
  background: rgba(239, 68, 68, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #dc2626;
  margin-bottom: 1.25rem;
}

.error-icon i, .error-icon svg {
  width: 32px;
  height: 32px;
}

.error-section h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.error-section p {
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Statistics Dashboard Panel
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon i, .stat-icon svg {
  width: 18px;
  height: 18px;
}

.icon-blue {
  background: rgba(14, 165, 233, 0.08);
  color: var(--secondary);
}

.icon-purple {
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
}

.icon-green {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ==========================================================================
   Chart / Visualization Section
   ========================================================================== */
.chart-section {
  margin-bottom: 2rem;
}

.chart-header {
  margin-bottom: 1.5rem;
}

.chart-header h3 {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.chart-header h3 i, .chart-header h3 svg {
  color: var(--primary);
  width: 20px;
}

.chart-header p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 380px;
}

/* ==========================================================================
   Filters Bar Section
   ========================================================================== */
.filter-section-embedded {
  border-top: 1px solid rgba(99, 102, 241, 0.08);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-section-embedded.section-disabled {
  opacity: 0.55;
  pointer-events: none;
}

#reset-filters.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.filter-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(99, 102, 241, 0.08);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.filter-bar-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}

.filter-bar-header h3 i, .filter-bar-header h3 svg {
  color: var(--primary);
  width: 20px;
  height: 20px;
  stroke-width: 2.2px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
  .filters-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 991px) and (min-width: 768px) {
  .filters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .filters-grid {
    grid-template-columns: 1fr;
  }
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 8px;
  padding: 0.72rem 0.85rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.01);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.range-inputs:hover {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(99, 102, 241, 0.22);
}

.range-inputs input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  text-align: center;
}

.range-selects {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.range-selects select {
  width: 100%;
  padding: 0.72rem 1.8rem 0.72rem 0.8rem;
  background-position: right 0.45rem center;
  background-size: 0.8rem;
  text-align: center;
  text-align-last: center;
}

.range-inputs input::-webkit-outer-spin-button,
.range-inputs input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.range-inputs input[type=number] {
  -moz-appearance: textfield;
}

.range-separator {
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 700;
}

.range-inputs:focus-within {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15), 0 4px 10px rgba(79, 70, 229, 0.05);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
  transition: color 0.2s ease;
}

.filter-group:focus-within label {
  color: var(--primary);
}

.filter-group label i, .filter-group label svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
  opacity: 0.85;
  stroke-width: 2.2px;
}

.filter-group select {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 8px;
  padding: 0.72rem 2.2rem 0.72rem 1rem;
  color: var(--text-main);
  outline: none;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.01);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236366f1' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.95rem;
}

.filter-group select:hover {
  background-color: rgba(255, 255, 255, 0.75);
  border-color: rgba(99, 102, 241, 0.22);
}

.filter-group select:focus {
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15), 0 4px 10px rgba(79, 70, 229, 0.05);
}

.checkbox-group {
  justify-content: flex-start;
  align-items: flex-start;
  padding-bottom: 0.2rem;
}

.checkbox-container {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 0;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
  transition: color 0.2s ease;
}

.checkbox-container:hover {
  color: var(--text-main);
}
.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.switch-track {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background-color: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkbox-container input:checked ~ .switch-track {
  background-color: var(--primary);
  border-color: var(--primary);
}

.checkbox-container input:checked ~ .switch-track::after {
  left: 23px;
  background-color: #ffffff;
}

.checkbox-container:hover input ~ .switch-track {
  border-color: rgba(99, 102, 241, 0.35);
}

.checkbox-container:hover input:checked ~ .switch-track {
  background-color: #4338ca;
  border-color: #4338ca;
}

.filter-search-row {
  width: 100%;
  margin-bottom: 1.25rem;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  width: 18px;
  stroke-width: 2.2px;
}

.search-input-wrapper input {
  width: 100%;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 8px;
  padding: 0.85rem 1.25rem 0.85rem 2.85rem;
  color: var(--text-main);
  outline: none;
  font-size: 0.9rem;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.01);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-wrapper input:hover {
  background-color: rgba(255, 255, 255, 0.75);
  border-color: rgba(99, 102, 241, 0.22);
}

.search-input-wrapper input:focus {
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15), 0 4px 12px rgba(79, 70, 229, 0.06);
}

/* ==========================================================================
   Car Cards Listings Grid
   ========================================================================== */
.cars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

@media (min-width: 1200px) {
  .cars-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  .cars-grid {
    grid-template-columns: 1fr;
  }
}

.car-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  position: relative;
  padding: 0;
  border: 1px solid rgba(99, 102, 241, 0.05);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.car-card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 70, 229, 0.2);
  box-shadow: 0 15px 35px -10px rgba(15, 23, 42, 0.12), 0 0 15px rgba(79, 70, 229, 0.03);
  background: var(--bg-card-hover);
}

.car-image-wrapper {
  position: relative;
  width: 100%;
  height: 180px;
  background: #e2e8f0;
  overflow: hidden;
  border-bottom: 1px solid rgba(99, 102, 241, 0.04);
}

.car-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.car-card:hover .car-image-wrapper img {
  transform: scale(1.05);
}

/* Deal badges with soft pastel colored look */
.deal-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.deal-excellent {
  background: var(--color-excellent-bg);
  color: var(--color-excellent-text);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.deal-good {
  background: var(--color-good-bg);
  color: var(--color-good-text);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.deal-fair {
  background: var(--color-fair-bg);
  color: var(--color-fair-text);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.deal-overpriced {
  background: var(--color-overpriced-bg);
  color: var(--color-overpriced-text);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.deal-bad {
  background: var(--color-bad-bg);
  color: var(--color-bad-text);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.defect-pill {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  background: #f87171;
  color: #7f1d1d;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.car-card-body {
  padding: 0.8rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.car-card-header {
  margin-bottom: 0.75rem;
}

.car-model-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.25rem;
  display: inline-block;
}

.car-title-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  height: 2.7rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.car-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
  border-top: 1px solid rgba(99, 102, 241, 0.06);
  border-bottom: 1px solid rgba(99, 102, 241, 0.06);
  padding: 0.6rem 0;
  margin-bottom: 1rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-size: 0.8rem;
}

.meta-label {
  color: var(--text-dim);
  font-size: 0.65rem;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.meta-val {
  font-weight: 600;
  color: var(--text-muted);
}

.pricing-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
  padding-top: 0.25rem;
  margin-bottom: 1rem;
}

.actual-price {
  display: flex;
  flex-direction: column;
}

.price-label-small {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.1rem;
}

.price-val-card {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.expected-price-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.8rem;
}

.expected-val {
  font-weight: 600;
  color: var(--text-dim);
}

.deviation-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
  margin-top: 0.2rem;
}

.dev-saving {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-excellent-text);
}

.dev-loss {
  background: rgba(239, 68, 68, 0.08);
  color: var(--color-bad-text);
}

.star-rating {
  display: flex;
  gap: 0.15rem;
  color: #eab308; /* Soft Gold */
}

.star-rating svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.star-rating svg.star-empty {
  color: #cbd5e1; /* Slate 300 */
  fill: none;
  fill: transparent;
}

/* ==========================================================================
   Detail Modal Drawer Styling
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.35); /* Soft slate overlay */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-content {
  width: 95%;
  max-width: 1450px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  padding: 2.5rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
  animation: modal-slide-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-slide-in {
  from {
    transform: translateY(20px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.08);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  z-index: 10;
}

.modal-close:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
  transform: rotate(90deg);
}

.modal-body-grid {
  display: grid;
  grid-template-columns: 1.7fr 0.85fr;
  gap: 2.5rem;
}

/* Force grid columns to respect fr ratios */
.modal-media-col,
.modal-info-col {
  min-width: 0;
}

@media (max-width: 900px) {
  .modal-body-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .modal-content {
    padding: 1.5rem;
    width: 95%;
  }
}

/* Image carousel in Modal */
.carousel-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.carousel-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3; /* Native ss.lv 800x600 photo proportions */
  max-height: 65vh;
  border-radius: 6px;
  overflow: hidden;
  margin: 0 auto;
  background: transparent;
  border: none;
  box-shadow: none;
}

#modal-main-img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Prevents cropping, fits entire car photo */
  display: block;
}

/* Premium overlay controls on top of the image */
.carousel-overlay-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.22s ease-in-out;
  opacity: 0.7;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.carousel-overlay-btn svg {
  width: 20px;
  height: 20px;
}

.carousel-viewport:hover .carousel-overlay-btn {
  opacity: 1;
  background: rgba(255, 255, 255, 0.8);
}

.carousel-overlay-btn:hover {
  background: rgba(255, 255, 255, 0.98) !important;
  transform: translateY(-50%) scale(1.08);
  color: var(--primary);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.22);
}

.carousel-overlay-btn.prev-btn {
  left: 1rem;
}

.carousel-overlay-btn.next-btn {
  right: 1rem;
}

.carousel-indicator-badge {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.carousel-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.thumb-item {
  width: 100%;
  aspect-ratio: 4/3;
  height: auto;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.7;
  border: 2px solid transparent;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.thumb-item:hover, .thumb-item.active {
  opacity: 1;
  border-color: var(--primary);
}

/* Modal Right Column Details */
.modal-header-info {
  border-bottom: 1px solid rgba(99, 102, 241, 0.06);
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}

.modal-header-top-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  width: 100%;
}

.modal-header-top-row .modal-rating-badge {
  margin-bottom: 0;
}

.modal-post-date {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
}

.modal-post-date svg {
  width: 15px;
  height: 15px;
  stroke: var(--text-dim);
}

.modal-rating-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

#modal-title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.modal-price-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.price-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.2rem;
}

.modal-actual-price .price-num {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-expected-price .price-num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-dim);
}

/* Evaluation Details Box */
.modal-eval-box {
  background: rgba(79, 70, 229, 0.03);
  border: 1px solid rgba(79, 70, 229, 0.08);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.modal-eval-box h4 {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.modal-eval-box h4 i, .modal-eval-box h4 svg {
  width: 18px;
  height: 18px;
}

#modal-eval-reason {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.star-rating-large {
  display: flex;
  gap: 0.25rem;
  color: #eab308;
}

.star-rating-large svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.star-rating-large svg.star-empty {
  color: #cbd5e1;
  fill: none;
  fill: transparent;
}

/* Section elements */
.modal-section-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(99, 102, 241, 0.06);
  padding-bottom: 0.4rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.specs-table-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.spec-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: transparent;
  border: none;
  padding: 0.4rem 0.25rem;
  border-radius: 0;
  transition: all 0.2s ease-in-out;
  box-shadow: none;
}

.spec-card:hover {
  background: transparent;
  transform: translateX(3px);
}

.spec-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: rgba(79, 70, 229, 0.08); /* Soft primary tint */
  color: var(--primary);
  flex-shrink: 0;
}

.spec-card-icon i, .spec-card-icon svg {
  width: 18px;
  height: 18px;
}

.spec-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0; /* Protect flex-item overflow */
}

.spec-card-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin-bottom: 0.15rem;
}

.spec-card-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  line-height: 1.2;
}

.spec-card-value a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-style: dotted;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}

.spec-card-value a:hover {
  color: var(--secondary);
  text-decoration-color: var(--secondary);
}

.modal-description {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(99, 102, 241, 0.06);
  border-radius: 6px;
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text-muted);
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 1rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.01);
}

.modal-actions {
  margin-top: 1rem;
}

/* Equipment Options Button and Modal Styling */
.modal-options-section {
  border-top: 1px solid rgba(99, 102, 241, 0.08);
  padding-top: 1.25rem;
}

.equipment-modal-content {
  width: 95%;
  max-width: 1450px;
  max-height: 90vh;
  padding: 2rem;
  border-radius: 8px;
}

.equipment-modal-content h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.06);
  padding-bottom: 0.5rem;
}

.equipment-modal-content h3 svg {
  color: var(--primary);
  width: 20px;
  height: 20px;
}

/* Compact Grid layout for Equipment Columns */
.equipment-modal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  max-height: 72vh;
  overflow-y: auto;
  padding-right: 0.4rem;
  margin-top: 1rem;
}

.equipment-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Custom Scrollbar for Options Grid */
.equipment-modal-grid::-webkit-scrollbar {
  width: 5px;
}
.equipment-modal-grid::-webkit-scrollbar-track {
  background: rgba(99, 102, 241, 0.02);
  border-radius: 3px;
}
.equipment-modal-grid::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.12);
  border-radius: 3px;
}
.equipment-modal-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.25);
}

.equipment-modal-grid .option-category-card {
  display: inline-block;
  width: 100%;
  margin-bottom: 0.75rem;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(99, 102, 241, 0.05);
  border-radius: 6px;
  padding: 0.8rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.01);
  transition: transform 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
  box-sizing: border-box;
}

.equipment-modal-grid .option-category-card:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.12);
  background: rgba(255, 255, 255, 0.5);
}

.equipment-modal-grid .option-category-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 1px solid rgba(99, 102, 241, 0.06);
  padding-bottom: 0.3rem;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.equipment-modal-grid .option-items-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.equipment-modal-grid .option-item {
  font-size: 0.76rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.35;
}

.equipment-modal-grid .option-bullet {
  width: 5px;
  height: 5px;
  border-radius: 1px;
  flex-shrink: 0;
}

.equipment-modal-grid .option-item.active {
  font-weight: 600;
  color: var(--text-main);
}

.equipment-modal-grid .option-item.active .option-bullet {
  background: #10b981; /* Emerald active green */
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.equipment-modal-grid .option-item.inactive {
  color: var(--text-dim);
  opacity: 0.45;
}

.equipment-modal-grid .option-item.inactive .option-bullet {
  background: transparent;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Responsive Columns for Equipment Modal Grid */
@media (max-width: 900px) {
  .equipment-modal-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 680px) {
  .equipment-modal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .equipment-modal-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
  margin-top: auto;
  padding: 2.5rem 0 1rem;
  border-top: 1px solid rgba(99, 102, 241, 0.06);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ==========================================================================
   Brand Autocomplete Search & Chips
   ========================================================================== */
.search-toolbar-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .search-toolbar-row {
    flex-wrap: nowrap;
  }
  
  .brand-search-container {
    flex: 1;
    flex-shrink: 0;
    margin: 0;
  }
  
  .depth-select-wrapper {
    width: 230px;
    flex-shrink: 0;
  }
  
  .btn-analyze {
    flex-shrink: 0;
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
  }
}

@media (max-width: 767px) {
  .search-toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .brand-search-container,
  .depth-select-wrapper,
  .btn-analyze {
    width: 100% !important;
  }

  .category-tabs {
    align-self: center;
  }
}

.brand-search-container {
  position: relative;
}

.depth-select-wrapper {
  position: relative;
}

.depth-select-wrapper select {
  width: 100%;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 8px;
  padding: 1rem 2.2rem 1rem 1.25rem;
  color: var(--text-main);
  outline: none;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.01);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236366f1' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.95rem;
}

.depth-select-wrapper select:hover {
  background-color: rgba(255, 255, 255, 0.75);
  border-color: rgba(99, 102, 241, 0.22);
}

.depth-select-wrapper select:focus {
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15), 0 4px 10px rgba(79, 70, 229, 0.05);
}

.brand-search-input-wrapper {
  position: relative;
  width: 100%;
}

.brand-search-icon {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  width: 20px;
  height: 20px;
  pointer-events: none;
}

#brand-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 8px;
  padding: 1rem 9.5rem 1rem 3.1rem; /* Expanded right padding for button space */
  color: var(--text-main);
  font-family: inherit;
  font-size: 1.05rem;
  outline: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.01);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

#brand-search-input:hover {
  background-color: rgba(255, 255, 255, 0.75);
  border-color: rgba(99, 102, 241, 0.22);
}

#brand-search-input:focus {
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15), 0 4px 12px rgba(79, 70, 229, 0.06);
}

.btn-select-all-brands {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--primary);
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5;
}

.btn-select-all-brands:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-select-all-brands.active {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.btn-select-all-brands.active:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.brand-suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 8px;
  margin-top: 5px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow-main);
}

.brand-suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.brand-suggestion-item:hover {
  background: rgba(79, 70, 229, 0.06);
  padding-left: 1.25rem;
}

.brand-suggestion-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.brand-suggestion-item span {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-main);
}

.brand-suggestion-item.already-selected {
  opacity: 0.55;
  background: rgba(241, 245, 249, 0.4);
  pointer-events: none;
  cursor: default;
}

.brand-suggestion-item.already-selected:hover {
  background: rgba(241, 245, 249, 0.4);
  padding-left: 1rem;
}

.brand-suggestion-item .added-badge {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.selected-brands-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

.selected-brands-container:empty {
  display: none;
}

@media (min-width: 768px) {
  .selected-brands-container {
    justify-content: flex-start;
  }
}

@media (max-width: 767px) {
  .selected-brands-container {
    justify-content: center;
    margin-top: 0.25rem;
  }
}

.selected-brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: none;
  padding: 0.3rem 0.6rem 0.3rem 0;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 700;
  animation: scaleIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.2s ease;
}

.selected-brand-chip:hover {
  transform: translateY(-1px);
}

.selected-brand-chip img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.selected-brand-btn-remove {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.selected-brand-btn-remove:hover {
  background: rgba(79, 70, 229, 0.15);
  color: #4338ca;
}

.selected-brand-btn-remove svg {
  width: 14px;
  height: 14px;
}

@keyframes scaleIn {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Brand Selection Actions */
.brand-actions-row {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  align-items: center;
}

.brand-action-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.brand-action-btn:hover {
  background: rgba(79, 70, 229, 0.08);
  color: #4338ca;
}

.brand-action-btn svg {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   Car Comparison Feature Styling
   ========================================================================== */

/* Compare Checkbox on Car Cards */
.compare-btn-wrapper {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
}

.compare-checkbox-container {
  display: block;
  position: relative;
  cursor: pointer;
  user-select: none;
}

.compare-checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.compare-checkbox-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.compare-scale-icon {
  width: 15px;
  height: 15px;
  color: var(--text-dim);
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.compare-scale-icon svg {
  width: 100%;
  height: 100%;
}

.compare-checkbox-container:hover .compare-checkbox-mark {
  background-color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.compare-checkbox-container:hover .compare-scale-icon {
  color: var(--primary);
  transform: scale(1.08);
}

/* Checked State styling */
.compare-checkbox-container input:checked ~ .compare-checkbox-mark {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.compare-checkbox-container input:checked ~ .compare-checkbox-mark .compare-scale-icon {
  color: #ffffff;
}


/* Floating Compare Bar */
.compare-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  z-index: 1000;
  width: 90%;
  max-width: 820px; /* Slightly wider */
  background: rgba(15, 23, 42, 0.92); /* Sleek dark slate glass */
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(99, 102, 241, 0.35); /* Glowing indigo border */
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.5), 0 0 25px rgba(99, 102, 241, 0.2);
  border-radius: 8px; /* Less rounded, modern sharper corners */
  padding: 1.05rem 2rem; /* Larger padding */
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease, visibility 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.compare-bar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

.compare-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem; /* Larger gap */
  flex-wrap: wrap;
}

.compare-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.compare-icon {
  color: #a5b4fc; /* Vibrant indigo glow */
  width: 24px;
  height: 24px;
  animation: pulse-icon 2s infinite ease-in-out;
}

.compare-text {
  display: flex;
  flex-direction: column;
}

#compare-count {
  font-family: 'Outfit', sans-serif;
  font-size: 1.02rem; /* Larger text */
  font-weight: 700;
  color: #ffffff; /* White text for contrast */
  line-height: 1.2;
}

.compare-subtext {
  font-size: 0.82rem; /* Larger text */
  color: #94a3b8; /* Dimmed slate text */
}

.compare-thumbnails {
  display: flex;
  gap: 0.75rem; /* Larger gap */
  align-items: center;
}

.compare-thumb-item {
  width: 48px; /* Larger thumbnail */
  height: 48px;
  border-radius: 6px; /* Matched border-radius */
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.compare-thumb-item:hover {
  transform: scale(1.15) translateY(-2px);
  border-color: #818cf8;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.compare-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-small-compare {
  padding: 0.6rem 1.35rem; /* Larger buttons */
  font-size: 0.85rem;
  border-radius: 6px; /* Matched border-radius */
  font-weight: 600;
  transition: all 0.2s ease;
}

/* Custom styled buttons within compare bar */
.compare-bar .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
}

.compare-bar .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  transform: translateY(-1px);
}

.compare-bar .btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.compare-bar .btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.55), 0 0 0 1px rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
}

@keyframes pulse-icon {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.7)); }
  100% { transform: scale(1); }
}

@media (max-width: 600px) {
  .compare-bar {
    bottom: 12px;
    padding: 0.8rem 1.25rem;
    border-radius: 8px; /* Less rounded for mobile too */
  }
  .compare-bar-content {
    gap: 0.75rem;
    justify-content: center;
  }
  .compare-thumbnails {
    display: none;
  }
}

/* Compare Modal Layout */
.compare-modal-content {
  max-width: 1150px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 2rem;
  overflow: hidden;
}

.compare-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.08);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.compare-modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.compare-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  flex-grow: 1;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.08);
  background: rgba(255, 255, 255, 0.2);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  table-layout: fixed;
}

/* Column width definitions */
.compare-table col:first-child {
  width: 160px;
}

.compare-table col:not(:first-child) {
  min-width: 250px;
}

.compare-table th, .compare-table td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.06);
  text-align: left;
  vertical-align: middle;
  word-wrap: break-word;
}

.compare-table tr:hover {
  background-color: rgba(99, 102, 241, 0.005);
}

/* Sticky First Column for Labels */
.compare-table td:first-child, .compare-table th:first-child {
  position: sticky;
  left: 0;
  background: rgba(246, 248, 251, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-weight: 600;
  color: var(--text-muted);
  border-right: 1.5px solid rgba(99, 102, 241, 0.1);
  z-index: 5;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.02);
}

.compare-table th {
  background-color: rgba(99, 102, 241, 0.02);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 2px solid rgba(99, 102, 241, 0.1);
  text-align: center;
}

.compare-table th:first-child {
  background: rgba(246, 248, 251, 0.98);
  border-right: 1.5px solid rgba(99, 102, 241, 0.1);
}

/* Header Cell Styling */
.compare-header-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  position: relative;
}

.compare-header-img {
  width: 100%;
  max-width: 220px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.08);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.compare-header-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.2rem;
  line-height: 1.15;
}

.compare-rating-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  margin-bottom: 0.25rem;
}

/* Category separator row */
.compare-category-row td {
  background-color: rgba(99, 102, 241, 0.03) !important;
  font-family: 'Outfit', sans-serif;
  font-weight: 700 !important;
  color: var(--primary) !important;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  padding: 0.5rem 1.15rem;
  border-bottom: 1.5px solid rgba(99, 102, 241, 0.08);
}

/* Cell Specific Stylings */
.compare-price-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.compare-expected-val {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.compare-deviation {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  display: inline-block;
  margin-top: 0.2rem;
}

.compare-stars {
  display: flex;
  gap: 2px;
  color: #fbbf24; /* Amber 400 */
}

.compare-stars svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.compare-stars .star-empty {
  color: #cbd5e1;
  fill: none;
}

/* Option Indicator */
.compare-option-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.option-icon-yes {
  color: var(--color-excellent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.option-icon-yes svg {
  width: 16px;
  height: 16px;
}

.option-icon-no {
  color: var(--color-bad);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
}

.option-icon-no svg {
  width: 16px;
  height: 16px;
}

.option-text-yes {
  color: var(--text-main);
  font-weight: 500;
}

.option-text-no {
  color: var(--text-dim);
  text-decoration: line-through;
  opacity: 0.6;
}

/* Column loader style */
.compare-column-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 0.75rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.compare-mini-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(99, 102, 241, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Modernized Comparison Grid & Highlights */
.compare-col-highlight {
  background-color: rgba(79, 70, 229, 0.015);
}

.compare-table td.highlight-cell {
  border-left: 1.5px solid rgba(79, 70, 229, 0.12) !important;
  border-right: 1.5px solid rgba(79, 70, 229, 0.12) !important;
  background-color: rgba(79, 70, 229, 0.01);
}

.compare-table th.highlight-cell {
  border-left: 1.5px solid rgba(79, 70, 229, 0.12) !important;
  border-right: 1.5px solid rgba(79, 70, 229, 0.12) !important;
  border-top: 1.5px solid rgba(79, 70, 229, 0.12) !important;
  background-color: rgba(79, 70, 229, 0.02) !important;
}

.compare-table tr:last-child td.highlight-cell {
  border-bottom: 2.5px solid rgba(79, 70, 229, 0.15) !important;
}

.best-deal-badge {
  position: absolute;
  top: -12px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b); /* Amber gradient for award badge */
  color: #78350f;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  z-index: 10;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.best-deal-badge svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.5px;
}

/* Remove option yes/no text in modernized option grid */
.compare-option-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Price Drop Badge on Car Cards */
.price-drop-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(16, 185, 129, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  z-index: 5;
}

.price-drop-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0;
  margin-top: 0.25rem;
  background: none;
  border: none;
  color: var(--color-excellent-text);
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  align-self: flex-start;
}

/* Price History Timeline in Modal */
.price-history-section {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(79, 70, 229, 0.08);
  border-radius: 12px;
  padding: 0.95rem;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 20px -2px rgba(79, 70, 229, 0.04), 0 2px 8px -1px rgba(79, 70, 229, 0.02);
  backdrop-filter: blur(8px);
}

.price-history-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(79, 70, 229, 0.06);
  padding-bottom: 0.5rem;
}

.price-history-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-left: 1.15rem;
}

.price-history-timeline::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 5px;
  bottom: 5px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    rgba(79, 70, 229, 0.35) 0%,
    rgba(99, 102, 241, 0.15) 50%,
    rgba(16, 185, 129, 0.35) 100%
  );
  border-radius: 2px;
}

.price-history-item {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  padding-left: 0.25rem;
}

.price-history-item::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  z-index: 2;
  transition: all 0.3s ease;
}

.price-history-item:hover::before {
  transform: translateY(-50%) scale(1.35);
}

.price-history-item.start::before {
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

.price-history-item.drop::before {
  background: var(--color-excellent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.price-history-item.raise::before {
  background: var(--color-bad);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.price-history-date {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.8rem;
}

.price-history-val-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.price-history-val {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.88rem;
}

.price-history-val.drop {
  color: var(--color-excellent-text);
}

.price-history-val.raise {
  color: var(--color-bad-text);
}

.price-history-change-indicator {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  letter-spacing: -0.01em;
}

.price-history-change-indicator.start {
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.1);
}

.price-history-change-indicator.drop {
  background: var(--color-excellent-bg);
  color: var(--color-excellent-text);
  border: 1px solid rgba(16, 185, 129, 0.1);
}

.price-history-change-indicator.raise {
  background: var(--color-bad-bg);
  color: var(--color-bad-text);
  border: 1px solid rgba(239, 68, 68, 0.1);
}

/* Brand Logo Monogram Fallback */
.brand-logo-fallback {
  border-radius: 50%;
  color: white !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
}

.selected-brand-chip .brand-logo-fallback {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.brand-suggestion-item .brand-logo-fallback {
  width: 24px;
  height: 24px;
  font-size: 0.65rem;
  letter-spacing: 0.2px;
}


/* ==========================================================================
   Modern Alerts Button
   ========================================================================== */
.btn-alerts-modern {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: #6366f1;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: visible;
}

.btn-alerts-modern:hover {
  transform: translateY(-1px);
  background: rgba(99, 102, 241, 0.04);
}

.bell-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bell-icon {
  width: 18px;
  height: 18px;
  color: #6366f1;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-alerts-modern:hover .bell-icon {
  animation: bell-ring 1s ease-in-out infinite;
}

.bell-dot {
  position: absolute;
  top: -2px;
  right: -1px;
  width: 6px;
  height: 6px;
  background-color: #ef4444;
  border-radius: 50%;
  border: 1px solid white;
  animation: pulse-dot 2s infinite;
}

@keyframes bell-ring {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(15deg); }
  40% { transform: rotate(-10deg); }
  60% { transform: rotate(5deg); }
  80% { transform: rotate(-5deg); }
}

@keyframes pulse-dot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Responsive Grids & Mobile Layouts
   ========================================================================== */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: flex-end;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: flex-end;
}

@media (max-width: 768px) {
  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }
  
  .app-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
  }

  .logo-container {
    gap: 0.5rem;
  }

  .logo-icon i, .logo-icon svg {
    width: 28px;
    height: 28px;
  }

  .logo-text h1 {
    font-size: 1.5rem;
  }

  .logo-text p {
    display: none;
  }
  
  .header-actions {
    margin-left: auto !important;
    width: auto;
  }
  
  .btn-alerts-modern {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }

  .brand-search-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn-select-all-brands {
    position: static;
    transform: none;
    width: 100%;
  }

  #brand-search-input {
    padding-right: 1rem !important;
  }
}

/* ==========================================================================
   Statistics Button
   ========================================================================== */
.btn-stats-modern {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: #6366f1;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-stats-modern:hover {
  background: rgba(99, 102, 241, 0.04);
  transform: translateY(-1px);
}

/* ==========================================================================
   Statistics Modal / Overlay
   ========================================================================== */
.stats-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}
.stats-overlay.hidden { display: none; }

.stats-modal {
  width: 100%;
  max-width: 950px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-main);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.stats-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* KPI Cards */
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.stats-kpi-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stats-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.stats-kpi-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.25rem;
}
.stats-kpi-icon i { width: 18px; height: 18px; }
.icon-orange { background: rgba(249,115,22,0.15); color: #f97316; }
.stats-kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stats-kpi-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* Charts Row */
.stats-charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}
.stats-chart-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 1.25rem;
}
.stats-chart-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
}
.stats-chart-card h3 i { width: 16px; height: 16px; }
.chart-wrapper {
  position: relative;
  height: 220px;
}

/* Models Table */
.stats-table-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 1.25rem;
}
.stats-table-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
}
.stats-table-card h3 i { width: 16px; height: 16px; }
.stats-table-wrapper {
  overflow-x: auto;
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.stats-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.stats-table td {
  padding: 0.6rem 0.75rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.stats-table tbody tr:last-child td { border-bottom: none; }
.stats-table tbody tr:hover td {
  background: rgba(99,102,241,0.05);
}
.stats-table td:first-child {
  color: var(--text-dim);
  font-size: 0.78rem;
}
.stats-table td:nth-child(2) {
  font-weight: 600;
  color: var(--text-primary);
}

/* Footer */
.stats-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
  .stats-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-charts-row { grid-template-columns: 1fr; }
  .stats-modal { padding: 1.25rem; gap: 1rem; }
  .stats-kpi-value { font-size: 1.3rem; }
}

/* ==========================================================================
   Dealer & Age Badges
   ========================================================================== */
.car-meta-badges-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  min-height: 1.4rem;
}

.car-meta-badges {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

/* Inline heart button next to badges */
.save-car-btn-inline {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.1rem 0.2rem;
  display: flex;
  align-items: center;
  color: #94a3b8;
  transition: color 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.save-car-btn-inline:hover {
  color: #ef4444;
  transform: scale(1.15);
}
.save-car-btn-inline.saved {
  color: #ef4444;
}
.save-car-btn-inline svg {
  width: 16px;
  height: 16px;
  transition: fill 0.2s;
}
.save-car-btn-inline.saved svg {
  fill: #ef4444;
}

.badge-dealer,
.badge-private,
.badge-age,
.badge-import {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.67rem;
  font-weight: 600;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-dealer,
.badge-private,
.badge-age,
.badge-import {
  position: relative;
  padding-left: 0.85rem;
}

.badge-dealer::before,
.badge-private::before,
.badge-age::before,
.badge-import::before {
  content: '';
  position: absolute;
  left: 0.28rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Dealer — amber */
.badge-dealer {
  background: none;
  color: #b07d10;
  border: none;
}
.badge-dealer::before { background: #f59e0b; }

/* Private — teal */
.badge-private {
  background: none;
  color: #0f7b6c;
  border: none;
}
.badge-private::before { background: #14b8a6; }

/* Fresh (0-3d) — green */
.badge-age-fresh {
  background: none;
  color: #166534;
  border: none;
}
.badge-age-fresh::before { background: #22c55e; }

/* Recent (4-14d) — slate */
.badge-age-recent {
  background: none;
  color: #475569;
  border: none;
}
.badge-age-recent::before { background: #94a3b8; }

/* Import */
.badge-import {
  background: none;
  color: #3b82f6;
  border: none;
}
.badge-import::before { background: #3b82f6; }

.badge-age-old {
  background: none;
  color: #64748b;
  border: none;
}
.badge-age-old::before { background: #cbd5e1; }

/* ==========================================================================
   Saved Cars
   ========================================================================== */
.saved-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 0.15rem;
}

.save-car-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 18, 30, 0.65);
  backdrop-filter: blur(6px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #94a3b8;
}
.save-car-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  transform: scale(1.1);
}
.save-car-btn.saved {
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary);
}
.save-car-btn svg {
  width: 15px;
  height: 15px;
  transition: fill 0.2s;
}
.save-car-btn.saved svg {
  fill: #ef4444;
}

.saved-cars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  max-height: 65vh;
  overflow-y: auto;
  padding: 0.25rem 0.1rem;
}

.saved-car-card {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.saved-car-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.saved-car-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}
.saved-car-info {
  padding: 0.75rem;
}
.saved-car-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-car-meta {
  font-size: 0.73rem;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}
.saved-car-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}
.saved-car-remove {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(15,18,30,0.7);
  color: #ef4444;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  line-height: 1;
  transition: all 0.2s;
}
.saved-car-remove:hover {
  background: rgba(239,68,68,0.2);
  transform: scale(1.1);
}

.saved-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 3rem;
  color: var(--text-dim);
  text-align: center;
}

/* ==========================================================================
   Quick Filter Toolbar
   ========================================================================== */
.qf-pill-group {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.qf-pill {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 7px;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.qf-pill:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary);
}
.qf-pill.active {
  background: var(--primary);
  color: #fff;
}

/* Imports toggle pill (standalone, outside group) */
#qf-imports-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 0.3rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#qf-imports-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}
#qf-imports-btn.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: #3b82f6;
  color: #3b82f6;
}

/* Buy Score Badge (in card) */
.buy-score-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  border: 1px solid;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
