/* HIKEFORECAST BETA ONLY - interactive trail map */
#page-map {
  padding: 24px;
}

#hf-map-root {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

.hf-map-shell,
.hf-map-shell * {
  box-sizing: border-box;
  letter-spacing: 0;
}

.hf-map-shell {
  overflow: hidden;
  border: 1px solid #c7cdc9;
  border-radius: 8px;
  color: #18221d;
  background: #f8faf8;
  box-shadow: 0 12px 34px rgba(25, 38, 31, 0.08);
}

.hf-map-header {
  min-height: 78px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #dfe5e1;
  background: #fff;
}

.hf-map-header h1 {
  margin: 0;
  color: #18221d;
  font-family: "Space Grotesk", sans-serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 31px;
}

.hf-map-freshness {
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #607069;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  line-height: 15px;
}

.hf-map-live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2d7a4f;
  box-shadow: 0 0 0 3px rgba(45, 122, 79, 0.12);
}

.hf-map-mode {
  height: 40px;
  display: inline-flex;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid #aeb8b2;
  border-radius: 4px;
  background: #fff;
}

.hf-map-mode button {
  min-width: 96px;
  height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #53635b;
  background: transparent;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.hf-map-mode button + button {
  border-left: 1px solid #aeb8b2;
}

.hf-map-mode button[aria-pressed="true"] {
  color: #fff;
  background: #2d4739;
}

.hf-map-mode .material-symbols-outlined {
  font-size: 16px;
}

.hf-map-toolbar {
  min-height: 62px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #dfe5e1;
  background: #eef2ef;
}

.hf-map-search {
  height: 40px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #aeb8b2;
  border-radius: 4px;
  background: #fff;
}

.hf-map-search:focus-within {
  border-color: #2d6d4b;
  box-shadow: 0 0 0 2px rgba(45, 109, 75, 0.12);
}

.hf-map-search .material-symbols-outlined {
  color: #607069;
  font-size: 19px;
}

.hf-map-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  color: #18221d;
  background: transparent;
  box-shadow: none;
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}

.hf-map-command,
.hf-map-icon-command {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #aeb8b2;
  border-radius: 4px;
  color: #263c31;
  background: #fff;
}

.hf-map-command {
  min-width: 118px;
  padding: 0 12px;
  gap: 7px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
}

.hf-map-icon-command {
  width: 40px;
  flex: 0 0 40px;
}

.hf-map-command:hover,
.hf-map-icon-command:hover {
  border-color: #2d6d4b;
  color: #2d6d4b;
}

.hf-map-command .material-symbols-outlined,
.hf-map-icon-command .material-symbols-outlined {
  font-size: 18px;
}

@keyframes hfMapSpin {
  to { transform: rotate(360deg); }
}

.hf-map-icon-command.is-refreshing .material-symbols-outlined {
  animation: hfMapSpin 0.8s linear infinite;
}

.hf-map-layout {
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
}

.hf-map-canvas-wrap {
  position: relative;
  min-width: 0;
  height: clamp(540px, calc(100vh - 224px), 740px);
  background: #dfe8e2;
}

#hike-interactive-map {
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #dfe8e2;
}

.hf-map-loading {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #263c31;
  background: rgba(248, 250, 248, 0.9);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  transition: opacity 160ms ease;
}

.hf-map-loading .material-symbols-outlined {
  color: #2d6d4b;
  font-size: 21px;
}

.hf-map-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.hf-map-loading.is-error {
  color: #8b2f2f;
  background: rgba(255, 248, 247, 0.92);
}

.hf-map-side {
  min-width: 0;
  height: clamp(540px, calc(100vh - 224px), 740px);
  display: flex;
  flex-direction: column;
  border-left: 1px solid #dfe5e1;
  background: #fff;
}

.hf-map-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #dfe5e1;
}

.hf-map-kpis > div {
  min-width: 0;
  padding: 12px 13px;
}

