/* Map layers: legend images, control shadows, forecast zones (split from styles.css) */

/* Legend images - invert light images in dark mode */
.legend-img {
  max-height: 18rem;
  max-width: 7rem;
  width: auto;
  height: auto;
  display: block;
}

.fire-legend>img {
  max-width: 15rem;
}

.danger-legend>img {
  max-width: 10rem;
}

.leaflet-bar:not(#map_subtitle) {
  /* Leaflet uses this element as a layout wrapper; the visible control owns the chrome. */
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.leaflet-bar a,
.leaflet-bar button,
.easy-button-button {
  background-color: var(--surface-btn) !important;
  border: 1px solid var(--surface-bar-border) !important;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-control) !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
  box-sizing: border-box !important;
  width: 30px !important;
  height: 30px !important;
  line-height: 28px !important;
}

.leaflet-control-zoom-in {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.leaflet-control-zoom-out {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}

.leaflet-bar.leaflet-control-zoom:not(#map_subtitle) {
  box-shadow: var(--shadow-control) !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.leaflet-bar.leaflet-control-zoom:not(#map_subtitle) > .leaflet-control-zoom-in,
.leaflet-bar.leaflet-control-zoom:not(#map_subtitle) > .leaflet-control-zoom-out {
  box-shadow: none !important;
}

/* The collapsed toggle owns the visible control chrome, matching standalone map controls. */
.leaflet-control-layers:not(.leaflet-control-layers-expanded),
body.dark-mode .leaflet-control-layers:not(.leaflet-control-layers-expanded) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.leaflet-control-layers-toggle {
  background-color: var(--surface-btn) !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  border: 1px solid var(--surface-bar-border) !important;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-control) !important;
}

.fcst-zone-missing {
  fill: var(--fill-missing);
}

.fcst-zone-missing:hover {
  fill: var(--fill-missing-hover);
}

.fcst-zone:not(.fcst-zone-missing) {
  fill-opacity: 0.6;
}

.fcst-zone:not(.fcst-zone-missing):hover {
  fill-opacity: 0.8;
}

.leaflet-overlay-pane svg path.leaflet-interactive {
  outline: none;
}

/* Dark mode */

body.dark-mode .legend-img.invert-light-image {
  filter: invert(1);
}

body.dark-mode .fcst-zone-missing {
  fill: var(--fill-missing);
}

body.dark-mode .fcst-zone-missing:hover {
  fill: var(--fill-missing-hover);
}

/* GOES Satellite Toggle (inside aqmapr legend) */

.goes-toggle-container {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  user-select: none;
}

.goes-toggle-label {
  cursor: pointer;
  white-space: nowrap;
}

.goes-toggle-label.goes-toggle-east {
  color: var(--text-primary, #333);
}

.goes-toggle-label.goes-toggle-west {
  color: var(--text-secondary, #666);
}

/* Toggle switch */
.goes-toggle-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.goes-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.goes-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--accent-primary, #1c7a43);
  border-radius: 18px;
  transition: 0.2s;
}

.goes-toggle-slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  right: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
}

.goes-toggle-switch input:checked + .goes-toggle-slider {
  background-color: var(--accent-secondary, #2563eb);
}

.goes-toggle-switch input:checked + .goes-toggle-slider::before {
  transform: translateX(-14px);
}

/* Highlight active satellite label */
.goes-toggle-label {
  color: var(--text-secondary, #999);
  transition: color 0.15s;
}

.goes-toggle-label.goes-active {
  color: var(--text-primary, #333);
  font-weight: 600;
}

.goes-legend-heading {
  font-family: "Inter", Arial, Helvetica, sans-serif;
  line-height: 1.4;
  margin-bottom: 4px;
}

.goes-legend-heading a {
  color: inherit;
}

