@import url('map-popups.css');

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: system-ui, -apple-system, sans-serif; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-wrapper {
  flex: 1;
  min-height: 0;
  position: relative;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
}
.map-legend {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 1000;
  background: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  font-size: 12px;
  max-height: 200px;
  overflow-y: auto;
}
.map-legend h3 { margin: 0 0 8px 0; font-size: 13px; }
.map-legend .legend-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.map-legend .legend-swatch { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.map-legend .legend-line { width: 18px; height: 4px; border-radius: 2px; flex-shrink: 0; display: inline-block; }
.popup-table { border-collapse: collapse; font-size: 13px; }
.popup-table th { text-align: left; padding: 2px 8px 2px 0; color: #666; font-weight: 500; }
.popup-table td { padding: 2px 0; }
.search-box {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 90%;
  max-width: 360px;
}
.search-box input {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  outline: none;
}
.search-box input:focus { border-color: #2563eb; }
.search-box .search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  max-height: 280px;
  overflow-y: auto;
  display: none;
}
.search-box .search-dropdown.visible { display: block; }
.search-box .search-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}
.search-box .search-item:hover,
.search-box .search-item.active { background: #f0f4ff; }
.search-box .search-item:last-child { border-bottom: none; }
.legend-mountain-icon { display: inline-flex; align-items: center; vertical-align: middle; margin-right: 6px; }
@media (max-width: 768px) {
  .map-wrapper {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100dvh - var(--header-height));
  }
  .map-legend {
    bottom: 12px;
    left: 12px;
    padding: 8px 10px;
    font-size: 11px;
    max-height: 140px;
  }
  .map-legend h3 { font-size: 11px; margin: 0 0 4px 0; }
  .map-legend .legend-row { margin: 2px 0; gap: 6px; }
  .map-legend .legend-swatch { width: 10px; height: 10px; }
  .map-legend .legend-line { width: 14px; height: 3px; }
  .search-box { top: 8px; width: calc(100% - 24px); max-width: none; }
  .search-box input { padding: 8px 12px; font-size: 14px; }
}
.basemap-control {
  position: absolute;
  bottom: 24px;
  right: 12px;
  z-index: 1000;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  min-width: 148px;
}
.basemap-control label {
  font-weight: 600;
  color: #334155;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.basemap-control select {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.basemap-control select:disabled { opacity: 0.6; cursor: wait; }
@media (max-width: 640px) {
  .basemap-control { bottom: 12px; right: 10px; min-width: 132px; }
}
