/* ========================================================
   기상예보 대시보드 — Design System (Dark & Light)
   ======================================================== */

:root {
  /* 기본: 다크 모드 */
  --bg-body: #0b1120;
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-cell: rgba(30, 41, 59, 0.45);
  --bg-cell-alt: rgba(30, 41, 59, 0.25);
  --bg-cell-hover: rgba(56, 189, 248, 0.08);
  --bg-category: rgba(30, 41, 59, 0.7);

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-dim: #64748b;
  --text-white: #ffffff;

  --border: rgba(148, 163, 184, 0.12);
  --border-header: rgba(255, 255, 255, 0.08);

  --accent: #38bdf8;
  --gradient-header: linear-gradient(135deg, #1e3a8a 0%, #6d28d9 100%);
  --gradient-title: linear-gradient(135deg, #60a5fa, #c084fc);

  /* 미세먼지 등급 */
  --grade-good: #22c55e;
  --grade-normal: #3b82f6;
  --grade-bad: #f59e0b;
  --grade-very-bad: #ef4444;

  /* 기상특보 */
  --alert-bg: rgba(239, 68, 68, 0.12);
  --alert-text: #fca5a5;

  /* 테마 버튼 */
  --theme-btn-bg: rgba(255, 255, 255, 0.08);
  --theme-btn-border: rgba(255, 255, 255, 0.15);
  --theme-btn-text: #e2e8f0;

  /* 기타 */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --font: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.25s ease;
}

/* ========================================================
   라이트 (화이트) 모드
   ======================================================== */
[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-cell: #ffffff;
  --bg-cell-alt: #f1f5f9;
  --bg-cell-hover: rgba(37, 99, 235, 0.06);
  --bg-category: #e2e8f0;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-dim: #64748b;
  --text-white: #ffffff;

  --border: rgba(203, 213, 225, 0.8);
  --border-header: rgba(255, 255, 255, 0.2);

  --accent: #2563eb;
  --gradient-header: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --gradient-title: linear-gradient(135deg, #1d4ed8, #6d28d9);

  /* 미세먼지 등급 */
  --grade-good: #16a34a;
  --grade-normal: #2563eb;
  --grade-bad: #d97706;
  --grade-very-bad: #dc2626;

  /* 기상특보 */
  --alert-bg: rgba(254, 226, 226, 0.8);
  --alert-text: #991b1b;

  /* 테마 버튼 */
  --theme-btn-bg: #ffffff;
  --theme-btn-border: #cbd5e1;
  --theme-btn-text: #0f172a;

  --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 17px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 1.5rem 1rem 2rem;
  transition: background var(--transition), color var(--transition);
}

/* ---- Container ---- */
.container {
  max-width: 1440px;
  margin: 0 auto;
}

/* ========================================================
   Header
   ======================================================== */
.header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-bottom: 0.7rem;
}

.title {
  text-align: center;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-title);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  line-height: 1.1;
}

.meta-row {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
}

.date-badge {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.time-badge {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.2);
}

/* ---- 테마 전환 버튼 (우측 상단 동그란 아이콘 버튼) ---- */
.theme-toggle-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--theme-btn-border);
  background: var(--theme-btn-bg);
  color: var(--theme-btn-text);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, background 0.25s ease;
  flex-shrink: 0;
}
.theme-toggle-btn:hover {
  transform: scale(1.12) rotate(15deg);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.sun-icon { display: inline-block; }
.moon-icon { display: none; }

[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: inline-block; }

/* ---- Refresh Button ---- */
.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: var(--text-white);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.3);
}
.refresh-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.45);
}
.refresh-btn:active { transform: scale(0.97); }

.refresh-btn.loading .refresh-icon {
  animation: spin 0.8s linear infinite;
}
.refresh-btn.loading {
  opacity: 0.7;
  pointer-events: none;
}
.refresh-btn.cooldown {
  background: #64748b;
  box-shadow: none;
  pointer-events: none;
  opacity: 0.6;
}

