/* ================================================
   ProspectAI v2 — 100% Free Stack
   Aesthetic: Bold editorial, stark contrast
   Fonts: Syne (display) + Outfit (body)
   ================================================ */

:root {
  --ink: #0a0a0f;
  --ink2: #1a1a24;
  --ink3: #2a2a38;
  --ink4: #3d3d52;
  --muted: #7b7b99;
  --muted2: #a8a8c0;
  --paper: #f5f4f0;
  --paper2: #eeede8;
  --paper3: #e4e3dd;
  --lime: #c8f53a;
  --lime2: #aad520;
  --lime-dark: #3d4a0a;
  --red: #ff3b30;
  --green: #00c851;
  --amber: #ff9500;
  --blue: #007aff;
  --font-display: 'Syne', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --r: 10px;
  --r-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; height: 100%; }
body { font-family: var(--font-body); background: var(--paper); color: var(--ink); height: 100%; overflow: hidden; }

/* ── SCAN OVERLAY ── */
.scan-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.scan-inner { text-align: center; }
.scan-radar {
  width: 140px; height: 140px; position: relative;
  margin: 0 auto 28px;
}
.scan-ring {
  position: absolute; border-radius: 50%;
  border: 1.5px solid rgba(200,245,58,0.25);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  animation: pulse 2s ease-out infinite;
}
.r1 { width: 140px; height: 140px; animation-delay: 0s; }
.r2 { width: 95px; height: 95px; animation-delay: 0.5s; border-color: rgba(200,245,58,0.4); }
.r3 { width: 50px; height: 50px; animation-delay: 1s; border-color: rgba(200,245,58,0.6); }
@keyframes pulse {
  0% { opacity: 1; }
  70% { opacity: 0.2; }
  100% { opacity: 1; }
}
.scan-beam {
  position: absolute; top: 50%; left: 50%;
  width: 70px; height: 2px;
  background: linear-gradient(to right, transparent, var(--lime));
  transform-origin: left center;
  animation: rotate 2s linear infinite;
}
@keyframes rotate { to { transform: rotate(360deg); } }
.scan-dot {
  position: absolute; top: 50%; left: 50%;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lime);
  transform: translate(-50%,-50%);
  box-shadow: 0 0 12px var(--lime);
}
.scan-label {
  font-family: var(--font-display); font-size: 15px; font-weight: 600;
  color: var(--paper); letter-spacing: 0.02em; margin-bottom: 16px;
}
.scan-bar-wrap {
  width: 280px; height: 3px; background: var(--ink3);
  border-radius: 2px; margin: 0 auto 10px; overflow: hidden;
}
.scan-bar {
  height: 100%; background: var(--lime); width: 0%;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px var(--lime);
}
.scan-sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.scan-cancel {
  background: none; border: 1px solid var(--ink4);
  color: var(--muted2); padding: 8px 20px; border-radius: 20px;
  font-family: var(--font-body); font-size: 13px; cursor: pointer;
  transition: all 0.2s;
}
.scan-cancel:hover { border-color: var(--red); color: var(--red); }

/* ── HEADER ── */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 58px;
  background: var(--ink);
  border-bottom: 1px solid var(--ink3);
}
.header-inner {
  height: 100%; max-width: 100%;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--lime); color: var(--lime-dark);
  font-family: var(--font-display); font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.logo-name {
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  color: var(--paper); display: block;
}
.logo-tag { font-size: 11px; color: var(--muted); display: block; }
.live-counter {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--lime);
  font-family: var(--font-display); font-weight: 600;
}
.lc-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--lime);
  animation: blink 1s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ── MAIN LAYOUT ── */
.main-layout {
  display: flex;
  height: 100vh;
  padding-top: 58px;
  overflow: hidden;
}

/* ── SEARCH PANEL ── */
.search-panel {
  width: 340px;
  min-width: 340px;
  background: var(--ink);
  border-right: 1px solid var(--ink3);
  display: flex; flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}
.search-panel::-webkit-scrollbar { width: 4px; }
.search-panel::-webkit-scrollbar-track { background: transparent; }
.search-panel::-webkit-scrollbar-thumb { background: var(--ink3); border-radius: 2px; }

.panel-hero {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--ink3);
}
.panel-hero h1 {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 800;
  color: var(--paper); line-height: 1.2;
  margin-bottom: 10px;
}
.panel-hero h1 em { color: var(--lime); font-style: normal; }
.panel-hero p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.panel-hero p strong { color: var(--lime); font-weight: 500; }

.search-form {
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 18px;
  flex: 1;
}

.form-block { display: flex; flex-direction: column; gap: 7px; position: relative; }
.form-row { display: flex; gap: 12px; }
.form-block.half { flex: 1; }

.flabel {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
}

.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }

