/* ==========================================================================
   NDTFinder: bright / signal theme
   ========================================================================== */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f1b2d;
  --muted: #5b6b80;

  --blue: #2563eb;
  --blue-deep: #1d4ed8;
  --sky: #0ea5e9;
  --teal: #14b8a6;
  --violet: #7c3aed;
  --amber: #f59e0b;
  --pink: #e11d74;
  --sun: #fde047;

  --primary: var(--blue);
  --signal: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue) 35%, var(--sky) 72%, var(--teal) 100%);
  --btn-grad: linear-gradient(135deg, var(--blue) 0%, var(--sky) 100%);
  --glow: 0 0 0 3px rgba(37, 99, 235, .18);
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .06), 0 1px 3px rgba(15, 27, 45, .08);
  --shadow-md: 0 12px 28px -12px rgba(15, 27, 45, .22), 0 2px 6px rgba(15, 27, 45, .06);
  --radius: 10px;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='32'%3E%3Cpath d='M0 16 Q20 2 40 16 T80 16 T120 16 T160 16' fill='none' stroke='white' stroke-opacity='.09' stroke-width='1.5'/%3E%3C/svg%3E");
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

main { flex: 1; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--blue-deep); }

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .45);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: .88rem; }

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -.02em;
}
.brand:hover { color: var(--text); }
.brand-mark { width: 32px; height: 32px; flex: none; }
.topnav a {
  padding: 8px 14px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--muted);
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.topnav a:hover { color: var(--primary); background: rgba(37, 99, 235, .08); }

/* --------------------------------------------------------------------------
   Buttons, tags, badges
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: .98rem;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary {
  color: #fff;
  background: var(--btn-grad);
  box-shadow: 0 6px 18px -6px rgba(37, 99, 235, .6);
}
.btn-primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 10px 24px -6px rgba(37, 99, 235, .7); }
.btn-ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}
.btn-ghost:hover { color: var(--primary); border-color: var(--primary); }

/* Buttons sitting on the gradient hero bands */
.profile-hero .btn-primary, .notfound .btn-primary {
  color: var(--blue-deep);
  background: #fff;
  box-shadow: 0 8px 20px -8px rgba(10, 30, 80, .5);
}
.profile-hero .btn-primary:hover, .notfound .btn-primary:hover { color: var(--blue-deep); }
.profile-hero .btn-ghost {
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .4);
}
.profile-hero .btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, .24); border-color: #fff; }

.tag {
  --c: var(--blue);
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .78rem;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 11%, white);
  border: 1px solid color-mix(in srgb, var(--c) 28%, white);
}
.tag-muted {
  color: var(--muted);
  background: var(--surface-2);
  border-color: var(--border);
}
.badge {
  font-family: var(--font-mono);
  font-size: .75rem;
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-2);
}

/* --------------------------------------------------------------------------
   Hero + search
   -------------------------------------------------------------------------- */
.hero, .profile-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(700px 320px at 90% 110%, rgba(253, 224, 71, .22), transparent 60%),
    radial-gradient(600px 260px at 0% -20%, rgba(124, 58, 237, .35), transparent 65%),
    var(--wave),
    var(--signal);
}
.hero { padding: 72px 0 60px; }
.hero--compact { padding: 28px 0 26px; }