.hf-map-kpis > div + div {
  border-left: 1px solid #dfe5e1;
}

.hf-map-kpi-label {
  display: block;
  margin-bottom: 2px;
  color: #607069;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 700;
  line-height: 13px;
  text-transform: uppercase;
}

.hf-map-kpis strong {
  display: block;
  overflow: hidden;
  color: #18221d;
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hf-map-list-header {
  padding: 12px 13px 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.hf-map-list-header h2 {
  min-width: 0;
  margin: 0;
  color: #18221d;
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 19px;
}

.hf-map-list-header span {
  flex: 0 0 auto;
  color: #607069;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 600;
  line-height: 13px;
}

.hf-map-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}

.hf-map-list-row {
  width: 100%;
  min-height: 53px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border-top: 1px solid #edf1ee;
  text-align: left;
  background: #fff;
}

.hf-map-list-row:hover,
.hf-map-list-row:focus-visible,
.hf-map-list-row.is-selected {
  outline: 0;
  background: #eef5f0;
}

.hf-map-list-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: #2d6d4b;
}

.hf-map-list-icon .material-symbols-outlined {
  font-size: 17px;
}

.hf-map-list-place {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.hf-map-list-place strong,
.hf-map-list-place small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hf-map-list-place strong {
  color: #18221d;
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 650;
  line-height: 16px;
}

.hf-map-list-place small {
  color: #607069;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 500;
  line-height: 13px;
}

.hf-map-list-value {
  max-width: 72px;
  overflow: hidden;
  color: #53635b;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hf-map-list-empty {
  padding: 32px 14px;
  color: #607069;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  line-height: 17px;
  text-align: center;
}

.hf-map-legend {
  padding: 11px 13px 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 11px;
  border-top: 1px solid #dfe5e1;
  background: #f4f7f5;
}

.hf-map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #53635b;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 600;
}

.hf-map-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(24, 34, 29, 0.12);
}

.hf-map-statusbar {
  min-height: 37px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #dfe5e1;
  color: #607069;
  background: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 600;
  line-height: 14px;
}

.hf-map-marker-shell,
.hf-map-marker-shell.leaflet-div-icon {
  border: 0;
  background: transparent;
}

.hf-map-pin {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 5px;
  color: #fff;
  background: #2d6d4b;
  box-shadow: 0 4px 12px rgba(24, 34, 29, 0.28);
  transform: rotate(-45deg);
}

.hf-map-pin .material-symbols-outlined {
  font-size: 17px;
  transform: rotate(45deg);
}