.refresh-icon { flex-shrink: 0; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================================
   Table Card
   ======================================================== */
.table-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: background var(--transition), border-color var(--transition);
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ========================================================
   Table
   ======================================================== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.02rem;
  line-height: 1.6;
}

/* ---- Header ---- */
thead th {
  background: var(--gradient-header);
  color: var(--text-white);
  padding: 1.05rem 0.8rem;
  font-weight: 700;
  font-size: 1.02rem;
  text-align: center;
  white-space: nowrap;
  border-bottom: 2px solid var(--border-header);
}

thead .th-cat {
  min-width: 145px;
  text-align: center;
}
thead .th-loc {
  min-width: 110px;
}

/* ---- Body Cells ---- */
tbody td, tbody th {
  padding: 0.95rem 0.75rem;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:hover td {
  background: var(--bg-cell-hover);
}

/* Category Column */
.cat-main {
  background: var(--bg-category) !important;
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--text-primary);
  white-space: nowrap;
  text-align: center;
  min-width: 80px;
  border-right: 1px solid var(--border);
}

.cat-sub {
  background: var(--bg-category) !important;
  font-weight: 400;
  font-size: 0.92rem;
  color: var(--text-secondary);
  min-width: 58px;
  text-align: center;
  border-right: 1px solid var(--border);
}

/* 줄무늬 */
tbody tr:nth-child(even) td:not(.cat-main):not(.cat-sub) {
  background: var(--bg-cell-alt);
}
tbody tr:nth-child(odd) td:not(.cat-main):not(.cat-sub) {
  background: var(--bg-cell);
}

/* ---- Data Cells ---- */
.cell-data {
  font-variant-numeric: tabular-nums;
  font-size: 0.98rem;
}

/* 미세먼지 등급 뱃지 */
.dust-badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 14px;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.dust-good     { background: rgba(34,197,94,0.15);  color: var(--grade-good); }
.dust-normal   { background: rgba(59,130,246,0.15); color: var(--grade-normal); }
.dust-bad      { background: rgba(245,158,11,0.15); color: var(--grade-bad); }
.dust-very-bad { background: rgba(239,68,68,0.15);  color: var(--grade-very-bad); }

/* 백업 측정소 표시 배지 (은은하고 세련된 디자인 + 즉각 툴팁) */
.fallback-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: help;
  margin-left: 0.2rem;
  vertical-align: middle;
  transition: all 0.2s ease;
}
.fallback-badge:hover {
  background: rgba(245, 158, 11, 0.25);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.6);
}

/* 즉각 반응 커스텀 툴팁 */
.fallback-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  border: 1px solid rgba(245, 158, 11, 0.4);
  z-index: 999;
}
.fallback-badge:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* 기상특보 */
.alert-cell {
  background: var(--alert-bg) !important;
}
.alert-tag {
  display: block;
  width: fit-content;
  margin: 0.15rem auto;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.alert-tag-clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.alert-tag-clickable:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.alert-warn    { background: rgba(245,158,11,0.18); color: #d97706; }
.alert-danger  { background: rgba(239,68,68,0.18);  color: #dc2626; }

/* 예정 특보 (점선 테두리 + 투명도) */
.alert-scheduled {
  opacity: 0.75;
  border: 1.5px dashed currentColor;
  position: relative;
}
.alert-scheduled:hover {
  opacity: 1;
}

/* 발효시각 표시 */
.alert-eff-time {
  display: block;
  font-size: 0.58rem;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 0.1rem;
  letter-spacing: -0.01em;
}

/* 신규 발표 특보 NEW 뱃지 */
.alert-badge-new {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 800;
  line-height: 1;
  padding: 1.5px 4px;
  margin-left: 4px;
  border-radius: 4px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #ffffff;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.4);
  vertical-align: middle;
  animation: pulse-new 2s infinite ease-in-out;
}

@keyframes pulse-new {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.4);
  }
  50% {
    transform: scale(1.12);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.7);
  }
}