.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 5px 12px;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
}
.hero-title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -.035em;
}
.hl {
  background: linear-gradient(90deg, var(--sun) 0%, #a7f3d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  max-width: 640px;
  margin: 16px 0 32px;
  font-size: 1.15rem;
  color: rgba(255, 255, 255, .88);
}

.search { max-width: 900px; }
.search-main {
  position: relative;
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 24px 48px -20px rgba(10, 30, 80, .55);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-main:focus-within { border-color: var(--sun); }
.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-main input {
  flex: 1;
  min-width: 0;
  padding: 12px 12px 12px 42px;
  font: inherit;
  font-size: 1.05rem;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}
.search-main input::placeholder { color: #8a97a8; }

.search-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span {
  font-weight: 600;
  font-size: .8rem;
  color: rgba(255, 255, 255, .9);
}
.field input, .field select {
  width: 100%;
  padding: 9px 11px;
  font: inherit;
  font-size: .95rem;
  color: var(--text);
  background: rgba(255, 255, 255, .96);
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: #8a97a8; }
.field input:focus, .field select:focus { outline: none; border-color: var(--sun); box-shadow: 0 0 0 3px rgba(253, 224, 71, .4); }

/* --------------------------------------------------------------------------
   Results header + filter chips
   -------------------------------------------------------------------------- */
.results { padding-top: 28px; padding-bottom: 56px; }
.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 20px;
}
.results-count { margin: 0; font-size: 1.05rem; }
.results-count strong {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--primary);
  margin-right: 2px;
}
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 12px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--blue-deep);
  background: rgba(37, 99, 235, .08);
  border: 1px solid rgba(37, 99, 235, .22);
  border-radius: 999px;
  transition: border-color .15s ease, background .15s ease;
}
.chip:hover { color: var(--blue-deep); border-color: var(--primary); }
.chip-label { color: var(--muted); font-weight: 500; }
.chip-x {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  color: var(--primary);
  background: #fff;
}
.chip:hover .chip-x { color: #fff; background: var(--primary); }
.chip-clear { font-size: .9rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   Directory listing
   -------------------------------------------------------------------------- */
.listing {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.listing-row {
  --c: var(--blue);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px 300px 20px;
  align-items: center;
  gap: 8px 20px;
  padding: 16px 18px 16px 22px;
  transition: background .15s ease;
}
.listing-row + .listing-row { border-top: 1px solid var(--border); }
/* Rotate accent colours down the list */
.listing-row:nth-child(5n+2) { --c: var(--teal); }
.listing-row:nth-child(5n+3) { --c: var(--violet); }
.listing-row:nth-child(5n+4) { --c: var(--amber); }
.listing-row:nth-child(5n+5) { --c: var(--pink); }
.listing-row .tag { --c: inherit; }

.listing-row::before {     /* accent bar */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--c);
  opacity: .55;
  transition: opacity .15s ease;
}
.listing-row:hover { background: color-mix(in srgb, var(--c) 5%, white); }
.listing-row:hover::before { opacity: 1; }

.row-main { min-width: 0; }
.row-title {
  margin: 0;
  font-weight: 800;
  font-size: 1.08rem;
  line-height: 1.3;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.row-link { color: var(--text); }
.row-link::after {          /* whole row is clickable */
  content: "";
  position: absolute;
  inset: 0;
}
.listing-row:hover .row-link { color: var(--primary); }
.row-link:focus-visible { outline: none; }
.row-link:focus-visible::after { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: -3px; }
.row-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 0; }

.row-loc {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font-size: .93rem;
}
.row-loc svg { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--c); }

.row-actions {
  position: relative;       /* sits above the stretched row link */
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.btn-sm { padding: 7px 12px; font-size: .85rem; gap: 6px; }
.btn-sm svg { width: 15px; height: 15px; }

.row-chev { width: 20px; height: 20px; color: var(--border-strong); transition: color .15s ease, transform .15s ease; }
.listing-row:hover .row-chev { color: var(--c); transform: translateX(2px); }

/* --------------------------------------------------------------------------
   Pagination + empty state
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 36px;
}
.pagination a, .pagination span {
  min-width: 42px;
  padding: 8px 13px;
  text-align: center;
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s ease, color .15s ease;
}
.pagination a:hover { color: var(--primary); border-color: var(--primary); }
.pagination .current {
  color: #fff;
  background: var(--btn-grad);
  border-color: transparent;
}

.empty {
  padding: 56px 24px;
  text-align: center;
  background: var(--surface);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty-title {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -.02em;
}
.empty .btn { margin-top: 14px; }

/* --------------------------------------------------------------------------
   Business profile
   -------------------------------------------------------------------------- */
.profile-hero { padding: 28px 0 36px; }
.back {
  display: inline-block;
  margin-bottom: 22px;
  font-weight: 600;
  color: rgba(255, 255, 255, .85);
}
.back:hover { color: #fff; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.profile-hero .tag {
  color: #fff;
  background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .35);
}
.profile-title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
}
.profile-loc { margin: 10px 0 24px; font-size: 1.15rem; color: rgba(255, 255, 255, .88); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.profile-body {
  display: grid;
  grid-template-columns: minmax(300px, 400px) 1fr;
  gap: 24px;
  padding-top: 28px;
  padding-bottom: 56px;
}
.panel {
  position: relative;
  padding: 24px 22px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 4px;
  background: var(--signal);
}
.panel-title {
  margin: 0 0 16px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -.01em;
}
.facts { margin: 0; }
.facts dt {
  margin-top: 16px;
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.facts dd:has(.meter) { display: flex; align-items: center; gap: 10px; }

.meter {
  flex: 1;
  max-width: 200px;
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.meter span { display: block; height: 100%; background: var(--btn-grad); border-radius: inherit; }
.meter-label { font-family: var(--font-mono); font-size: .85rem; color: var(--muted); }

.map-wrap {
  position: relative;
  min-height: 460px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
#map { position: absolute; inset: 0; background: var(--surface-2); }

/* Leaflet theming */
.leaflet-container { font-family: var(--font-body); }
.leaflet-bar { border: 1px solid var(--border-strong) !important; box-shadow: var(--shadow-sm) !important; }
.leaflet-bar a { color: var(--text); }
.leaflet-bar a:hover { color: var(--primary); background: var(--surface-2); }
.leaflet-control-attribution a { color: var(--primary) !important; }
.leaflet-popup-content-wrapper { border-radius: var(--radius); box-shadow: var(--shadow-md); }
.leaflet-popup-content { font-weight: 700; font-size: 1rem; color: var(--text); }

.pin-marker { position: relative; }
.pin-marker .dot {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--btn-grad);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(15, 27, 45, .35);
}
.pin-marker .pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--sky);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(.6); opacity: .9; }
  100% { transform: scale(3); opacity: 0; }
}

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */
.notfound { padding: 40px 16px 60px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  position: relative;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: .88rem;
  color: var(--muted);
}
.footer::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--sky), var(--teal), var(--amber), var(--pink), var(--violet));
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 22px;
  padding-bottom: 20px;
}
.footer strong { color: var(--text); font-weight: 700; }
.footer-bottom { border-top: 1px solid var(--border); font-size: .8rem; background: var(--bg); }
.footer-bottom-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  padding-top: 12px;
  padding-bottom: 14px;
}
.footer-bottom a { font-weight: 700; }

