﻿/* 산불 확산 예측 시스템 — site.css
   디자인 레퍼런스: design/산불확산모델링 v3.dc.html (hifi), design/README.md §9 디자인 토큰 */

:root {
  --bg-page: radial-gradient(1400px 700px at 75% -15%, #0e1524 0%, #06080d 60%);
  --bg-sidebar: linear-gradient(180deg, #0a0e17, #080b12);
  --bg-card: linear-gradient(180deg, #131a2a, #0e1420);
  --bg-header: linear-gradient(180deg, rgba(19, 25, 40, 0.92), rgba(9, 12, 19, 0.96));
  --border-card: rgba(255, 255, 255, 0.07);
  --border-hairline: rgba(255, 255, 255, 0.05);

  --text-primary: #eaeef6;
  --text-secondary: #8b98ab;
  --text-secondary-alt: #9fb0c4;
  --text-muted: #5d6b80;
  --text-muted-alt: #7c8798;
  --text-faint: #4a5568;

  --accent-1: #ff9448;
  --accent-2: #ff8a3d;
  --accent-3: #e5511f;
  --accent-4: #c62812;

  --gold-1: #f2b26b;
  --gold-2: #cbb894;
  --gold-3: #f5c84b;

  --blue-1: #7fb8e8;
  --blue-2: #8fc6f5;
  --amber-1: #ffb066;
  --amber-2: #ffbe73;
  --cyan-1: #6fc3e8;
  --cyan-2: #7fd4f5;

  --danger-interest: #6f9fe8;
  --danger-caution: #f5c84b;
  --danger-warning: #ff8a3d;
  --danger-severe: #ff4d3d;

  --link: #ff9448;
  --link-hover: #ffb87e;

  --radius-card: 14px;
  --radius-input: 9px;
  --radius-pill: 999px;

  --shadow-card: 0 12px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-header: 0 10px 34px rgba(0, 0, 0, 0.45);
}

/* ---------- 기본 ---------- */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #06080d;
  font-family: 'Malgun Gothic', '맑은 고딕', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
*, *::before, *::after { box-sizing: border-box; font-family: inherit; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
button, input { font-family: inherit; }
input[type=range] { accent-color: #ff7a29; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #26303f; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

[hidden] { display: none !important; }

@keyframes firePulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 90, 30, 0.55); }
  70% { box-shadow: 0 0 0 16px rgba(255, 90, 30, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 90, 30, 0); }
}
@keyframes liveBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.fire-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd54d, #ff6b2c 55%, #c62812);
  border: 2px solid #fff;
  animation: firePulse 1.6s infinite;
  cursor: pointer;
}
.fire-dot.sel { outline: 3px solid rgba(255, 214, 77, 0.9); }

/* ---------- 전체 레이아웃 ---------- */
.app-shell {
  display: grid;
  grid-template-rows: 54px 1fr;
  grid-template-columns: 352px 1fr;
  height: 100vh;
  overflow: hidden;
  color: var(--text-primary);
  background: var(--bg-page);
}

/* ---------- 헤더 ---------- */
.app-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: var(--bg-header);
  border-bottom: 1px solid rgba(242, 178, 107, 0.16);
  box-shadow: var(--shadow-header);
  backdrop-filter: blur(12px);
}
.app-brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; cursor: pointer; }
.app-brand:hover { color: inherit; }
.app-brand:hover .brand-title { color: var(--link-hover); }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(160deg, #1c2334, #0e131c);
  border: 1px solid rgba(242, 178, 107, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(255, 110, 40, 0.25);
  flex-shrink: 0;
}
.brand-text { display: flex; align-items: baseline; gap: 9px; }
.brand-title { font-size: 19.8px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.15; }
.brand-sub { font-size: 11.5px; font-weight: 500; color: var(--text-secondary); letter-spacing: 0.08em; }

.app-header-actions { margin-left: auto; display: flex; align-items: center; gap: 20px; }

.live-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid #2a3546;
  border-radius: var(--radius-pill);
  background: rgba(255, 77, 61, 0.06);
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff4d3d; animation: liveBlink 1.4s infinite; }
.live-label { font-size: 12.1px; font-weight: 600; color: #ff8a7a; letter-spacing: 0.08em; }

.clock-block { text-align: right; }
.clock-time { font-size: 18.7px; font-weight: 600; letter-spacing: 0.04em; line-height: 1.1; }
.clock-date { font-size: 11.6px; color: var(--text-muted); }

.header-divider { height: 26px; width: 1px; background: #1e2735; }
.header-divider-gold { background: rgba(242, 178, 107, 0.16); }

.header-stat { text-align: right; }
.header-stat-label { font-size: 11px; color: var(--text-muted); letter-spacing: 0.1em; }
.header-stat-value { font-size: 13.2px; font-weight: 600; color: var(--text-secondary-alt); }
.header-stat-accent { font-size: 15.4px; color: var(--accent-1); }

.zsoft-link { display: flex; align-items: center; }
.zsoft-logo { height: 30px; width: auto; opacity: 0.9; }

/* ---------- 사이드바 공통 ---------- */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 15px 17px;
  box-shadow: var(--shadow-card);
}

.card-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.card-title { display: flex; align-items: center; gap: 8px; }
.card-accent {
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: linear-gradient(180deg, #f2b26b, #e5511f);
  box-shadow: 0 0 8px rgba(242, 178, 107, 0.5);
  display: inline-block;
}
.card-label { font-size: 11px; font-weight: 700; letter-spacing: 0.18em; color: var(--gold-2); }

/* ---------- (a) 주소 검색 바 ---------- */
.search-bar { padding: 16px 18px 14px; border-bottom: 1px solid #161d29; }
.search-bar form { display: flex; gap: 7px; }
.search-input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-input);
  padding: 10px 13px;
  color: var(--text-primary);
  font-size: 13.8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus { border-color: #ff7a29; box-shadow: 0 0 0 3px rgba(255, 122, 41, 0.12); }
.search-btn {
  background: linear-gradient(135deg, #ffb066, #e5511f);
  border: none;
  border-radius: var(--radius-input);
  box-shadow: 0 4px 16px rgba(229, 81, 31, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 13.8px;
  font-weight: 700;
  padding: 0 16px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: filter 0.15s;
}
.search-btn:hover { filter: brightness(1.12); }
.search-error { font-size: 12.1px; color: #ff9d7a; margin-top: 6px; }

/* ---------- (b)(c)(d) 선택 발화점 영역 ---------- */
.selected-section { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 0; }

.selected-coords { font-size: 11.6px; color: var(--text-muted); }
.selected-name { font-size: 17.1px; font-weight: 700; margin-bottom: 12px; }

.danger-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.danger-caption { font-size: 12.1px; color: var(--text-secondary); }
.danger-label { font-size: 14.3px; font-weight: 700; }
.danger-gauge { display: flex; gap: 4px; }
.danger-seg { flex: 1; }
.danger-seg-bar { height: 5px; border-radius: 3px; background: #1c2432; }
.danger-seg-label { font-size: 10.5px; text-align: center; margin-top: 4px; letter-spacing: 0.08em; color: #4a5568; }

.weather-body { display: flex; gap: 14px; align-items: center; }
.weather-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.weather-item-label { font-size: 11.6px; color: var(--text-muted-alt); margin-bottom: 2px; }
.weather-item-value { font-size: 20.9px; font-weight: 600; }
.weather-item-unit { font-size: 12.1px; color: var(--text-muted); }
.weather-hum { color: var(--blue-1); }
.weather-wind { color: var(--amber-1); }
.weather-dir { font-size: 17.6px; font-weight: 700; line-height: 1.5; }

.compass {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 1px solid rgba(242, 178, 107, 0.22);
  background: radial-gradient(circle, #121828 55%, #0c111c);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.5), 0 0 12px rgba(242, 178, 107, 0.08);
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.compass-tick { position: absolute; font-size: 9.4px; color: #3a4656; }
.compass-n { top: 4px; left: 50%; transform: translateX(-50%); color: var(--text-muted); }
.compass-s { bottom: 4px; left: 50%; transform: translateX(-50%); }
.compass-w { left: 5px; top: 50%; transform: translateY(-50%); }
.compass-e { right: 5px; top: 50%; transform: translateY(-50%); }
.compass-arrow {
  color: #ff8a3d;
  font-size: 26.4px;
  line-height: 1;
  text-shadow: 0 0 10px rgba(255, 122, 41, 0.6);
  transform: rotate(0deg);
  transition: transform 0.3s ease;
}

.spread-t { font-size: 14.3px; font-weight: 600; color: var(--accent-1); }
.range-slider { width: 100%; margin: 0; }
.range-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 9.9px;
  color: var(--text-faint);
  margin: 3px 0 12px;
}
.spread-metrics { display: flex; flex-direction: column; }
.metric-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-hairline);
  font-size: 13.2px;
}
.metric-row:last-child { border-bottom: none; }
.metric-label { color: var(--text-secondary); }
.metric-value { font-weight: 600; }
.metric-value-evac { font-weight: 700; color: var(--gold-3); }

/* ---------- (e) 미선택 안내 ---------- */
.empty-state {
  margin: 12px 14px 0;
  background: linear-gradient(180deg, #111726, #0d1320);
  border: 1px dashed rgba(242, 178, 107, 0.25);
  border-radius: var(--radius-card);
  padding: 30px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14.3px;
  line-height: 1.8;
}
.empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 1px dashed #2a3546;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19.8px;
  color: #ff8a3d;
}

/* ---------- (f) 발화점 목록 ---------- */
.ignitions-card {
  margin: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ignitions-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.clear-btn {
  background: none;
  border: 1px solid #2a3546;
  color: var(--text-muted-alt);
  font-size: 11.6px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.clear-btn:hover { border-color: #ff6b2c; color: var(--accent-1); }

.ignition-list { display: flex; flex-direction: column; gap: 7px; }
.ignition-row {
  display: flex;
  align-items: center;
  gap: 11px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: 9px;
  padding: 9px 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.ignition-row:hover { border-color: #3a4656; }
.ignition-row.selected { background: rgba(242, 178, 107, 0.07); border-color: rgba(242, 178, 107, 0.55); }
.ignition-num { font-size: 11px; color: var(--accent-2); width: 18px; flex-shrink: 0; }
.ignition-info { flex: 1; min-width: 0; }
.ignition-name { font-size: 13.8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ignition-sub { font-size: 11.6px; color: var(--text-muted); }
.ignition-remove {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 15.4px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}
.ignition-remove:hover { color: #ff6b2c; }

/* ---------- (g) 범례 ---------- */
.legend-section {
  margin-top: auto;
  padding: 13px 18px;
  border-top: 1px solid var(--border-hairline);
  background: rgba(0, 0, 0, 0.25);
}
.legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 11.6px; color: var(--text-muted-alt); }
.legend-item { display: flex; align-items: center; gap: 7px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; display: inline-block; }
.legend-fire { background: rgba(255, 90, 30, 0.45); border: 1px solid #ff6b2c; }
.legend-smoke { background: rgba(150, 150, 160, 0.35); border: 1px solid #9aa; }
.legend-evac { border: 1.5px dashed var(--gold-3); }
.legend-isoline { border: 1px solid rgba(255, 120, 60, 0.7); }
.legend-note { font-size: 10.5px; color: var(--text-faint); margin-top: 9px; line-height: 1.6; }

/* ---------- 지도 영역 ---------- */
.map-main { position: relative; }
.map-container { position: absolute; inset: 0; background: #0d1119; }

/* Leaflet(OSM 폴백) 줌/스카이뷰 컨트롤 다크 테마 — 카카오맵은 자체 UI를 그대로 사용 */
.map-container .leaflet-control-zoom,
.map-container .leaflet-control-layers {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(13, 17, 25, 0.92) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4) !important;
}
.map-container .leaflet-control-zoom a {
  background: transparent !important;
  color: var(--text-secondary-alt) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
.map-container .leaflet-control-zoom a:hover { background: rgba(255, 122, 41, 0.14) !important; color: var(--accent-1) !important; }
.map-container .leaflet-control-layers-toggle { filter: invert(1) brightness(1.3); }
.map-container .leaflet-control-layers-expanded {
  color: var(--text-primary) !important;
  padding: 8px 10px !important;
  font-size: 12.7px !important;
}
.map-container .leaflet-control-layers-selector { accent-color: #ff7a29; }

.map-notice {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(13, 17, 25, 0.94);
  border: 1px solid #2a3546;
  color: var(--text-secondary-alt);
  font-size: 12.7px;
  padding: 8px 16px;
  border-radius: 8px;
  max-width: 560px;
  text-align: center;
  backdrop-filter: blur(8px);
}

.weather-loading {
  position: absolute;
  bottom: 132px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(13, 17, 25, 0.94);
  border: 1px solid #2a3546;
  color: var(--amber-1);
  font-size: 13.2px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(8px);
}

/* ---------- 동네예보 패널 ---------- */
.forecast-panel {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 1000;
  background: rgba(10, 13, 21, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-card);
  padding: 12px 17px;
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.forecast-header { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; flex-wrap: wrap; }
.forecast-title { font-size: 11px; font-weight: 700; letter-spacing: 0.18em; color: #c9d4e2; white-space: nowrap; }
.forecast-meta { font-size: 11.6px; color: var(--text-secondary); }
.forecast-legend { margin-left: auto; display: flex; gap: 12px; font-size: 11px; font-weight: 600; }
.forecast-legend span { display: inline-flex; align-items: center; gap: 3px; }
.fl-temp { color: #ffa050; }
.fl-hum { color: var(--blue-2); }
.fl-wind { color: var(--amber-2); }
.fl-precip { color: var(--cyan-2); }
.forecast-toggle {
  margin-left: 14px;
  background: none;
  border: 1px solid #3a4656;
  color: #c9d4e2;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.forecast-toggle:hover { border-color: #ff7a29; color: var(--accent-1); }

.forecast-chart-wrap { overflow-x: auto; padding-bottom: 2px; }
.forecast-svg { display: block; }
.forecast-labels { display: flex; }
.forecast-label { width: 28px; flex-shrink: 0; font-size: 9.9px; text-align: center; white-space: nowrap; }

/* ---------- 반응형 최소 대응 ---------- */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 300px 1fr; }
  .forecast-legend { display: none; }
}