.hf-map-pin.is-optimal,
.hf-map-list-icon.is-optimal { background: #287a4b; }
.hf-map-pin.is-good,
.hf-map-list-icon.is-good { background: #276ea8; }
.hf-map-pin.is-fair,
.hf-map-list-icon.is-fair { background: #bd7b17; }
.hf-map-pin.is-caution,
.hf-map-list-icon.is-caution { background: #b33b36; }
.hf-map-pin.is-unknown,
.hf-map-list-icon.is-unknown { background: #6f7d76; }

.hf-map-cluster-shell,
.hf-map-cluster-shell.leaflet-div-icon {
  border: 0;
  background: transparent;
}

.hf-map-cluster {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  color: #fff;
  background: #254f3b;
  box-shadow: 0 4px 14px rgba(24, 34, 29, 0.3), 0 0 0 5px rgba(45, 109, 75, 0.17);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 800;
}

.hf-map-cluster.is-optimal { background: #287a4b; }
.hf-map-cluster.is-good { background: #276ea8; }
.hf-map-cluster.is-fair { background: #bd7b17; }
.hf-map-cluster.is-caution { background: #b33b36; }
.hf-map-cluster.is-unknown { background: #6f7d76; }

.hf-map-route-line {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hf-map-popup-location {
  margin-bottom: 3px;
  color: #607069;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 600;
  line-height: 13px;
  text-transform: uppercase;
}

.hf-map-popup-name {
  color: #18221d;
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 21px;
}

.hf-map-popup-metrics {
  margin-top: 7px;
  color: #53635b;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
}

.hf-map-popup-condition {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #263c31;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
}

.hf-map-popup-condition .material-symbols-outlined {
  font-size: 17px;
}

.hf-map-popup-link {
  margin-top: 10px;
  display: inline-block;
  color: #276b49;
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
}

.hf-map-shell .leaflet-popup-content-wrapper,
.hf-map-shell .leaflet-popup-tip {
  color: #18221d;
  background: #fff;
}

.hf-map-shell .leaflet-popup-content {
  min-width: 210px;
  margin: 14px 16px;
}

.hf-map-shell .leaflet-control-attribution,
.hf-map-shell .leaflet-control-scale-line {
  font-size: 9px;
}

.dark .hf-map-shell,
.dark .hf-map-header,
.dark .hf-map-side,
.dark .hf-map-statusbar,
.dark .hf-map-list-row {
  color: #e8eee9;
  background: #111814;
}

.dark .hf-map-toolbar,
.dark .hf-map-legend {
  background: #18211c;
}

.dark .hf-map-shell,
.dark .hf-map-header,
.dark .hf-map-toolbar,
.dark .hf-map-side,
.dark .hf-map-statusbar,
.dark .hf-map-kpis,
.dark .hf-map-kpis > div + div,
.dark .hf-map-legend {
  border-color: #34423a;
}

.dark .hf-map-header h1,
.dark .hf-map-kpis strong,
.dark .hf-map-list-header h2,
.dark .hf-map-list-place strong {
  color: #f0f5f1;
}

.dark .hf-map-freshness,
.dark .hf-map-kpi-label,
.dark .hf-map-list-header span,
.dark .hf-map-list-place small,
.dark .hf-map-list-value,
.dark .hf-map-statusbar,
.dark .hf-map-legend-item {
  color: #aab7af;
}

.dark .hf-map-search,
.dark .hf-map-command,
.dark .hf-map-icon-command,
.dark .hf-map-mode {
  border-color: #4b5c52;
  color: #e8eee9;
  background: #111814;
}

.dark .hf-map-search input {
  color: #f0f5f1;
}

.dark .hf-map-list-row:hover,
.dark .hf-map-list-row:focus-visible,
.dark .hf-map-list-row.is-selected {
  background: #1c2a22;
}

@media (max-width: 760px) {
  #page-map {
    padding: 0;
  }

  #hf-map-root {
    max-width: none;
  }

  .hf-map-shell {
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: none;
  }

  .hf-map-header {
    min-height: 70px;
    padding: 11px 12px;
  }

  .hf-map-header h1 {
    font-size: 22px;
    line-height: 27px;
  }

  .hf-map-mode button {
    min-width: 44px;
    width: 44px;
    padding: 0;
  }

  .hf-map-mode button > span:last-child {
    display: none;
  }

  .hf-map-toolbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 9px 10px;
  }

  .hf-map-command {
    min-width: 40px;
    width: 40px;
    padding: 0;
  }

  .hf-map-command > span:last-child {
    display: none;
  }

  .hf-map-layout {
    display: flex;
    flex-direction: column;
  }

  .hf-map-canvas-wrap {
    height: min(58dvh, 570px);
    min-height: 410px;
  }

  .hf-map-side {
    height: auto;
    min-height: 0;
    border-top: 1px solid #dfe5e1;
    border-left: 0;
  }

  .hf-map-list {
    max-height: 340px;
  }

  .hf-map-statusbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .nav-tab {
    min-width: 0;
    flex: 1 1 20%;
    padding-left: 3px !important;
    padding-right: 3px !important;
  }

  .nav-tab-label {
    font-size: 9px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hf-map-icon-command.is-refreshing .material-symbols-outlined {
    animation: none;
  }
}
