/* hymaps-live.css — Live HUD, enhanced markers, add-a-place UI, offline state
 * ──────────────────────────────────────────────────────────────────────────
 * Owned by maps-ui (do NOT put these in hymaps-glass.css). 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 that
 * hymaps-map.js sets on <html> (so neon never bleeds into clean/satellite).
 * iconify-icon only; mobile-first.
 */

/* ════════════════════════════════════════════════════════════════════════
   Live "around you" HUD
   ════════════════════════════════════════════════════════════════════════ */
.hm-hud {
  position: fixed;
  left: 10px;
  top: calc(68px + env(safe-area-inset-top, 0px));
  z-index: 1180;
  max-width: min(80vw, 380px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hm-hud-pill {
  display: flex; align-items: center; gap: 8px;
  max-width: 100%; padding: 8px 12px; min-height: 40px;
  border-radius: 999px; cursor: pointer; text-align: left;
  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: 700 12px/1.2 -apple-system, system-ui, sans-serif;
}
.hm-hud-pill:active { transform: scale(.98); }
.hm-hud-dot {
  flex: none; width: 9px; height: 9px; border-radius: 50%;
  background: var(--muted, #8aa);
}
.hm-hud.is-alert .hm-hud-dot {
  background: var(--danger, #ff4d6d);
  animation: hm-hud-pulse 1.5s ease-in-out infinite;
}
@keyframes hm-hud-pulse { 0%, 100% { opacity: .5; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }
.hm-hud-text {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.hm-hud-bit { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.hm-hud-bit iconify-icon { font-size: 14px; color: var(--accent, #00ffa3); }
.hm-hud-bit.rt-police iconify-icon       { color: var(--info, #3ac9ff); }
.hm-hud-bit.rt-roadblock iconify-icon    { color: var(--danger, #ff4d6d); }
.hm-hud-bit.rt-speedtrap iconify-icon    { color: var(--warning, #fad015); }
.hm-hud-bit.rt-construction iconify-icon { color: var(--orange, #f97316); }
.hm-hud-bit.rt-accident iconify-icon     { color: var(--danger, #ff4d6d); }
.hm-hud-bit.rt-hazard iconify-icon       { color: var(--warning, #fad015); }
.hm-hud-bit.hm-hud-traffic.is-heavy iconify-icon { color: var(--orange, #f97316); }
.hm-hud-bit.hm-hud-traffic.is-jam iconify-icon   { color: var(--danger, #ff4d6d); }
.hm-hud-bit.hm-hud-clear iconify-icon    { color: var(--success, #22c55e); }
.hm-hud-sep { opacity: .35; margin: 0 1px; }
.hm-hud-caret { margin-left: auto; flex: none; font-size: 18px; color: var(--muted, #8aa); transition: transform .2s; }
.hm-hud.is-open .hm-hud-caret { transform: rotate(180deg); }

.hm-hud-panel {
  display: none; padding: 10px 12px; border-radius: 14px;
  background: var(--bg-card, rgba(8, 12, 10, .92));
  border: 1px solid var(--border, rgba(255, 255, 255, .14));
  box-shadow: 0 8px 26px rgba(0, 0, 0, .42);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
}
.hm-hud.is-open .hm-hud-panel { display: block; animation: hm-hud-drop .18s ease; }
@keyframes hm-hud-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.hm-hud-panel-hd {
  font: 800 10px/1 -apple-system, system-ui, sans-serif; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted, #8aa); margin-bottom: 8px;
}
.hm-hud-toggles { display: flex; flex-direction: column; gap: 6px; }
.hm-hud-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border, rgba(255, 255, 255, .14));
  background: transparent; color: var(--text, #e8fff6);
  font: 700 13px/1 -apple-system, system-ui, sans-serif;
}
.hm-hud-toggle iconify-icon { font-size: 18px; color: var(--muted, #8aa); flex: none; }
.hm-hud-toggle span { flex: 1; }
.hm-hud-switch {
  flex: none; width: 34px; height: 20px; border-radius: 999px;
  background: var(--bg-surface, rgba(255, 255, 255, .12)); position: relative;
  border: 1px solid var(--border, rgba(255, 255, 255, .14)); transition: background .15s;
}
.hm-hud-switch::after {
  content: ''; position: absolute; top: 1px; left: 1px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--text, #e8fff6); transition: transform .15s;
}
.hm-hud-toggle.active { border-color: var(--accent, #00ffa3); color: var(--accent, #00ffa3); }
.hm-hud-toggle.active iconify-icon { color: var(--accent, #00ffa3); }
.hm-hud-toggle.active .hm-hud-switch { background: var(--accent, #00ffa3); }
.hm-hud-toggle.active .hm-hud-switch::after { transform: translateX(14px); background: #04130a; }

/* dark cyberpunk neon */
.hm-mt-dark .hm-hud-pill { border-color: var(--accent, #00ffa3); box-shadow: 0 0 16px rgba(0, 255, 163, .22), 0 6px 20px rgba(0, 0, 0, .5); }
.hm-mt-dark .hm-hud.is-alert .hm-hud-dot { box-shadow: 0 0 8px var(--danger, #ff4d6d); }
.hm-mt-dark .hm-hud-panel { border-color: var(--accent, #00ffa3); box-shadow: 0 0 18px rgba(0, 255, 163, .18), 0 8px 26px rgba(0, 0, 0, .55); }

/* ════════════════════════════════════════════════════════════════════════
   Enhanced report markers (age dimming · reliability · confirm badge · neon)
   ════════════════════════════════════════════════════════════════════════ */
.hm-report-marker { position: relative; transition: opacity .25s; }
.hm-report-marker.is-aging { opacity: .8; }
.hm-report-marker.is-old   { opacity: .52; }
.hm-report-marker.is-reliable { box-shadow: 0 0 0 2px rgba(255, 255, 255, .55), 0 2px 8px rgba(0, 0, 0, .5); }
.hm-report-marker.is-shaky { border-style: dashed; opacity: .62; }
.hm-rep-conf {
  position: absolute; top: -7px; right: -7px; min-width: 16px; height: 16px;
  padding: 0 3px; border-radius: 9px; transform: rotate(45deg);
  background: var(--success, #22c55e); color: #04130a;
  border: 1.5px solid var(--bg-deep, #000b06);
  font: 800 10px/16px -apple-system, system-ui, sans-serif; text-align: center;
}
/* dark neon glow per report type (background carries the type hue) */
.hm-mt-dark .hm-report-marker { box-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.hm-mt-dark .hm-report-marker.rt-police       { box-shadow: 0 0 12px var(--info, #3ac9ff), 0 2px 8px rgba(0, 0, 0, .6); }
.hm-mt-dark .hm-report-marker.rt-roadblock,
.hm-mt-dark .hm-report-marker.rt-accident      { box-shadow: 0 0 12px var(--danger, #ff4d6d), 0 2px 8px rgba(0, 0, 0, .6); }
.hm-mt-dark .hm-report-marker.rt-speedtrap,
.hm-mt-dark .hm-report-marker.rt-hazard        { box-shadow: 0 0 12px var(--warning, #fad015), 0 2px 8px rgba(0, 0, 0, .6); }
.hm-mt-dark .hm-report-marker.rt-construction  { box-shadow: 0 0 12px var(--orange, #f97316), 0 2px 8px rgba(0, 0, 0, .6); }
.hm-mt-dark .hm-report-marker.rt-custom        { box-shadow: 0 0 12px var(--purple, #a855f7), 0 2px 8px rgba(0, 0, 0, .6); }
.hm-mt-dark .hm-report-marker.rt-event         { box-shadow: 0 0 12px var(--pink, #f472b6), 0 2px 8px rgba(0, 0, 0, .6); }
.hm-mt-dark .hm-report-marker.is-old { box-shadow: 0 2px 6px rgba(0, 0, 0, .55); } /* fade glow as it ages */


/* Animated Waze-style incident markers */
.hm-report-marker .hm-report-aura {
  position: absolute; inset: -5px; border-radius: inherit; opacity: 0; pointer-events: none;
}
.hm-report-marker.is-police-light {
  background: #111827; overflow: visible;
}
.hm-report-marker.is-police-light .hm-report-aura {
  opacity: 1;
  background: conic-gradient(from 0deg, #ff1744 0 22%, #ffffff 22% 28%, #1e88ff 28% 50%, #ffffff 50% 56%, #ff1744 56% 78%, #1e88ff 78% 100%);
  animation: hm-police-spin .95s linear infinite;
  filter: blur(.3px) drop-shadow(0 0 9px rgba(30,136,255,.9)) drop-shadow(0 0 9px rgba(255,23,68,.75));
  z-index: -1;
}
.hm-report-marker.is-police-light iconify-icon { color: #fff; filter: drop-shadow(0 0 4px #fff); }
@keyframes hm-police-spin { to { transform: rotate(360deg); } }

.hm-report-marker.is-speedtrap {
  background: #fad015; color: #130f00;
  box-shadow: 0 0 0 2px #130f00, 0 0 16px rgba(250,208,21,.8);
}
.hm-report-marker.is-speedtrap::before,
.hm-report-marker.is-speedtrap::after {
  content: ''; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid rgba(250,208,21,.65); transform: rotate(45deg);
  animation: hm-speedtrap-ping 1.45s ease-out infinite;
}
.hm-report-marker.is-speedtrap::after { animation-delay: .55s; }
@keyframes hm-speedtrap-ping { from { transform: rotate(45deg) scale(.65); opacity: .9; } to { transform: rotate(45deg) scale(1.45); opacity: 0; } }

.hm-report-marker.is-construction-zone {
  background: repeating-linear-gradient(45deg, #ffd84a 0 7px, #1c1300 7px 13px);
  color: #fff3b0; border-color: #ffd84a;
  box-shadow: 0 0 0 2px #1c1300, 0 0 15px rgba(255,216,74,.65);
}
.hm-report-marker.is-construction-zone iconify-icon { filter: drop-shadow(0 0 3px #000); }

/* ════════════════════════════════════════════════════════════════════════
   Place markers — shared-contract variants (pin · dot · flat) + special set
   `--mk` is the per-marker color set inline by hymaps-map.js / addplace.
   ════════════════════════════════════════════════════════════════════════ */
.hm-place-marker.is-pin {
  width: 32px; height: 32px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--mk, var(--accent, #00ffa3)); color: #06121b;
  border: 2px solid var(--bg-deep, #000b06);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .5); font-size: 0;
  filter: none;
}
.hm-place-marker.is-pin iconify-icon { transform: rotate(45deg); font-size: 17px; color: #06121b; }
.hm-place-marker.is-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--mk, var(--accent, #00ffa3));
  border: 2px solid var(--bg-deep, #000b06);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5); font-size: 0; filter: none;
}
.hm-place-marker.is-dot iconify-icon { display: none; }
.hm-place-marker.is-flat { color: var(--mk, var(--accent, #00ffa3)); }
.hm-place-marker.is-curated { box-shadow: 0 3px 8px rgba(0, 0, 0, .5), 0 0 0 2px var(--mk, var(--warning, #fad015)); }
.hm-place-marker.is-home {
  background: var(--gold, var(--warning, #fad015)); color: #1a1400;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .5), 0 0 14px var(--gold, rgba(250, 208, 21, .6));
}
.hm-place-marker.is-home iconify-icon { color: #1a1400; }
/* dark neon for the special pins (uses the inline --mk hue) */
.hm-mt-dark .hm-place-marker.is-pin { box-shadow: 0 0 12px var(--mk, var(--accent, #00ffa3)), 0 3px 8px rgba(0, 0, 0, .6); }
.hm-mt-dark .hm-place-marker.is-dot { box-shadow: 0 0 10px var(--mk, var(--accent, #00ffa3)), 0 2px 6px rgba(0, 0, 0, .6); }
.hm-mt-dark .hm-place-marker.is-flat { filter: drop-shadow(0 0 6px var(--mk, var(--accent, #00ffa3))); }

/* ════════════════════════════════════════════════════════════════════════
   Add-a-place "+" FAB + placing crosshair
   ════════════════════════════════════════════════════════════════════════ */
.hm-fab-addplace iconify-icon { color: var(--accent, #00ffa3); }
.hm-fab-addplace-float {
  position: fixed; right: 12px; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); z-index: 1200;
}
.hm-ap-crosshair { position: fixed; inset: 0; z-index: 1900; display: none; pointer-events: none; }
.hm-ap-crosshair.show { display: block; }
.hm-ap-pin {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%);
  color: var(--accent, #00ffa3); font-size: 44px; pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5));
  animation: hm-ap-bob 1.4s ease-in-out infinite;
}
@keyframes hm-ap-bob { 0%, 100% { transform: translate(-50%, -100%); } 50% { transform: translate(-50%, -112%); } }
.hm-ap-confirm {
  position: absolute; left: 0; right: 0; bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 10px; justify-content: center; padding: 0 16px; pointer-events: auto;
}

/* ════════════════════════════════════════════════════════════════════════
   Add-a-place sheet (reuses .hm-sheet base from hymaps-glass.css)
   ════════════════════════════════════════════════════════════════════════ */
.hm-ap-mode { display: flex; gap: 6px; margin: 8px 0 4px; }
.hm-ap-tab {
  flex: 1; min-height: 40px; padding: 9px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border, rgba(255, 255, 255, .14));
  background: var(--bg-card, rgba(255, 255, 255, .04)); color: var(--muted, #8aa);
  font: 700 12px/1 -apple-system, system-ui, sans-serif;
}
.hm-ap-tab.active { background: var(--accent, #00ffa3); color: var(--bg-deep, #000b06); border-color: var(--accent, #00ffa3); }
.hm-ap-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 4px; }
.hm-ap-cat {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; min-height: 66px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border, rgba(255, 255, 255, .14));
  background: var(--bg-card, rgba(255, 255, 255, .04)); color: var(--muted, #8aa);
  font: 600 10px/1.1 -apple-system, system-ui, sans-serif; text-align: center;
}
.hm-ap-cat iconify-icon { font-size: 22px; color: var(--mk, var(--accent, #00ffa3)); }
.hm-ap-cat.active { border-color: var(--mk, var(--accent, #00ffa3)); box-shadow: inset 0 0 0 1px var(--mk, var(--accent, #00ffa3)); color: var(--text, #e8fff6); }

.hm-ap-preview-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.hm-ap-preview { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.hm-ap-preview-hint { font-size: 12px; color: var(--muted, #8aa); }
.hm-ap-icons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.hm-ap-icon {
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; cursor: pointer; color: var(--text, #e8fff6);
  border: 1px solid var(--border, rgba(255, 255, 255, .14));
  background: var(--bg-card, rgba(255, 255, 255, .04));
}
.hm-ap-icon iconify-icon { font-size: 22px; }
.hm-ap-icon.active { border-color: var(--accent, #00ffa3); color: var(--accent, #00ffa3); }
.hm-ap-colors { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hm-ap-color {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; padding: 0;
  background: var(--mk, var(--accent, #00ffa3));
  border: 2px solid var(--bg-deep, #000b06); box-shadow: 0 0 0 1px var(--border, rgba(255, 255, 255, .14));
}
.hm-ap-color.active { box-shadow: 0 0 0 2px var(--text, #e8fff6); }
.hm-ap-color-pick { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--bg-card, rgba(255, 255, 255, .04)); color: var(--muted, #8aa); }
.hm-ap-color-pick iconify-icon { font-size: 16px; }
.hm-ap-color-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.hm-ap-two { display: flex; gap: 10px; }
.hm-ap-two > div { flex: 1; min-width: 0; }

.hm-ap-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.hm-ap-thumb { position: relative; width: 74px; }
.hm-ap-thumb img { width: 74px; height: 74px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border, rgba(255, 255, 255, .14)); display: block; }
.hm-ap-thumb-del {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--danger, #ff4d6d); color: #fff; border: none;
}
.hm-ap-thumb-del iconify-icon { font-size: 14px; }
.hm-ap-thumb-kind {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 0; border: none; cursor: pointer;
  background: rgba(0, 0, 0, .6); color: #fff; border-radius: 0 0 10px 10px;
  font: 700 9px/1.2 -apple-system, system-ui, sans-serif; letter-spacing: .03em;
}
.hm-mt-dark .hm-ap-cat.active { box-shadow: inset 0 0 0 1px var(--mk, var(--accent, #00ffa3)), 0 0 10px color-mix(in srgb, var(--mk, #00ffa3) 50%, transparent); }

/* ════════════════════════════════════════════════════════════════════════
   Consolidated "Download offline" control — saved state (+ dark neon)
   ════════════════════════════════════════════════════════════════════════ */
.hm-off-pill.is-saved { border-color: var(--success, #22c55e); }
.hm-off-pill.is-saved iconify-icon { color: var(--success, #22c55e); }
.hm-mt-dark .hm-off-pill { box-shadow: 0 0 12px rgba(0, 255, 163, .2), 0 6px 20px rgba(0, 0, 0, .45); }
.hm-mt-dark .hm-off-pill.is-saved { box-shadow: 0 0 12px color-mix(in srgb, var(--success, #22c55e) 55%, transparent), 0 6px 20px rgba(0, 0, 0, .45); }

/* ── small-screen tightening ─────────────────────────────────────────────── */
@media (max-width: 374px) {
  .hm-hud { max-width: 86vw; }
  .hm-ap-cats { grid-template-columns: repeat(3, 1fr); }
  .hm-ap-cat { min-height: 60px; font-size: 9px; }
}
