/* ==============================================
   RESET
   ============================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==============================================
   FONT SYSTEM
   Nunito 800/700      — headings, panel title, badges
   Nunito Sans 700/600 — labels, status, pills, buttons
   Nunito Sans 500/400 — body, dropdowns, popup text
   ============================================== */
body {
  font-family: 'Nunito Sans', sans-serif;
}

/* ==============================================
   MAP
   ============================================== */
#map {
  position: absolute;
  inset: 0;
}

/* ==============================================
   PANEL WRAPPER
   ============================================== */
#panel-wrapper {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  /* Ensure the wrapper itself never blocks map interaction */
  pointer-events: none;
}

/* Re-enable pointer events only on the actual interactive children */
#panel-wrapper > * {
  pointer-events: auto;
}

/* ==============================================
   PANEL
   ============================================== */
#panel {
  width: 280px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.13);
  overflow: hidden;
  transition: width 0.3s ease, opacity 0.3s ease;
}

#panel.collapsed {
  width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  /* Collapse to zero height so it takes up no hit area at all */
  min-height: 0;
  padding: 0;
}

/* ==============================================
   COLLAPSE TOGGLE BUTTON
   ============================================== */
#panelToggle {
  flex-shrink: 0;
  margin-left: 8px;
  margin-top: 6px;
  width: auto;
  height: auto;
  background: #111;
  border: 2px solid #ddd;
  border-radius: 20px;
  padding: 7px 10px;  
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  font-size: 11px;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  color: #fff;
  line-height: 1;
  transition: background 0.2s;
}
#panelToggle:hover {
  background: #333;
}

/* ==============================================
   LOGO
   ============================================== */
.logo-container {
  width: 100%;
  height: 60px;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
}

.logo-link {
  display: block;
  width: 100%;
  height: 100%;
}

#logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ==============================================
   PANEL HEADER
   ============================================== */
#panel-header {
  background: #111;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 9px;
}

#panel-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #00d4ff;
  box-shadow: 0 0 8px #00d4ff;
  flex-shrink: 0;
}

#panel-title {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  line-height: 1.4;
}

/* ==============================================
   PANEL BODY
   ============================================== */
#panel-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #aaa;
}

.field select {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid #e8e8e8;
  border-radius: 8px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #111;
  background: #fff;
  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 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  outline: none;
  transition: border-color 0.18s;
}
.field select:focus   { border-color: #00d4ff; }
.field select:disabled { opacity: 0.45; cursor: not-allowed; }

/* ==============================================
   PILLS (shared)
   ============================================== */
.pill {
  flex: 1;
  padding: 8px 4px;
  border: 1.5px solid #e8e8e8;
  border-radius: 20px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #666;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s;
  white-space: nowrap;
  line-height: 1.3;
}
.pill:hover {
  border-color: #aaa;
  color: #111;
}
.pill.active {
  background: #111;
  border-color: #111;
  color: #fff;
}

/* ==============================================
   RADIUS PILLS
   ============================================== */
#radiusPills {
  display: flex;
  gap: 6px;
}

/* ==============================================
   TYPE PILLS
   ============================================== */
#typePills {
  display: flex;
  gap: 6px;
}

/* ==============================================
   STATUS BAR
   ============================================== */
#statusBar {
  padding: 9px 14px 9px 12px;
  border-top: 1px solid #eee;
  border-left: 3px solid transparent;
  font-family: 'Nunito Sans', sans-serif;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 34px;
  background: #f7f7f7;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.status-main {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
}

.status-icon {
  font-size: 13px;
  flex-shrink: 0;
  line-height: 1;
}

.status-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: #888;
  padding-left: 20px;
  display: none;
  flex-direction: column;   /* two rows stacked vertically */
  gap: 4px;
}
#statusBar.has-sub .status-sub {
  display: flex;
}

/* Each radius row: label + chips all on one line */
.radius-row {
  display: flex;
  flex-direction: column;   /* label on top, chips below */
  gap: 3px;
  flex-shrink: 0;
}
.radius-chips {
  display: flex;
  flex-direction: row;
  gap: 5px;
  align-items: center;
}
.radius-label {
  font-size: 9px;
  font-weight: 700;
  color: #888;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.count-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
}
.count-chip.current  { background: #fee2e2; color: #b91c1c; }
.count-chip.upcoming { background: #fef3c7; color: #b45309; }
.count-chip.total    { background: #e0e7ff; color: #3730a3; }

#statusBar.state-idle    { background: #f7f7f7; color: #999;    border-left-color: transparent; }
#statusBar.state-loading { background: #eff8ff; color: #2d7dd2; border-left-color: #2d7dd2; }
#statusBar.state-success { background: #f0faf4; color: #1e8a4a; border-left-color: #1e8a4a; }
#statusBar.state-empty   { background: #fff8ec; color: #b45309; border-left-color: #f59e0b; }
#statusBar.state-error   { background: #fff1f1; color: #c0392b; border-left-color: #e74c3c; }

/* ==============================================
   RESET BUTTON
   ============================================== */
.reset-btn {
  width: 100%;
  padding: 7px 10px;
  background: #f4f4f4;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #555;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.reset-btn:hover {
  background: #111;
  border-color: #111;
  color: #fff;
}

/* ==============================================
   STATION BADGES
   ============================================== */
.station-badge {
  background: #111;
  color: #fff;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  display: inline-block;
  transform: translate(-50%, -175%);  /* centre horizontally, sit above the dot */
  margin-top: -4px;                   /* small gap between badge and station dot */
}

/* ==============================================
   LEAFLET OVERRIDES
   ============================================== */
.leaflet-tooltip {
  background: #111;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}
.leaflet-tooltip::before {
  border-top-color: #111;
}

.leaflet-popup-content-wrapper {
  border-radius: 10px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 13px;
}

/* ==============================================
   ONBOARDING HINT PILL
   ============================================== */
#onboardingHint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: #111;
  color: #fff;
  padding: 10px 16px;
  border-radius: 32px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
  animation: hintSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hint-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.hint-steps .step {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.hint-steps .badge {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.hint-steps .sep {
  opacity: 0.35;
  font-size: 12px;
}

#onboardingHint.dismissing {
  animation: hintFadeOut 0.35s ease forwards;
}

@media (max-width: 420px) {
  #onboardingHint {
    bottom: 16px;
    padding: 10px 14px;
    font-size: 12px;
    border-radius: 16px;
    gap: 8px;
  }
  .hint-steps .sep  { display: none; }
  .hint-steps       { gap: 4px; }
}

/* ==============================================
   PROPERTY CLUSTER BUBBLES
   ============================================== */
.prop-cluster {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  border: 2px solid rgba(255,255,255,0.85);
  cursor: pointer;
  transition: transform 0.15s;
}
.prop-cluster:hover {
  transform: scale(1.12);
}

/* Hide the default markercluster styles — we use our own */
.leaflet-cluster-anim .leaflet-marker-icon,
.leaflet-cluster-anim .leaflet-marker-shadow {
  transition: left 0.3s ease-out, top 0.3s ease-out;
}

/* Spiderfy leg lines */
.leaflet-marker-pane .leaflet-div-icon { background: none; border: none; }

@keyframes hintSlideUp {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes hintFadeOut {
  to   { opacity: 0; transform: translate(-50%, 8px); }
}