/* naver.css — Naver-map look for the flood site.
   Loaded after style.css (and after each page's inline <style>); only restyles
   surfaces, colours and layout of existing elements. Remove the <link> to revert. */

:root {
  --nv-blue: #2e6ff2;
  --nv-blue-dark: #1f5ad8;
  --nv-blue-bg: #eef4ff;
  --nv-green: #03c75a;
  --nv-red: #e5484d;
  --nv-text: #222;
  --nv-sub: #555;
  --nv-mute: #8f959e;
  --nv-line: #e4e8eb;
  --nv-bg: #f5f6f8;
  --nv-radius: 8.5px;
  --nv-shadow: 0 1.7px 5.1px rgba(0, 0, 0, 0.12), 0 0 0.85px rgba(0, 0, 0, 0.18);
  --nv-shadow-lg: 0 3.4px 15.3px rgba(0, 0, 0, 0.16), 0 0 0.85px rgba(0, 0, 0, 0.2);
}

html, body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Malgun Gothic', '맑은 고딕', sans-serif;
  color: var(--nv-text);
}

/* ── Shared white card surface ─────────────────────────────────────── */
.overlay, #rain-panel, #sim-panel, #cn-legend, #flow-legend, #flow-status {
  background: #fff;
  border: none;
  border-radius: var(--nv-radius);
  box-shadow: var(--nv-shadow);
  backdrop-filter: none;
  color: var(--nv-text);
}

/* ── Top-left panel: title + page tabs + layer chips ───────────────── */
.top-left { width: 255px; max-width: none; box-sizing: border-box; padding: 9.35px 11.05px 10.2px; z-index: 12; }
.top-left h1 { font-size: 12.16px; font-weight: 800; letter-spacing: -0.26px; color: var(--nv-text); margin: 0; }
.subtitle { margin-top: 2.55px; color: var(--nv-sub); }
.subtitle b { color: var(--nv-blue); }

.page-tabs {
  display: flex; margin-top: 8.5px;
  border: 0.85px solid var(--nv-line); border-radius: 6.8px; overflow: hidden;
}
.page-tabs a {
  flex: 1; text-align: center; padding: 5.1px 3.4px;
  font-size: 9.35px; font-weight: 700; color: var(--nv-sub);
  text-decoration: none; white-space: nowrap; background: #fff;
  border-left: 0.85px solid var(--nv-line);
}
.page-tabs a:first-child { border-left: none; }
.page-tabs a:hover { background: var(--nv-bg); color: var(--nv-text); }
.page-tabs a.active { background: var(--nv-blue); color: #fff; }

/* Layer chips (was the "마우스 호버" checkbox list) */
#hover-checklist {
  position: static; width: auto;
  display: flex; flex-wrap: wrap; gap: 4.25px;
  margin-top: 8.5px; padding: 8.5px 0 0;
  border: none; border-top: 0.85px solid var(--nv-line); border-radius: 0;
  background: none; box-shadow: none;
}
#hover-checklist .hc-title, #hover-checklist .hc-divider { display: none; }
#hover-checklist .hc-row, #hover-checklist #sat-toggle {
  position: static;
  display: inline-flex; align-items: center; gap: 4.25px;
  padding: 4.25px 8.5px; margin: 0;
  border: 0.85px solid var(--nv-line); border-radius: 13.6px;
  background: #fff; box-shadow: none;
  font-family: inherit; font-size: 9.35px; font-weight: 700; color: var(--nv-sub);
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#hover-checklist .hc-row:hover, #hover-checklist #sat-toggle:hover { background: var(--nv-bg); color: var(--nv-text); }
#hover-checklist input[type=checkbox] { display: none; }
#hover-checklist .hc-row:has(input:checked), #hover-checklist #sat-toggle.active {
  border-color: var(--nv-blue); background: var(--nv-blue-bg); color: var(--nv-blue);
}
#hover-checklist .hc-row:has(input[data-k="pipe"])::before,
#hover-checklist .hc-row:has(input[data-k="bnd"])::before,
#hover-checklist .hc-row:has(input[data-k="flood"])::before {
  content: ''; width: 6.8px; height: 6.8px; border-radius: 50%; flex-shrink: 0;
}
#hover-checklist .hc-row:has(input[data-k="pipe"])::before  { background: #6b7a90; }
#hover-checklist .hc-row:has(input[data-k="bnd"])::before   { background: #e0b020; }
#hover-checklist .hc-row:has(input[data-k="flood"])::before { background: #1a5fbb; }
#hover-checklist #sat-toggle .sat-icon { font-size: 9.35px; }

