/*
 * pricewise.css
 * Supplementary styles loaded via {% load static %}
 * Core design tokens and layout rules live in base.html <style>
 */

/* ── Autocomplete dropdown ── */
.autocomplete-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--c-moss);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  list-style: none;
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
}
.autocomplete-list li {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--c-cream);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.autocomplete-list li:last-child { border-bottom: none; }
.autocomplete-list li:hover,
.autocomplete-list li.active { background: var(--c-cream); }
.autocomplete-price {
  font-family: var(--ff-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--c-moss);
}

/* ── Loading spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-moss);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Progress bar (for geo tiers) ── */
.progress-track {
  height: 8px;
  background: var(--c-cream);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .8s cubic-bezier(.4,0,.2,1);
}
.progress-fill.green  { background: var(--c-moss); }
.progress-fill.gold   { background: var(--c-gold); }
.progress-fill.mist   { background: var(--c-mist); }

/* ── Map container ── */
.map-container {
  width: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

/* ── Receipt image preview ── */
.receipt-thumb {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border);
  cursor: zoom-in;
}

/* ── Empty state ── */
.empty-card {
  text-align: center;
  padding: 48px 24px;
  color: var(--c-mist);
}
.empty-card .empty-icon { font-size: 56px; display: block; margin-bottom: 12px; }
.empty-card h3 { font-family: var(--ff-display); font-size: 22px; color: var(--c-ink); margin-bottom: 6px; }
.empty-card p  { font-size: 14px; max-width: 340px; margin: 0 auto 20px; }

/* ── Tooltip ── */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-ink);
  color: #fff;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 300;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--c-mist);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--c-slate); text-decoration: none; }
.breadcrumb a:hover { color: var(--c-moss); }
.breadcrumb-sep { color: var(--c-border); }

/* ── Collapsible section ── */
.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 12px 0;
}
.collapsible-header:hover { color: var(--c-moss); }
.collapsible-body { overflow: hidden; transition: max-height .3s ease; }
.collapsible-body.closed { max-height: 0; }

/* ── Mobile responsive overrides ── */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-actions .btn:not(.btn-primary) { display: none; }
  .page { padding: 24px 0 60px; }
  .page-header h1 { font-size: 28px; }
  .card { padding: 16px; }
}

/* ── Print styles ── */
@media print {
  .nav, .footer, .btn, .nav-actions { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; }
}