input[type="text"], select {
  background: var(--ink2);
  border: 1px solid var(--ink3);
  border-radius: var(--r);
  color: var(--paper);
  font-family: var(--font-body); font-size: 14px;
  padding: 10px 13px; outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
input[type="text"]:focus, select:focus { border-color: var(--lime); }
input[type="text"]::placeholder { color: var(--ink4); }

select {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 5 5-5' stroke='%237b7b99' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}
select option, select optgroup { background: var(--ink2); color: var(--paper); }

.gps-btn {
  background: var(--ink3); border: 1px solid var(--ink4);
  border-radius: var(--r); color: var(--muted2);
  padding: 0 12px; cursor: pointer; flex-shrink: 0;
  transition: all 0.2s;
  display: flex; align-items: center;
}
.gps-btn:hover { background: var(--lime); color: var(--lime-dark); border-color: var(--lime); }

/* Autocomplete */
.autocomplete-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: var(--ink2); border: 1px solid var(--ink3);
  border-radius: var(--r); overflow: hidden;
  margin-top: 4px;
  box-shadow: var(--shadow-lg);
}
.ac-item {
  padding: 10px 14px; font-size: 13px; color: var(--muted2);
  cursor: pointer; transition: background 0.15s;
  border-bottom: 1px solid var(--ink3);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: var(--ink3); color: var(--paper); }
.ac-item strong { color: var(--lime); font-weight: 500; }

/* Slider */
.slider {
  width: 100%; height: 4px; appearance: none;
  background: var(--ink3); border-radius: 2px;
  cursor: pointer; border: none; outline: none;
}
.slider::-webkit-slider-thumb {
  appearance: none; width: 20px; height: 20px;
  background: var(--lime); border-radius: 50%;
  border: 3px solid var(--ink); cursor: pointer;
}
.slider-marks {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--ink4);
  margin-top: 4px;
}

.search-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--lime); color: var(--lime-dark);
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
  border: none; border-radius: var(--r); padding: 14px;
  cursor: pointer; width: 100%;
  transition: background 0.2s, transform 0.1s;
}
.search-btn:hover { background: var(--lime2); }
.search-btn:active { transform: scale(0.99); }
.search-btn:disabled { background: var(--ink3); color: var(--ink4); cursor: not-allowed; }

.panel-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--ink3);
  font-size: 11px; color: var(--ink4);
  line-height: 1.8;
}
.panel-footer a { color: var(--muted); text-decoration: none; }
.panel-footer a:hover { color: var(--lime); }

/* ── CONTENT PANEL ── */
.content-panel {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--paper);
}

/* ── MAP ── */
.map-container {
  position: relative;
  height: 320px; min-height: 220px; max-height: 40vh;
  flex-shrink: 0;
  border-bottom: 1px solid var(--paper3);
}
#map { width: 100%; height: 100%; }

.map-overlay-info {
  position: absolute; bottom: 12px; left: 12px; z-index: 10;
  background: var(--ink); color: var(--muted2);
  font-size: 12px; padding: 6px 12px; border-radius: 20px;
  pointer-events: none;
}

/* Leaflet custom markers */
.prospect-marker {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--lime); border: 2px solid var(--lime-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  cursor: pointer;
}
.center-marker {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--blue); border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,122,255,0.5);
}

/* ── RESULTS ── */
.results-wrap {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column;
}
.results-wrap::-webkit-scrollbar { width: 5px; }
.results-wrap::-webkit-scrollbar-thumb { background: var(--paper3); border-radius: 3px; }

.no-results-yet {
  flex: 1; display: flex; align-items: center; justify-content: center;
}
.nry-content { text-align: center; }
.nry-grid {
  display: flex; gap: 32px; justify-content: center;
  margin-bottom: 20px;
}
.nry-item { display: flex; flex-direction: column; gap: 4px; }
.nry-num {
  font-family: var(--font-display); font-size: 32px; font-weight: 800;
  color: var(--lime-dark);
}
.nry-label { font-size: 12px; color: var(--muted); }
.nry-content > p { font-size: 14px; color: var(--muted); }

/* Stats bar */
.stats-bar {
  display: flex; align-items: center; gap: 0;
  padding: 14px 20px; background: var(--ink);
  flex-shrink: 0; flex-wrap: wrap; gap: 8px;
}
.stat-item { display: flex; flex-direction: column; gap: 1px; }
.stat-item.highlight .stat-n { color: var(--lime); }
.stat-n {
  font-family: var(--font-display); font-size: 22px; font-weight: 800;
  color: var(--paper); line-height: 1;
}
.stat-l { font-size: 11px; color: var(--muted); }
.stat-sep {
  width: 1px; height: 32px; background: var(--ink3);
  margin: 0 16px;
}
.stats-actions { margin-left: auto; display: flex; gap: 8px; }
.act-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--lime); color: var(--lime-dark);
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  border: none; border-radius: var(--r); padding: 8px 14px;
  cursor: pointer; transition: background 0.2s;
}
.act-btn:hover { background: var(--lime2); }
.act-btn.ghost {
  background: var(--ink3); color: var(--muted2);
}
.act-btn.ghost:hover { background: var(--ink4); color: var(--paper); }