/* CN legend: below the info card on the left (top-left panel height varies) */
#cn-legend { top: auto !important; bottom: 174.25px; left: 6.63px; }

/* ── Right cards ───────────────────────────────────────────────────── */
#rain-panel { padding: 7.65px 9.35px; }
#sim-panel { padding: 7.65px 9.35px; }
.sp-header { font-weight: 800; color: var(--nv-text); border-bottom-color: var(--nv-line); }
.sp-live-block { background: var(--nv-bg); border: none; border-radius: 6.8px; }
.sp-divider { background: var(--nv-line); }
.sp-lbl, .rp-lbl, .lbl { color: var(--nv-sub); }
#rain-mini { border-radius: 5.1px; }

/* ── Bottom-left info card ─────────────────────────────────────────── */
.bottom-right { padding: 7.65px 9.35px; }
#camera-info { color: var(--nv-mute); border-top-color: var(--nv-line); }

/* ── Time bar (bottom) ─────────────────────────────────────────────── */
#time-bar {
  background: #fff; color: var(--nv-text);
  border: none; border-radius: 22.1px;
  box-shadow: var(--nv-shadow-lg);
  padding: 5.1px 10.2px;
}
.tc-btn { background: var(--nv-blue); }
.tc-btn:hover { background: var(--nv-blue-dark); }
.tc-btn.playing { background: var(--nv-red); }
.tc-btn.small { background: var(--nv-bg); color: var(--nv-sub); }
.tc-btn.small:hover { background: #e8ecf1; }
#time-slider { background: var(--nv-line); }
#time-slider::-webkit-slider-thumb {
  background: var(--nv-blue); border: 1.7px solid #fff;
  box-shadow: 0 0.85px 2.55px rgba(0, 0, 0, 0.35);
}
.tc-time { color: var(--nv-text); }
.tc-step { color: var(--nv-mute); }
#speed-sel { background: var(--nv-bg); color: var(--nv-text); border: 0.85px solid var(--nv-line); }
#speed-sel option { background: #fff; color: var(--nv-text); }
#sound-btn { background: var(--nv-bg); color: var(--nv-sub); border: 0.85px solid var(--nv-line); }
#sound-btn:hover { background: #e8ecf1; }
#sound-btn.on { background: var(--nv-blue); border-color: var(--nv-blue); color: #fff; }

/* ── Small floating bits ───────────────────────────────────────────── */
#hint { background: #fff; color: var(--nv-sub); border: none; box-shadow: var(--nv-shadow); }
#data-attribution { background: rgba(255, 255, 255, 0.8); color: #666; }
#loading { background: #fff; color: var(--nv-text); box-shadow: var(--nv-shadow-lg); border-radius: 10.2px; font-weight: 700; }
.place-label { background: #fff; border: none; box-shadow: var(--nv-shadow); border-radius: 11.9px; color: var(--nv-text); }

/* ── Hover tooltips ────────────────────────────────────────────────── */
#pipe-tooltip, #boundary-tooltip, #flood-tooltip, #cn-tooltip, #rec-tooltip {
  background: #fff; border: none; border-radius: 12px;
  box-shadow: var(--nv-shadow-lg); color: var(--nv-text);
}
.pt-divider, .bt-divider, .ft-divider, .cn-tt-divider { background: var(--nv-line); }

/* ── 100년 page: scenario segmented bar + fact strip ───────────────── */
#scen-bar {
  background: #fff; color: var(--nv-text);
  border: none; border-radius: 20.4px; box-shadow: var(--nv-shadow-lg);
  padding: 4.25px 5.1px 4.25px 11.9px; gap: 4.25px;
}
#scen-bar .scen-title { color: var(--nv-text); font-weight: 800; border-right-color: var(--nv-line); }
#scen-bar button {
  background: #fff; color: var(--nv-sub);
  border: 0.85px solid var(--nv-line); border-radius: 13.6px; font-weight: 700;
}
#scen-bar button:hover { background: var(--nv-bg); border-color: var(--nv-line); color: var(--nv-text); }
#scen-bar button.active { background: var(--nv-blue); border-color: var(--nv-blue); color: #fff; }
#scen-facts {
  background: #fff; color: var(--nv-sub);
  border: none; border-radius: 13.6px; box-shadow: var(--nv-shadow);
}
#scen-facts span.k { color: var(--nv-mute); }
#scen-facts span.v { color: var(--nv-text); }
#scen-facts span.red-v { color: var(--nv-red); }