/* --------------------------------------------------------------------------
   Attribution
   -------------------------------------------------------------------------- */
.doc {
  max-width: 760px;
  padding-top: 40px;
  padding-bottom: 64px;
}
.doc h1 {
  margin: 0 0 12px;
  font-weight: 800;
  font-size: clamp(2rem, 5.5vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -.03em;
}
.doc h2 {
  margin: 36px 0 10px;
  padding-bottom: 6px;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -.01em;
  border-bottom: 2px solid var(--border);
}
.doc p { margin: 0 0 14px; line-height: 1.7; }
.doc-lead { font-size: 1.1rem; color: var(--muted); }
.doc a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(37, 99, 235, .35); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .listing-row { grid-template-columns: minmax(0, 1fr) 190px auto; }
  .row-chev { display: none; }
  .profile-body { grid-template-columns: 1fr; }
  .map-wrap { min-height: 360px; }
}
@media (max-width: 680px) {
  .hero { padding: 44px 0 36px; }
  .hero--compact { padding: 20px 0; }
  .search-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .listing-row { grid-template-columns: 1fr; padding: 14px 16px 16px 20px; }
  .row-actions { justify-content: flex-start; }
  .row-actions .btn { flex: 1 1 0; }
  .search-main .btn { padding: 11px 14px; }
  .actions .btn { flex: 1 1 calc(50% - 10px); }
  .footer-inner, .footer-bottom-inner { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
