/* hymaps-weather.css — live weather overlays (radar control · rain sheen · alerts)
 * ──────────────────────────────────────────────────────────────────────────
 * Owned by maps-weather (its OWN file — never edits hymaps-glass/live/cyber).
 * THEME ONLY: every color resolves to a Hypatia token with a safe hex fallback.
 * The intentional cyberpunk NEON is gated to the dark map type via the
 * `.hm-mt-dark` class hymaps-map.js sets on <html> (so neon never bleeds into
 * clean/satellite/hybrid). iconify-icon only; mobile-first.
 */

/* ════════════════════════════════════════════════════════════════════════
   Radar control (play/pause · timestamp · conditions readout)
   ════════════════════════════════════════════════════════════════════════ */
.hmw-ctl {
  position: fixed;
  left: 10px;
  /* Sit clear of (and above) the bottom control deck. */
  bottom: calc(var(--hm-deck-collapsed-h, 96px) + 14px + env(safe-area-inset-bottom, 0px));
  z-index: 1210;
  max-width: min(82vw, 320px);
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--bg-card, rgba(8, 12, 10, .9));
  border: 1px solid var(--border, rgba(255, 255, 255, .14));
  color: var(--text, #e8fff6);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  font: 600 12px/1.2 -apple-system, system-ui, sans-serif;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.hmw-ctl.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.hmw-ctl-row { display: flex; align-items: center; gap: 8px; }
.hmw-ctl-btn {
  flex: none; width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-surface, rgba(255, 255, 255, .08));
  border: 1px solid var(--border, rgba(255, 255, 255, .14));
  color: var(--text, #e8fff6);
}
.hmw-ctl-btn:active { transform: scale(.94); }
.hmw-ctl-btn iconify-icon { font-size: 18px; }
.hmw-ctl-close { width: 30px; height: 30px; }
.hmw-ctl-close iconify-icon { font-size: 15px; color: var(--muted, #8aa); }
.hmw-ctl-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hmw-ctl-title {
  display: flex; align-items: center; gap: 5px;
  font: 800 12px/1.1 -apple-system, system-ui, sans-serif;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hmw-ctl-title iconify-icon { font-size: 15px; color: var(--accent, #00ffa3); flex: none; }
.hmw-ts { font-weight: 700; color: var(--muted, #8aa); }
.hmw-cond { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 1px; }
.hmw-cb {
  display: inline-flex; align-items: center; gap: 3px;
  font: 700 11px/1 -apple-system, system-ui, sans-serif; color: var(--text, #e8fff6);
}
.hmw-cb iconify-icon { font-size: 13px; color: var(--muted, #8aa); }
.hmw-cb-rain iconify-icon { color: var(--info, #3ac9ff); }
.hmw-attrib {
  margin-top: 6px; font: 600 9px/1.2 -apple-system, system-ui, sans-serif;
  letter-spacing: .02em; color: var(--muted, #8aa); opacity: .85;
}

/* dark cyberpunk neon */
.hm-mt-dark .hmw-ctl {
  border-color: var(--accent, #00ffa3);
  box-shadow: 0 0 16px rgba(0, 255, 163, .2), 0 6px 20px rgba(0, 0, 0, .5);
}
.hm-mt-dark .hmw-ctl-title iconify-icon { filter: drop-shadow(0 0 5px var(--accent, #00ffa3)); }

/* ════════════════════════════════════════════════════════════════════════
   3D rain sheen — lightweight canvas overlay (only shown when pitched + wet)
   ════════════════════════════════════════════════════════════════════════ */
.hmw-rain {
  position: absolute; inset: 0; z-index: 6;
  pointer-events: none;
  opacity: 0; transition: opacity .5s ease;
}
.hmw-rain.show { opacity: 1; }

/* ════════════════════════════════════════════════════════════════════════
   Severe-weather alert summary (HUD-friendly pill + dropdown list)
   ════════════════════════════════════════════════════════════════════════ */
.hmw-alert-summary {
  position: fixed;
  left: 50%; transform: translateX(-50%) translateY(-8px);
  top: calc(64px + env(safe-area-inset-top, 0px));
  z-index: 1185;
  max-width: min(86vw, 360px);
  display: none; flex-direction: column; gap: 6px; align-items: center;
  opacity: 0; transition: opacity .2s ease, transform .2s ease;
}
.hmw-alert-summary.show { display: flex; opacity: 1; transform: translateX(-50%) translateY(0); }
.hmw-as-pill {
  display: inline-flex; align-items: center; gap: 7px;
  max-width: 100%; padding: 8px 12px; min-height: 38px;
  border-radius: 999px; cursor: pointer; text-align: left;
  background: var(--bg-card, rgba(8, 12, 10, .92));
  border: 1px solid var(--danger, #ff4d6d);
  color: var(--text, #e8fff6);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  font: 800 12px/1.2 -apple-system, system-ui, sans-serif;
}
.hmw-as-pill iconify-icon { font-size: 16px; flex: none; }
.hmw-as-caret { margin-left: 2px; color: var(--muted, #8aa); transition: transform .2s; }
.hmw-alert-summary.is-open .hmw-as-caret { transform: rotate(180deg); }
.hmw-as-list {
  width: 100%; max-height: 46vh; overflow: auto;
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px; border-radius: 14px;
  background: var(--bg-card, rgba(8, 12, 10, .94));
  border: 1px solid var(--border, rgba(255, 255, 255, .14));
  box-shadow: 0 8px 26px rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  animation: hmw-drop .18s ease;
}
@keyframes hmw-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.hmw-as-item {
  display: flex; flex-direction: column; gap: 1px; text-align: left;
  padding: 7px 9px; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--text, #e8fff6);
  border: 1px solid var(--border, rgba(255, 255, 255, .12));
  border-left-width: 3px;
}
.hmw-as-item:active { transform: scale(.99); }
.hmw-as-ev { font: 800 12px/1.15 -apple-system, system-ui, sans-serif; }
.hmw-as-area { font: 600 10px/1.2 -apple-system, system-ui, sans-serif; color: var(--muted, #8aa);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* tier accents (severe→red, moderate→orange, minor→yellow) */
.hmw-tier-severe   { --hmw-c: var(--danger, #ff4d6d); }
.hmw-tier-moderate { --hmw-c: var(--orange, #f97316); }
.hmw-tier-minor    { --hmw-c: var(--warning, #fad015); }
.hmw-as-pill.hmw-tier-moderate { border-color: var(--orange, #f97316); }
.hmw-as-pill.hmw-tier-minor { border-color: var(--warning, #fad015); }
.hmw-as-pill iconify-icon,
.hmw-as-item .hmw-as-ev { color: var(--hmw-c, var(--danger, #ff4d6d)); }
.hmw-as-item { border-left-color: var(--hmw-c, var(--danger, #ff4d6d)); }
.hm-mt-dark .hmw-as-pill { box-shadow: 0 0 16px var(--hmw-c, rgba(255, 77, 109, .5)), 0 6px 20px rgba(0, 0, 0, .5); }

/* leaflet-fallback centroid alert pin */
.hmw-alert-pin {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card, #0b1410); color: var(--hmw-c, #ff4d6d);
  border: 2px solid var(--hmw-c, #ff4d6d);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.hmw-alert-pin iconify-icon { font-size: 16px; }
.hm-mt-dark .hmw-alert-pin { box-shadow: 0 0 12px var(--hmw-c, rgba(255, 77, 109, .6)), 0 2px 8px rgba(0, 0, 0, .6); }

/* ════════════════════════════════════════════════════════════════════════
   Alert detail card (tap an alert polygon / summary item)
   ════════════════════════════════════════════════════════════════════════ */
.hmw-card-overlay {
  position: fixed; inset: 0; z-index: 1300;
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.hmw-card-overlay.show { display: flex; }
.hmw-card {
  width: min(560px, 96vw);
  margin-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  padding: 14px; border-radius: 18px;
  background: var(--bg-card, rgba(10, 14, 12, .96));
  border: 1px solid var(--hmw-c, var(--border, rgba(255, 255, 255, .16)));
  color: var(--text, #e8fff6);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  animation: hmw-card-up .2s ease;
  max-height: 76vh; overflow: auto;
}
@keyframes hmw-card-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.hmw-card-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hmw-card-badge {
  flex: none; width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--hmw-c, #ff4d6d) 22%, transparent);
  color: var(--hmw-c, #ff4d6d);
  border: 1px solid var(--hmw-c, #ff4d6d);
}
.hmw-card-badge iconify-icon { font-size: 20px; }
.hmw-card-titles { flex: 1; min-width: 0; }
.hmw-card-title { font: 800 16px/1.15 -apple-system, system-ui, sans-serif; }
.hmw-card-sub { font: 600 11px/1.2 -apple-system, system-ui, sans-serif; color: var(--muted, #8aa); margin-top: 2px; }
.hmw-icon-btn {
  flex: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-surface, rgba(255, 255, 255, .08));
  border: 1px solid var(--border, rgba(255, 255, 255, .14));
  color: var(--text, #e8fff6);
}
.hmw-icon-btn iconify-icon { font-size: 17px; }
.hmw-card-headline { font: 700 13px/1.35 -apple-system, system-ui, sans-serif; margin: 6px 0; }
.hmw-card-area {
  display: flex; align-items: flex-start; gap: 5px; margin: 6px 0;
  font: 600 11px/1.3 -apple-system, system-ui, sans-serif; color: var(--muted, #8aa);
}
.hmw-card-area iconify-icon { font-size: 14px; flex: none; margin-top: 1px; }
.hmw-card-desc, .hmw-card-instruction {
  font: 500 12px/1.45 -apple-system, system-ui, sans-serif;
  margin: 8px 0; white-space: pre-wrap;
}
.hmw-card-instruction { color: var(--warning, #fad015); }
.hm-mt-dark .hmw-card { box-shadow: 0 0 22px color-mix(in srgb, var(--hmw-c, #ff4d6d) 28%, transparent), 0 16px 48px rgba(0, 0, 0, .6); }

/* Respect reduced-motion: drop the non-essential entrance animations. */
@media (prefers-reduced-motion: reduce) {
  .hmw-ctl, .hmw-alert-summary, .hmw-as-list, .hmw-card { animation: none; transition: none; }
}
