/* General */
body { font-family: system-ui, sans-serif; margin: 0; }
.container {margin: auto; padding: 15px; background: #fff; min-height: 100vh; }
h1 { text-align: center; font-size: 22px; margin-bottom: 20px; }

/* Back button */
.back { margin-bottom: 10px; background:none; border:none; color:#007bff; font-size:16px; cursor:pointer; }
.hidden { display:none; }

/* Loader */
.loader { width:32px; height:32px; border:4px solid #eee; border-top:4px solid #007bff; border-radius:50%; animation:spin 1s linear infinite; margin:30px auto; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Option buttons */
.option { border:1px solid #ddd; padding:14px; margin:10px 0; text-align:center; border-radius:8px; cursor:pointer; transition:0.3s; background:#fff; }
.option:hover { background:#007bff; color:#fff; }

/* Final Result Panel */
.result-panel { display:flex; padding:10px 0 10px 0; align-items:center;}
.result-panel img { width:auto; height:150px; object-fit:contain; border-radius:6px; max-width: 50%;}

.result-panel .info { flex:1; }
.result-panel .info div { margin-bottom:5px; }
.result-panel .info .brand { font-weight:700; font-size:18px; color:#08a975;}
.result-panel .info .model-variant { font-size:14px; color:#555;}
.result-panel .info .year { font-weight:700; font-size:15px; color:#000; padding-top: 10px;}
.result-panel .info .valueText { font-size:13px; color:#888;}
.result-panel .info .price-range { font-weight:700; font-size:14px; margin-top:5px;}

/* Price range badges */
.price-range span { display:inline-block; margin-right:8px; padding:3px 6px; border-radius:5px; font-size:13px; color:#fff; }
.price-range .fair { background:#ff6b6b; }
.price-range .good { background:#ffa94d; }
.price-range .veryGood { background:#51cf66; }
.price-range .excellent { background:#339af0; }

/* PDF button */
#downloadPdf { margin-top:10px; width:100%; padding:12px 0; background:#007bff; color:#fff; border:none; border-radius:6px; cursor:pointer; transition:0.3s; }
#downloadPdf:hover { background:#0056b3; }
/* Tooltip container */
.price-range span {
  position: relative;
  display: inline-block;
  margin-right: 8px;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 13px;
  color: #fff;
  cursor: default;
}

/* Tooltip text */
.price-range span::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%; /* above the badge */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

/* Show tooltip on hover */
.price-range span:hover::after {
  opacity: 1;
}

/* ===== Pricing Grid ===== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* Mobile: 1 column */
@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .result-panel img {
      width: auto;
    height: 99px;
    max-width: 50%;
  }
}

/* ===== Pricing Panels ===== */
.price-card {
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.price-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

/* Titles */
.price-card .title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Price range */
.price-card .range {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

/* Helper text */
.price-card .hint {
  font-size: 13px;
  opacity: 0.85;
}

/* ===== Individual Styles ===== */
.price-fair {
  background: linear-gradient(135deg, #ffe3e3, #ffbdbd);
  border: 1px solid #ff6b6b;
}

.price-good {
  background: linear-gradient(135deg, #fff4e6, #ffd8a8);
  border: 1px solid #ffa94d;
}

.price-verygood {
  background: linear-gradient(135deg, #e6fcf5, #c3fae8);
  border: 1px solid #51cf66;
}

.price-excellent {
  background: linear-gradient(135deg, #e7f5ff, #d0ebff);
  border: 1px solid #339af0;
}

/* Tooltip (already added earlier, keep it) */
.price-card[data-tooltip] {
  position: relative;
}

.price-card[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.price-card:hover::after {
  opacity: 1;
}

/* ===== Final Result Layout ===== */
.final-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* Desktop: two columns */
@media (min-width: 992px) {
  .final-layout {
    grid-template-columns: 45% 53%;
    align-items: start;
  }
}
.option-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  background: #fff;
}

.option-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.option-card img {
  height: 70px;
  object-fit: contain;
  margin-bottom: 8px;
}

.option-name {
  font-weight: 600;
  font-size: 14px;
}

/* ===============================
   STEP 1 – VEHICLE GRID
================================ */

.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

/* Tablet */
@media (min-width: 600px) {
  .vehicle-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

/* Desktop */
@media (min-width: 992px) {
  .vehicle-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

.vehicle-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 8px 0;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transition: all 0.25s ease;
  border: 1px solid #eef1f5;
}

.vehicle-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
  border-color: #007bff;
}

.vehicle-card img {
  height: 64px;
  width: 94px;
  object-fit: contain;
}

.vehicle-name {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}
.vehicle-card.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
}

.vehicle-card.no-image .vehicle-name {
  font-size: 16px;
  font-weight: 600;
}

.vehicle-card.no-image .vehicle-namesmall {
  font-size: 12px;
  font-weight: 600;
}


/* ===============================
   BREADCRUMB NAVIGATION
================================ */



/* Base crumb */
.crumb {
  position: relative;
  padding: 6px 14px 6px 28px;
  font-size: 14px;
  color: #6b7280;
  white-space: nowrap;
  cursor: pointer;
}

/* Completed crumb */
.crumb.completed {
  color: #16a34a;
}

/* Desktop checkmark */
.crumb.completed::before {
  content: "✓";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%) scale(0.6);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: checkPop 0.35s ease forwards;
}


@keyframes checkPop {
  0% {
    transform: translateY(-50%) scale(0);
    opacity: 0;
  }
  70% {
    transform: translateY(-50%) scale(1.2);
  }
  100% {
    transform: translateY(-50%) scale(1);
    opacity: 1;
  }
}


.crumb.active {
  color: #ffffff;
  background: linear-gradient(135deg, #007bff, #0056d2);
  border-color: transparent;
  font-weight: 600;
}

.crumb.clickable {
  cursor: pointer;
}

.crumb.clickable:hover {
  background: #eef2ff;
  color: #1d4ed8;
  border-color: #c7d2fe;
}

.crumb-sep {
  color: #9ca3af;
  font-size: 14px;
  margin: 0 2px;
}

/* Mobile spacing */
@media (max-width: 480px) {
  .breadcrumb {
    padding: 10px;
  }
}

@media (max-width: 640px) {
  .crumb {
    padding: 6px 10px;
    font-size: 13px;
    text-align: center;
  }

  /* Move checkmark above text */
  .crumb.completed::before {
    left: 50%;
    top: -6px;
    transform: translateX(-50%) scale(0.55);
  }
}


.crumb.disabled {
  color: #000;                
  background: #f1f5f9;
  border-color: #e5e7eb;
  cursor: not-allowed;
  opacity: 1;
}


.crumb.active.result {
  color: #fff;
  font-weight: 600;
  animation: resultPulse 1.6s ease-in-out infinite;
}

@keyframes resultPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

/* horizontal behave on mobile */

/* ===== Breadcrumb container ===== */
#breadcrumb {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE */
  padding: 15px 0;
}

#breadcrumb::-webkit-scrollbar {
  display: none; /* Chrome / Safari */
}

/* ===== Crumbs inline ===== */
.crumb {
  flex: 0 0 auto;
}

/* Separator inline */
.crumb-separator {
  flex: 0 0 auto;
  color: #9ca3af;
}

/* ===== Desktop override ===== */
@media (min-width: 641px) {
  #breadcrumb {
    justify-content: center;
    overflow-x: visible;
  }
}


.step-panel {
  position: relative;
  animation-duration: 0.35s;
  animation-fill-mode: both;
}

.step-enter {
  animation-name: stepEnter;
}

.step-exit {
  animation-name: stepExit;
}

@keyframes stepEnter {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes stepExit {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.skeleton-card {
  height: 110px;
  border-radius: 14px;
  background: linear-gradient(
    100deg,
    #e5e7eb 30%,
    #f3f4f6 40%,
    #e5e7eb 50%
  );
  background-size: 200% 100%;
  animation: skeletonMove 1.2s infinite;
}

@keyframes skeletonMove {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}
#progress-bar {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 22px;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    #2563eb,
    #3b82f6,
    #22c55e,
    #2563eb
  );
  background-size: 300% 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
  animation: progressGradient 2.5s linear infinite;
}

@keyframes progressGradient {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}
.price-step {
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 24px;
  background: linear-gradient(180deg, #ffffff, #f8faff);
  border-radius: 18px;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  text-align: center;
  animation: fadeUp 0.45s ease;
}

.price-step h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #1f2937;
}

.price-subtext {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 22px !important;
}
.price-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
}

.price-control button {
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  padding: 4px 10px;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.price-control button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.45);
}

.price-control button:active {
  transform: scale(0.95);
}
#priceInput {
  width: 200px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: #111827;
  background: #ffffff;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

#priceInput:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
#priceSlider {
  width: 100%;
  margin: 16px 0 10px;
  padding:0;
  appearance: none;
  height: 5px;
  border-radius: 6px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  outline: none;
}

#priceSlider::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #2563eb;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.45);
  transition: transform 0.15s ease;
}

#priceSlider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

#priceSlider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #2563eb;
  cursor: pointer;
}
.price-hint {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 22px;
}
.price-step .primary-btn {
  width: 100%;
  padding: 10px 0px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(34, 197, 94, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.price-step .primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(34, 197, 94, 0.45);
}

.price-step .primary-btn:active {
  transform: scale(0.97);
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 480px) {
  .price-step {
    padding: 22px 18px;
  }

  #priceInput {
    width: 160px;
    font-size: 16px;
  }
}

.tool-heading {
  position: relative;
  display: inline-block;
  width: 100%;
  padding: 18px 0px;
  margin-bottom: 15px !important;
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #ffffff;
  background: linear-gradient(
    135deg,
    #2563eb,
    #3b82f6,
    #60a5fa
  );
  background-size: 200% 200%;
  border-radius: 10px;
  animation: headingGradient 6s ease infinite;
}
.tool-heading::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  border-radius: 6px;
  background: linear-gradient(90deg, #60a5fa, #085661, #60a5fa);
  opacity: 0.9;
}
@keyframes headingGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
@media (max-width: 600px) {
  .tool-heading {
    font-size: 20px;
    padding: 14px 0px;
    border-radius: 14px;
  }

  .tool-heading::after {
    width: 60px;
  }
}
/* ----------------- */
.variant-grid {
  display: flex !important;
  flex-wrap: wrap;
  gap: 14px;
  width: 100%;
}
.variant-card {
  display: flex !important;
  align-items: center;
  justify-content: center;

  flex: 1 1 calc(33.333% - 14px); /* 3 columns desktop */
  min-width: 140px;
    font-size: 13px;
  padding-top: 5px;
  padding-bottom: 5px;
  border-radius: 12px;
  border: 1px solid #e1e5ff;

  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}
.variant-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
@media (max-width: 768px) {
  .variant-card {
    flex: 1 1 100%; /* single column */
  }
}

@media (max-width: 768px) {

  #valuation-tool {
    height: calc(100dvh - 60px); /* header offset */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
  }

  .tool-heading {
    flex-shrink: 0;
  }

  /* SINGLE SCROLL AREA */
  .tool-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: 24px;
  }

  /* Sticky breadcrumb inside scroll */
  #breadcrumb {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
  }

  #progress-bar {
    position: sticky;
    top: 44px;
    z-index: 9;
    background: #fff;
  }

  /* Prevent CLS between steps */
  #panel {
    min-height: 420px;
  }

  #depreciationChart,
  #downloadPdf {
    width: 100%;
  }
  
  .hidden {
  display: none !important;
}

  #downloadPdf {
    margin: 16px 0 24px;
  }
}
