/* UX-1b: Atlas map-first search (Direction A3) */

body.page-search {
  overflow: hidden;
  height: 100vh;
}
body.page-search .navbar,
body.page-search footer {
  display: none;
}
body.page-search main.container {
  max-width: none;
  width: 100%;
  padding: 0;
  margin: 0;
}

:root {
  --atlas-ink: #0f1c2e;
  --atlas-ink-soft: #46586e;
  --atlas-paper: #ffffff;
  --atlas-accent: #f59e0b;
  --atlas-accent-ink: #7c4a03;
  --atlas-region: #14b8a6;
  --atlas-line: #e3e9f0;
  --atlas-radius: 14px;
}

.atlas-root {
  position: relative;
  width: 100%;
  height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--atlas-ink);
  font-size: 15px;
}
#atlas-map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #0f1c2e;
}

/* topbar */
.atlas-topbar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
}
.atlas-topbar > * { pointer-events: auto; }
.atlas-brand {
  background: var(--atlas-ink);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 10px 18px;
  border-radius: var(--atlas-radius);
  box-shadow: 0 8px 24px rgba(15,28,46,0.25);
  white-space: nowrap;
  text-decoration: none;
}
.atlas-brand span { color: var(--atlas-accent); }
.atlas-controlbox {
  background: var(--atlas-paper);
  border-radius: var(--atlas-radius);
  box-shadow: 0 8px 24px rgba(15,28,46,0.18);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  max-width: 720px;
}
.atlas-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.atlas-control-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--atlas-ink-soft);
  text-transform: uppercase;
  min-width: 84px;
}
.atlas-chip {
  background: #eef7f6;
  border: 1px solid #7fccc5;
  color: #0b5e56;
  border-radius: 999px;
  padding: 7px 12px 7px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  border-style: solid;
}
.atlas-chip:hover {
  border-color: #14b8a6;
  box-shadow: 0 3px 10px rgba(20,184,166,0.25);
}
.atlas-chip u { text-decoration-color: #7fccc5; text-underline-offset: 3px; }
.atlas-chip.add {
  background: var(--atlas-accent);
  border-color: var(--atlas-accent);
  color: var(--atlas-accent-ink);
  font-weight: 700;
}
.atlas-fbtn {
  border: 1px solid var(--atlas-line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--atlas-ink-soft);
  cursor: pointer;
  font-weight: 500;
}
.atlas-fbtn:hover { border-color: #b6c2cf; color: var(--atlas-ink); }
.atlas-spacer { flex: 1; }
.atlas-signin {
  background: var(--atlas-paper);
  border-radius: var(--atlas-radius);
  padding: 10px 18px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(15,28,46,0.18);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  color: var(--atlas-ink);
  border: none;
}

/* promise banner */
.atlas-promise {
  position: absolute;
  top: 148px;
  left: 16px;
  z-index: 900;
  background: rgba(15,28,46,0.88);
  color: #fff;
  backdrop-filter: blur(4px);
  border-radius: var(--atlas-radius);
  padding: 14px 18px;
  max-width: 360px;
  box-shadow: 0 8px 24px rgba(15,28,46,0.3);
  display: none;
}
.atlas-promise.visible { display: block; }
.atlas-promise b { color: var(--atlas-accent); }
.atlas-promise .sub { color: #b9c6d6; font-size: 0.85rem; margin-top: 4px; }

/* drawer */
.atlas-drawer {
  position: absolute;
  top: 118px;
  right: 16px;
  bottom: 16px;
  width: 400px;
  z-index: 1000;
  background: var(--atlas-paper);
  border-radius: var(--atlas-radius);
  box-shadow: 0 12px 40px rgba(15,28,46,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.atlas-tabs {
  display: flex;
  border-bottom: 1px solid var(--atlas-line);
  flex: none;
}
.atlas-tab {
  flex: 1;
  text-align: center;
  padding: 13px 0 11px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--atlas-ink-soft);
  border-bottom: 3px solid transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.atlas-tab.on { color: var(--atlas-ink); border-bottom-color: var(--atlas-accent); }
.atlas-tab small {
  display: block;
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--atlas-ink-soft);
}
.atlas-drawer-head {
  padding: 10px 16px;
  border-bottom: 1px solid var(--atlas-line);
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.atlas-drawer-head .hint { font-size: 0.82rem; color: var(--atlas-ink-soft); flex: 1; }
.atlas-drawer-head select {
  border: 1px solid var(--atlas-line);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 0.82rem;
}
.atlas-cards {
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* home cards */
.atlas-card {
  border: 1px solid var(--atlas-line);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.atlas-card:hover { border-color: var(--atlas-region); transform: translateY(-1px); }
.atlas-card .price { font-size: 1.25rem; font-weight: 800; }
.atlas-card .price small { font-size: 0.8rem; font-weight: 600; color: var(--atlas-ink-soft); }
.atlas-card .addr { color: var(--atlas-ink-soft); font-size: 0.88rem; margin: 2px 0 8px; }
.atlas-card .facts { display: flex; gap: 12px; font-size: 0.85rem; font-weight: 600; margin-bottom: 10px; }
.atlas-why { display: flex; flex-direction: column; gap: 4px; }
.atlas-why-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #0b5e56;
  background: #f0faf9;
  border-radius: 8px;
  padding: 5px 9px;
}
.atlas-why-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--atlas-region); flex: none; }
.atlas-why-row.hosp .dot { background: #6366f1; }

/* city cards */
.atlas-city-card {
  border: 1px solid var(--atlas-line);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
  background: #fff;
  flex: none;
}
.atlas-city-card:hover { border-color: var(--atlas-accent); transform: translateY(-1px); }
.atlas-city-photo {
  height: 110px;
  width: 100%;
  object-fit: cover;
  display: block;
  background: #dde5ec;
}
.atlas-city-photo-fallback {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #16324f;
  color: #9fb8d0;
  font-size: 2rem;
  font-weight: 800;
}
.atlas-city-body { padding: 12px 14px 14px; }
.atlas-city-name-row { display: flex; align-items: baseline; gap: 8px; }
.atlas-city-name { font-size: 1.08rem; font-weight: 800; }
.atlas-city-matches {
  margin-left: auto;
  background: #fef3d8;
  color: var(--atlas-accent-ink);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
}
.atlas-city-stats {
  display: flex;
  gap: 14px;
  margin: 8px 0 9px;
  font-size: 0.84rem;
}
.atlas-city-stats b { display: block; font-size: 0.98rem; }
.atlas-city-stats span { color: var(--atlas-ink-soft); font-size: 0.72rem; }
.atlas-city-why { display: flex; flex-wrap: wrap; gap: 5px; }
.atlas-city-why .tag {
  font-size: 0.76rem;
  color: #0b5e56;
  background: #f0faf9;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
}
.atlas-city-why .tag.hosp { color: #4338ca; background: #eef2ff; }

.atlas-pager {
  border-top: 1px solid var(--atlas-line);
  padding: 10px 16px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--atlas-ink-soft);
}
.atlas-pager button {
  border: 1px solid var(--atlas-line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--atlas-ink);
}
.atlas-pager button:disabled { opacity: 0.4; cursor: default; }

/* criteria / filters overlay */
.atlas-overlay {
  position: absolute;
  inset: 0;
  z-index: 2000;
  background: rgba(15,28,46,0.45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 16px;
  overflow-y: auto;
}
.atlas-overlay.open { display: flex; }
.atlas-panel {
  background: var(--atlas-paper);
  border-radius: var(--atlas-radius);
  box-shadow: 0 16px 48px rgba(15,28,46,0.3);
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 20px 24px 24px;
}
.atlas-panel h2 { margin: 0 0 4px; font-size: 1.25rem; }
.atlas-panel .panel-hint { color: var(--atlas-ink-soft); font-size: 0.88rem; margin-bottom: 16px; }
.atlas-panel-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
}
.atlas-panel-actions .btn-primary {
  background: var(--atlas-accent);
  border-color: var(--atlas-accent);
  color: var(--atlas-accent-ink);
  font-weight: 700;
}
.atlas-status {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 900;
  background: rgba(255,255,255,0.95);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  display: none;
}
.atlas-status.visible { display: block; }
.atlas-status.error { background: #fee2e2; color: #991b1b; }
.atlas-status.loading { color: var(--atlas-ink-soft); }

.atlas-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--atlas-ink-soft);
}
.atlas-empty h3 { color: var(--atlas-ink); margin-bottom: 8px; }

.leaflet-control-attribution { font-size: 10px; }

@media (max-width: 768px) {
  .atlas-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 52vh;
    border-radius: var(--atlas-radius) var(--atlas-radius) 0 0;
  }
  .atlas-promise { display: none !important; }
  .atlas-controlbox { max-width: none; }
  .atlas-topbar { flex-wrap: wrap; }
}
