/* =========================================================
   style.css — Developed Countries Dashboard
   디자인 컨셉: Apple / Vercel / Stripe / Notion 스타일의
   미니멀 · 프리미엄 데이터 대시보드
   ========================================================= */

/* ---------- 1. 폰트 & 색상 토큰 ---------- */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css");
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --secondary: #60A5FA;
  --bg: #F8FAFC;
  --page-header-bg: #EFF4FC;
  --card: #FFFFFF;
  --card-2: #F1F5F9;
  --text: #111827;
  --subtext: #6B7280;
  --muted: #9CA3AF;
  --success: #10B981;
  --warning: #F59E0B;
  --border: rgba(17, 24, 39, 0.08);
  --shadow: rgba(17, 24, 39, 0.08);
  --nav-bg: rgba(255, 255, 255, 0.7);
  --skeleton-base: #E5E9F0;
  --skeleton-shine: #F4F6F9;
}

html.dark-mode {
  --primary: #3B82F6;
  --primary-dark: #60A5FA;
  --secondary: #60A5FA;
  --bg: #0B1120;
  --page-header-bg: #0F1728;
  --card: #111827;
  --card-2: #1A2436;
  --text: #F1F5F9;
  --subtext: #94A3B8;
  --muted: #64748B;
  --success: #34D399;
  --warning: #FBBF24;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: rgba(0, 0, 0, 0.45);
  --nav-bg: rgba(17, 24, 39, 0.65);
  --skeleton-base: #1A2436;
  --skeleton-shine: #223049;
}

/* ---------- 2. 리셋 & 기본 타이포 ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Pretendard", "Inter", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, select, input { font: inherit; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* 스크롤 리빌: JS가 .reveal 요소에 .in-view를 붙이면 나타난다 */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- 3. 내비게이션 (고정 + 유리질감) ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: transparent;
  transition: background 0.25s ease, box-shadow 0.25s ease, backdrop-filter 0.25s ease;
}
.navbar.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 1px 0 var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; letter-spacing: -0.01em; }
.nav-logo .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--subtext);
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover { color: var(--text); background: var(--card-2); }
.nav-dark-toggle {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
  margin-left: 8px;
}
.nav-dark-toggle:hover { border-color: var(--primary); }
.nav-toggle-mobile { display: none; }

/* ---------- 4. Hero ---------- */
.hero {
  position: relative;
  padding: 148px 0 80px;
  overflow: hidden;
  background:
    radial-gradient(60% 55% at 82% 20%, rgba(37, 99, 235, 0.10), transparent 70%),
    linear-gradient(180deg, var(--page-header-bg), var(--bg) 85%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.10);
  padding: 6px 12px;
  border-radius: 20px;
  margin-bottom: 18px;
}
.hero-title {
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}
.hero-title span { color: var(--primary); }
.hero-subtitle {
  margin-top: 16px;
  font-size: 16px;
  color: var(--subtext);
  max-width: 480px;
  line-height: 1.7;
}
.hero-meta {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.hero-meta .live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

/* 은은한 세계지도 느낌의 장식(순수 CSS 도트 패턴 + 궤도 원) */
.hero-illustration { position: relative; height: 320px; }
.hero-orbit {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px dashed var(--border);
}
.hero-orbit.o2 { inset: 12%; animation: spin 40s linear infinite; }
.hero-orbit.o3 { inset: 26%; animation: spin 60s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(var(--border) 1.4px, transparent 1.4px);
  background-size: 20px 20px;
  mask-image: radial-gradient(circle at center, black 55%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at center, black 55%, transparent 78%);
}
.hero-core {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 92px; height: 92px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 20px 50px rgba(37, 99, 235, 0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
}
.hero-pin {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* ---------- 5. 공통 섹션 ---------- */
section.block { padding: 60px 0; scroll-margin-top: 84px; }
.section-head { margin-bottom: 26px; }
.section-eyebrow { font-size: 12px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.section-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.section-desc { font-size: 13.5px; color: var(--subtext); margin-top: 6px; }

/* ---------- 6. 통계 카드 ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 8px 28px var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.10);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-label { font-size: 11.5px; color: var(--subtext); margin-bottom: 3px; }
.stat-value { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }

/* ---------- 7. 검색 & 자동완성 ---------- */
.search-wrap { position: relative; max-width: 560px; margin: 0 auto 8px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: 0 4px 18px var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }
.search-box input { flex: 1; border: none; background: transparent; color: var(--text); font-size: 15px; }
.search-box input:focus { outline: none; }
.search-box .icon { color: var(--muted); font-size: 16px; }
.autocomplete-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px var(--shadow);
  overflow: hidden;
  z-index: 20;
  display: none;
}
.autocomplete-list.show { display: block; }
.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13.5px;
  cursor: pointer;
}
.autocomplete-item:hover, .autocomplete-item.active { background: var(--card-2); }
.autocomplete-item img { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; }
.autocomplete-item .en { color: var(--muted); font-size: 11.5px; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
}
.select-pill, .toggle-pill {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--subtext);
  cursor: pointer;
}
.select-pill select { border: none; background: transparent; color: var(--text); cursor: pointer; }
.select-pill select:focus { outline: none; }
.toggle-pill.active { color: var(--primary); border-color: var(--primary); background: rgba(37, 99, 235, 0.08); }
.toggle-pill:hover { border-color: var(--primary); }

/* ---------- 8. 국가 카드 그리드 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}
.country-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 2px 10px var(--shadow);
  transition: transform 0.22s cubic-bezier(.2,.8,.2,1), box-shadow 0.22s ease, border-color 0.22s ease;
}
.country-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px var(--shadow); border-color: var(--primary); }

.card-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.card-flag { width: 36px; height: 26px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); flex-shrink: 0; }
.card-names { flex: 1; min-width: 0; }
.card-name-ko { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.card-name-en { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.fav-btn {
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
.fav-btn.active { color: var(--warning); border-color: var(--warning); background: rgba(245, 158, 11, 0.10); }

.card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; margin-bottom: 14px; }
.stat-item .stat-item-label { font-size: 11px; color: var(--subtext); display: block; margin-bottom: 2px; }
.stat-item .stat-item-value { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }

.card-rate {
  background: var(--card-2);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-rate .rate-value { font-weight: 700; color: var(--primary); }

.card-industries { font-size: 11.5px; color: var(--subtext); margin-bottom: 14px; line-height: 1.6; }
.card-industries b { color: var(--text); font-weight: 600; }

.card-detail-btn {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.card-detail-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.empty-result { text-align: center; padding: 50px 0; color: var(--muted); font-size: 13px; }

/* ---------- 9. 스켈레톤 로딩 ---------- */
.skeleton-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  height: 268px;
}
.skeleton-block {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 37%, var(--skeleton-base) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- 10. 국가 비교 ---------- */
.compare-selectors {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  max-width: 640px;
  margin: 0 auto 24px;
}
.compare-select-box select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
}
.compare-vs { font-size: 13px; font-weight: 700; color: var(--muted); }