/* Filter bar */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  background: var(--paper2);
  border-bottom: 1px solid var(--paper3);
  flex-shrink: 0; flex-wrap: wrap;
}
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  background: var(--paper3); border: 1px solid var(--paper3);
  border-radius: 20px; color: var(--ink4);
  font-size: 12px; font-weight: 500; padding: 5px 12px;
  cursor: pointer; transition: all 0.2s;
  font-family: var(--font-body);
}
.pill:hover { border-color: var(--muted2); color: var(--ink2); }
.pill.active {
  background: var(--ink); color: var(--lime);
  border-color: var(--ink);
}
.search-input {
  margin-left: auto; max-width: 220px;
  background: var(--paper); border: 1px solid var(--paper3) !important;
  color: var(--ink) !important;
  font-size: 13px !important; padding: 7px 12px !important;
}
.search-input::placeholder { color: var(--muted) !important; }
.search-input:focus { border-color: var(--ink) !important; }

/* ── CARDS GRID ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; padding: 16px 20px;
}

.biz-card {
  background: #fff; border: 1px solid var(--paper3);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.2s;
  animation: slideUp 0.25s ease both;
  overflow: hidden;
}
.biz-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--ink3);
  transform: translateY(-2px);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.card-top {
  padding: 16px 16px 0;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
}
.card-name {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700; color: var(--ink);
  line-height: 1.3; flex: 1;
}
.card-badge {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 3px 8px; border-radius: 20px;
  white-space: nowrap; flex-shrink: 0;
  background: var(--paper2); color: var(--muted);
}

.card-body { padding: 10px 16px; display: flex; flex-direction: column; gap: 6px; }
.card-line {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 12px; color: var(--muted);
  line-height: 1.4;
}
.card-line svg { flex-shrink: 0; margin-top: 1px; color: var(--muted2); }
.card-line a { color: var(--blue); text-decoration: none; }
.card-line a:hover { text-decoration: underline; }

.card-stars { display: flex; gap: 2px; align-items: center; }
.star { font-size: 11px; color: var(--amber); }
.star.e { color: var(--paper3); }
.rn { font-size: 11px; color: var(--muted); margin-left: 3px; }
.rc { font-size: 10px; color: var(--muted2); }

.card-foot {
  padding: 10px 16px 14px;
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--paper3); margin-top: 4px;
}
.nosite-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255,59,48,0.08); color: var(--red);
  border: 1px solid rgba(255,59,48,0.2);
  padding: 3px 9px; border-radius: 20px;
}
.open-tag { font-size: 11px; font-weight: 600; }
.open-tag.open { color: var(--green); }
.open-tag.closed { color: var(--red); }
.open-tag.unk { color: var(--muted2); }

/* ── MODAL ── */
.modal-bd {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(10,10,15,0.7);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}
.modal {
  background: #fff; border-radius: var(--r-lg);
  width: 100%; max-width: 540px;
  max-height: 88vh; overflow-y: auto;
  padding: 28px; position: relative;
  animation: modalPop 0.22s ease;
  box-shadow: var(--shadow-lg);
}
@keyframes modalPop { from { opacity: 0; transform: scale(0.94) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-x {
  position: absolute; top: 14px; right: 14px;
  background: var(--paper2); border: none; border-radius: 50%;
  width: 30px; height: 30px; cursor: pointer; font-size: 13px;
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-x:hover { background: var(--red); color: #fff; }

.modal-name {
  font-family: var(--font-display); font-size: 21px; font-weight: 800;
  color: var(--ink); margin-bottom: 4px; padding-right: 30px;
}
.modal-type { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.modal-section { margin-bottom: 18px; }
.modal-st {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted2);
  margin-bottom: 8px;
}
.modal-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0; border-bottom: 1px solid var(--paper3);
  font-size: 13px; color: var(--muted);
}
.modal-row:last-child { border-bottom: none; }
.modal-row svg { flex-shrink: 0; margin-top: 2px; color: var(--muted2); }
.modal-row strong { color: var(--ink); }
.modal-row a { color: var(--blue); text-decoration: none; }
.modal-row a:hover { text-decoration: underline; }

.hours-grid { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 12px; }
.hday { color: var(--muted); font-weight: 500; }
.htime { color: var(--ink2); }
.hday.today, .htime.today { color: var(--green); font-weight: 600; }

.modal-cta { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.modal-cta a {
  flex: 1; min-width: 130px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  text-decoration: none; border-radius: var(--r); padding: 11px 14px;
  transition: background 0.2s;
}
.modal-cta a.primary { background: var(--ink); color: var(--lime); }
.modal-cta a.primary:hover { background: var(--ink2); }
.modal-cta a.secondary {
  background: var(--paper2); color: var(--ink2);
  border: 1px solid var(--paper3);
}
.modal-cta a.secondary:hover { background: var(--paper3); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-icon { font-size: 36px; display: block; margin-bottom: 10px; color: var(--paper3); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  body { overflow: auto; }
  .main-layout { flex-direction: column; height: auto; overflow: visible; }
  .search-panel { width: 100%; min-width: 0; border-right: none; border-bottom: 1px solid var(--ink3); }
  .content-panel { height: auto; overflow: visible; }
  .map-container { height: 250px; max-height: 250px; }
  .results-wrap { overflow: visible; }
  .cards-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: flex-start; }
  .search-input { max-width: 100%; width: 100%; margin-left: 0; }
  .stats-bar { flex-wrap: wrap; }
}