/* ── 물의 흐름 page: legend + status cards ─────────────────────────── */
#flow-legend, #flow-status { color: var(--nv-sub); }
#flow-legend .fl-title, #flow-status .fs-title { color: var(--nv-text); border-bottom-color: var(--nv-line); }
#flow-status .fs-val { color: var(--nv-blue); }
#flow-status .fs-val.red { color: var(--nv-red); }

/* ── Map pins (hotspots / external inflow) ─────────────────────────── */
.map-pin { pointer-events: none; }                    /* only the pin shape takes the mouse */
.map-pin svg { pointer-events: auto; cursor: pointer; }
.map-pin .pin-wrap {
  display: flex; flex-direction: column; align-items: center;
  transform: translateY(-50%);            /* pin tip sits on the anchor point */
}
.map-pin svg {
  display: block; overflow: visible;
  filter: drop-shadow(0 1.7px 2.55px rgba(0, 0, 0, 0.35));
  transform-origin: 50% 100%; transition: transform 0.12s ease;
}
.map-pin:hover svg, .map-pin.hover svg { transform: scale(1.18); }
.map-pin .hotspot-label { margin-bottom: 4.25px; }
.map-pin.pin-main { z-index: 3; }
.map-pin.pin-inflow { opacity: 0.95; }
.map-pin .pin-wrap { position: relative; }
.map-pin .hotspot-label.side {           /* main hotspot label: right of the pin head, out of the flow */
  position: absolute; left: calc(100% + 3.4px); top: 15.3px; margin: 0;
}

/* ── Simulation card (right) ───────────────────────────────────────── */
#sim-panel { width: 236px; padding: 11px 12px 12px; }
.sp2-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 9px; }
.sp2-title { font-size: 12.5px; font-weight: 800; color: var(--nv-text); line-height: 1.3; }
.sp2-badge { flex-shrink: 0; font-size: 9.5px; font-weight: 700; color: var(--nv-blue); background: var(--nv-blue-bg); padding: 2px 7px; border-radius: 10px; }
.sp2-hero { background: var(--nv-bg); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; }
.sp2-hero span { display: block; font-size: 10px; font-weight: 600; color: var(--nv-sub); }
.sp2-hero b { font-size: 19px; font-weight: 800; color: var(--nv-text); letter-spacing: -0.3px; }
.sp2-hero small, .sp2-tile small { font-size: 0.6em; font-weight: 700; color: var(--nv-sub); }
.sp2-ratio { display: inline-block; margin-top: 3px; font-style: normal; font-size: 9.5px; font-weight: 700; color: var(--nv-red); background: #fdecec; padding: 1px 6px; border-radius: 9px; }
.sp2-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sp2-tiles.three { grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.sp2-tile { background: var(--nv-bg); border-radius: 8px; padding: 7px 6px; text-align: center; min-width: 0; }
.sp2-tile b { display: block; font-size: 14px; font-weight: 800; color: var(--nv-text); white-space: nowrap; }
.sp2-tiles.three .sp2-tile b { font-size: 11.5px; }
.sp2-tile span { display: block; margin-top: 2px; font-size: 9px; font-weight: 600; color: var(--nv-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp2-tile.hot b { color: var(--nv-red); }
.sp2-live { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--nv-line); }
.sp2-live-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; font-size: 11px; font-weight: 800; color: var(--nv-text); }
.sp2-time { font-size: 10px; font-weight: 800; color: #fff; background: var(--nv-blue); padding: 1px 7px; border-radius: 9px; }
.sp2-live .sp2-tile { background: #fff; border: 1px solid var(--nv-line); }
.sp2-row { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 10px; color: var(--nv-sub); }
.sp2-row b { font-weight: 700; color: var(--nv-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Info card (bottom-left): map legend ───────────────────────────── */
.bottom-right { width: 178px; }
.ib-title { font-size: 11px; font-weight: 800; color: var(--nv-text); margin-bottom: 6px; }
.ib-row { display: flex; align-items: center; gap: 7px; padding: 3px 0; font-size: 10.5px; color: var(--nv-sub); }
.ib-row b { margin-left: auto; font-weight: 700; color: var(--nv-text); white-space: nowrap; }
.ib-line { width: 16px; height: 3px; border-radius: 2px; background: var(--c); flex-shrink: 0; }
.ib-line.thin { height: 2px; }
.ib-pin { width: 11px; height: 14px; flex-shrink: 0; margin: 0 2.5px; }
#camera-info { display: none; }
body.debug #camera-info { display: block; }
#sim-panel #sp-peak-node { font-family: inherit; font-size: 10px; letter-spacing: 0; color: var(--nv-text); }