[data-theme="dark"] .alert-warn   { color: #fbbf24; }
[data-theme="dark"] .alert-danger { color: #fca5a5; }
[data-theme="dark"] .alert-badge-new {
  background: linear-gradient(135deg, #f87171, #fb923c);
  color: #0f172a;
}

/* 강수량 */
.rain-value { color: var(--accent); font-weight: 600; }
.rain-forecast-item {
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.rain-forecast-item strong {
  color: var(--accent);
  font-weight: 600;
}

/* 기온 */
.temp-value { font-weight: 500; }
.temp-min { color: #2563eb; }
.temp-max { color: #dc2626; }
.temp-feels {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  font-weight: 500;
}
.temp-feels .feels-num {
  font-weight: 600;
  color: #ea580c;
}

[data-theme="dark"] .temp-min { color: #60a5fa; }
[data-theme="dark"] .temp-max { color: #f87171; }
[data-theme="dark"] .temp-feels .feels-num { color: #fb923c; }

.temp-sep { color: var(--text-dim); margin: 0 0.1rem; }

/* 풍향풍속 */
.wind-dir { font-weight: 500; }
.wind-speed { color: var(--text-secondary); font-size: 0.78rem; }
.wind-arrow {
  font-size: 1.1em;
  color: var(--accent);
  font-weight: 700;
  transition: color 0.2s ease;
}

/* 개황 */
.overview-text { font-weight: 500; }

/* ========================================================
   Loading
   ======================================================== */
.loading-cell {
  padding: 3rem 1rem !important;
  text-align: center !important;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.loading-spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

/* ========================================================
   Footer
   ======================================================== */
.footer {
  text-align: center;
  margin-top: 1.2rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}
.footer .copyright {
  margin-top: 0.35rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

/* ========================================================
   Toast
   ======================================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  padding: 0.6rem 1.4rem;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease;
  z-index: 100;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.toast.success { border-color: rgba(34,197,94,0.6); box-shadow: 0 4px 20px rgba(34,197,94,0.25); }
.toast.error   { border-color: rgba(239,68,68,0.6); box-shadow: 0 4px 20px rgba(239,68,68,0.25); }
.toast.info    { border-color: rgba(59,130,246,0.6); box-shadow: 0 4px 20px rgba(59,130,246,0.25); }

/* ========================================================
   Responsive & Smartphone Mode (스마트폰 최고 가시성 최적화)
   ======================================================== */
@media (max-width: 768px) {
  html { font-size: 14px; }
  body { padding: 0.8rem 0.4rem 1.5rem; }

  /* 스마트폰 헤더 정렬 */
  .header {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: auto;
    margin-bottom: 0.6rem;
    gap: 0.4rem;
  }

  .title {
    font-size: 1.45rem;
    text-align: center;
    margin-bottom: 0.2rem;
  }

  .meta-row {
    position: static;
    transform: none;
    justify-content: center;
    width: 100%;
    gap: 0.5rem;
  }

  /* 테이블 스마트폰 가시성 강화 */
  .table-card {
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  }

  table { font-size: 0.88rem; }

  thead th {
    padding: 0.75rem 0.45rem;
    font-size: 0.88rem;
  }

  tbody td, tbody th {
    padding: 0.7rem 0.45rem;
  }

  /* 모바일 스크롤 시 셀 겹침 방지를 위해 표준 테이블 스크롤 유지 */
  thead .th-cat {
    min-width: 100px;
  }

  thead .th-loc {
    min-width: 85px;
  }

  /* 터치 스크롤 바 미니멀화 */
  .table-wrapper::-webkit-scrollbar {
    height: 4px;
  }
  .table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5);
    border-radius: 4px;
  }
}

.error-cell {
  padding: 3rem 1rem !important;
  text-align: center !important;
  color: var(--grade-bad);
  font-size: 0.85rem;
}

tbody tr {
  animation: fadeIn 0.3s ease both;
}
tbody tr:nth-child(1) { animation-delay: 0.02s; }
tbody tr:nth-child(2) { animation-delay: 0.04s; }
tbody tr:nth-child(3) { animation-delay: 0.06s; }
tbody tr:nth-child(4) { animation-delay: 0.08s; }
tbody tr:nth-child(5) { animation-delay: 0.10s; }
tbody tr:nth-child(6) { animation-delay: 0.12s; }
tbody tr:nth-child(7) { animation-delay: 0.14s; }
tbody tr:nth-child(8) { animation-delay: 0.16s; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   README Floating Button & Modal Popup
   ======================================================== */
.readme-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 30px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  z-index: 90;
}
.readme-btn:hover {
  transform: translateY(-3px) scale(1.04);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
  padding: 1rem;
}
.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 840px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
.modal-backdrop.show .modal-content {
  transform: scale(1);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-category);
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.modal-body {
  padding: 1.6rem 1.8rem;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-primary);
}

/* Modal Markdown Content Styles */
.markdown-body h1 { font-size: 1.35rem; margin-bottom: 0.8rem; font-weight: 700; color: var(--accent); }
.markdown-body h2 { font-size: 1.12rem; margin: 1.3rem 0 0.6rem; font-weight: 600; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.markdown-body h3 { font-size: 0.98rem; margin: 1rem 0 0.4rem; font-weight: 600; }
.markdown-body p { margin-bottom: 0.8rem; color: var(--text-secondary); }
.markdown-body ul { margin-bottom: 1rem; padding-left: 1.4rem; }
.markdown-body li { margin-bottom: 0.35rem; }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.85rem; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 0.5rem 0.8rem; text-align: left; }
.markdown-body th { background: var(--bg-category); font-weight: 600; }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 1.4rem 0; }
.markdown-body code { background: rgba(37, 99, 235, 0.1); color: var(--accent); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.85em; }

/* ========================================================
   미세먼지 & 기온 인포 아이콘
   ======================================================== */
.dust-info-icon,
.temp-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
  border: 1px solid rgba(59, 130, 246, 0.3);
  font-size: 0.65rem;
  font-weight: 700;
  font-style: normal;
  cursor: pointer;
  margin-left: 0.25rem;
  vertical-align: middle;
  transition: all 0.2s ease;
}
.dust-info-icon:hover,
.temp-info-icon:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.6);
  transform: scale(1.15);
}

.temp-info-box {
  line-height: 1.65;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.temp-info-box h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

/* ========================================================
   기상특보 & 미세먼지 기준 팝업 컨텐츠
   ======================================================== */
.alert-popup-content {
  padding: 0.2rem 0;
}
.alert-popup-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}
.alert-criteria-item {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  margin-bottom: 0.6rem;
  background: var(--bg-cell-alt);
  border-left: 3px solid transparent;
  transition: background 0.2s ease;
}
.alert-criteria-item.active {
  background: rgba(59, 130, 246, 0.08);
  border-left-color: var(--accent);
}
.alert-criteria-item strong {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  margin-bottom: 0.4rem;
}
.alert-info-label {
  background: rgba(59,130,246,0.18);
  color: var(--accent);
}
.alert-warn-label {
  background: rgba(245,158,11,0.18);
  color: #d97706;
}
.alert-danger-label {
  background: rgba(239,68,68,0.18);
  color: #dc2626;
}
[data-theme="dark"] .alert-warn-label { color: #fbbf24; }
[data-theme="dark"] .alert-danger-label { color: #fca5a5; }

.alert-criteria-item p {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* 미세먼지 기준 테이블 */
.dust-criteria-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8rem 0;
  font-size: 0.88rem;
}
.dust-criteria-table th,
.dust-criteria-table td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.8rem;
  text-align: center;
}
.dust-criteria-table th {
  background: var(--bg-category);
  font-weight: 600;
  font-size: 0.82rem;
}
.dust-criteria-table tr.dust-good td:first-child { color: var(--grade-good); font-weight: 600; }
.dust-criteria-table tr.dust-normal td:first-child { color: var(--grade-normal); font-weight: 600; }
.dust-criteria-table tr.dust-bad td:first-child { color: var(--grade-bad); font-weight: 600; }
.dust-criteria-table tr.dust-very-bad td:first-child { color: var(--grade-very-bad); font-weight: 600; }