.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .compare-grid { grid-template-columns: 1fr; } }

.compare-table-wrap { overflow-x: auto; }
table.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  font-size: 13px;
}
table.compare-table th, table.compare-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); }
table.compare-table th { color: var(--subtext); font-weight: 600; background: var(--card-2); font-size: 12px; }
table.compare-table td:not(:first-child) { font-variant-numeric: tabular-nums; font-weight: 600; }
table.compare-table tr:last-child td { border-bottom: none; }
table.compare-table td.winner { color: var(--success); }
table.compare-table td.winner::after { content: " ▲"; font-size: 10px; }

.compare-radar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.compare-radar-card h3 { font-size: 13px; color: var(--subtext); margin-bottom: 10px; }
.compare-radar-box { position: relative; height: 280px; }

/* ---------- 11. 환율 계산기 ---------- */
.converter-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  box-shadow: 0 4px 18px var(--shadow);
}
.converter-field { display: flex; flex-direction: column; gap: 6px; }
.converter-field label { font-size: 11.5px; color: var(--subtext); font-weight: 600; }
.converter-field input, .converter-field select {
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 110px;
}
.converter-swap {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--subtext);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.converter-swap:hover { color: var(--primary); border-color: var(--primary); transform: rotate(180deg); }
.converter-result {
  flex: 1 1 100%;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  transition: opacity 0.15s ease;
}
.converter-note { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* ---------- 12. 차트 ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.chart-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.chart-card h3 { font-size: 13px; margin-bottom: 12px; color: var(--subtext); font-weight: 600; }
.chart-canvas-box { position: relative; height: 260px; }

/* ---------- 13. 상세 모달 ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 14, 23, 0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--card);
  border-radius: 20px;
  max-width: 640px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
  transform: scale(0.94) translateY(10px);
  transition: transform 0.22s cubic-bezier(.2,.8,.2,1);
}
.modal-overlay.show .modal-box { transform: scale(1) translateY(0); }
.modal-hero {
  padding: 26px 26px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: 20px 20px 0 0;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}
.modal-close:hover { background: rgba(255,255,255,0.32); }
.modal-flag { width: 52px; height: 38px; object-fit: cover; border-radius: 6px; border: 1px solid rgba(255,255,255,0.4); }
.modal-title { font-size: 21px; font-weight: 800; }
.modal-subtitle { font-size: 12.5px; opacity: 0.9; margin-top: 3px; }

.modal-body { padding: 22px 26px 26px; }
.modal-desc { font-size: 13.5px; color: var(--subtext); line-height: 1.7; margin-bottom: 18px; }
.modal-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-bottom: 18px; }
.modal-stat { background: var(--card-2); border-radius: 10px; padding: 10px 12px; }
.modal-stat .m-label { font-size: 11px; color: var(--subtext); margin-bottom: 2px; }
.modal-stat .m-value { font-size: 14px; font-weight: 700; }
.modal-section-title { font-size: 12.5px; font-weight: 700; color: var(--text); margin: 18px 0 8px; }
.modal-landmarks { font-size: 13px; color: var(--subtext); line-height: 1.7; }
.modal-map { width: 100%; height: 220px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.modal-map iframe { width: 100%; height: 100%; border: 0; }

/* ---------- 14. 맨 위로 버튼 ---------- */
.scroll-top-btn {
  position: fixed; right: 22px; bottom: 22px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 10px 24px var(--shadow);
  opacity: 0; pointer-events: none;
  transform: translateY(12px) scale(0.9);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
}
.scroll-top-btn.show { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.scroll-top-btn:hover { filter: brightness(1.1); }

/* ---------- 15. 푸터 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0 44px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 16. 반응형 ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-illustration { height: 220px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .compare-selectors { grid-template-columns: 1fr; }
  .compare-vs { justify-self: center; }
  .converter-panel { flex-direction: column; align-items: stretch; }
  .converter-field select, .converter-field input { min-width: 0; width: 100%; }
  .hero { padding-top: 120px; }
}
