:root {
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #0ea5e9;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --radius: 12px;
  --header-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, '맑은 고딕', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: #0f172a;
  border-bottom: 1px solid #334155;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  height: 100%; display: flex; align-items: center;
  justify-content: space-between; padding: 0 24px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 28px; }
.logo h1 { color: #f1f5f9; font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }

.search-box {
  position: relative; display: flex; align-items: center;
}
.search-box input {
  width: 320px; padding: 8px 40px 8px 16px;
  background: #1e293b; border: 1px solid #334155;
  border-radius: 24px; color: #f1f5f9; font-size: 14px;
  outline: none; transition: all 0.2s;
}
.search-box input::placeholder { color: #64748b; }
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.2);
}
.search-icon {
  position: absolute; right: 12px; font-size: 16px; cursor: pointer;
}

/* ── Layout ── */
.layout {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* ── Sidebar ── */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--sidebar-bg);
  padding: 20px 0;
  position: fixed; top: var(--header-h); left: 0;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #475569; border-radius: 2px; }

.sidebar-section { padding: 16px 0; border-bottom: 1px solid #334155; }
.sidebar-section:last-child { border-bottom: none; }
.sidebar-section h3 {
  color: #94a3b8; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 0 16px 10px;
}

.dest-list { display: flex; flex-direction: column; }
.dest-list a {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 16px; color: var(--sidebar-text);
  text-decoration: none; font-size: 13px;
  transition: all 0.15s; border-left: 3px solid transparent;
  cursor: pointer;
}
.dest-list a:hover { background: #334155; color: #f1f5f9; }
.dest-list a.active {
  background: #1e3a5f; color: var(--primary);
  border-left-color: var(--primary);
}
.dest-list a .flag { font-size: 16px; }

.tag-filter { padding: 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-btn {
  padding: 3px 10px; border-radius: 20px; border: 1px solid #475569;
  background: transparent; color: #94a3b8; font-size: 11px;
  cursor: pointer; transition: all 0.15s;
}
.tag-btn:hover { border-color: var(--primary); color: var(--primary); }
.tag-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.region-filter { padding: 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.region-btn {
  padding: 4px 12px; border-radius: 20px; border: 1px solid #475569;
  background: transparent; color: #94a3b8; font-size: 12px;
  cursor: pointer; transition: all 0.15s;
}
.region-btn:hover { border-color: var(--accent); color: var(--accent); }
.region-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Main ── */
.main-content {
  margin-left: 240px; flex: 1;
  padding: 28px 32px;
  max-width: calc(1400px - 240px);
}

.page { display: none; }
.page.active { display: block; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f4c75 100%);
  border-radius: var(--radius); padding: 40px 48px;
  margin-bottom: 28px; color: white;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '🌊🏖️🌴🌅';
  position: absolute; right: 40px; top: 50%;
  transform: translateY(-50%);
  font-size: 56px; letter-spacing: 8px; opacity: 0.4;
}
.hero h2 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.hero p { color: #94a3b8; font-size: 16px; margin-bottom: 20px; }
.hero-stats { display: flex; gap: 32px; }
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 28px; font-weight: 800; color: var(--primary); }
.hero-stat .label { font-size: 12px; color: #64748b; margin-top: 2px; }

/* ── Filter Bar ── */
.filter-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 20px; color: var(--text-muted); font-size: 14px;
}
.sort-btn {
  padding: 5px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-muted); font-size: 13px;
  cursor: pointer; transition: all 0.15s;
}
.sort-btn:hover { border-color: var(--primary); color: var(--primary); }
.sort-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Grid ── */
.dest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.dest-card {
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.2s; overflow: hidden;
}
.dest-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.card-header {
  padding: 20px 20px 14px;
  background: linear-gradient(135deg, #1e3a5f, #0f4c75);
  position: relative;
}
.card-flag { font-size: 36px; margin-bottom: 8px; display: block; }
.card-name { color: white; font-size: 20px; font-weight: 700; }
.card-country { color: #94a3b8; font-size: 13px; margin-top: 2px; }
.card-badge {
  position: absolute; top: 14px; right: 14px;
  background: rgba(14,165,233,0.2); border: 1px solid var(--primary);
  color: var(--primary); font-size: 10px; padding: 3px 8px;
  border-radius: 20px; font-weight: 600;
}

.card-body { padding: 16px 20px; }
.card-overview {
  font-size: 13px; color: var(--text-muted); line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.card-meta-item {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-muted);
}
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  padding: 2px 8px; border-radius: 20px;
  background: #f0f9ff; color: var(--primary);
  font-size: 11px; font-weight: 500; border: 1px solid #bae6fd;
}

/* ── Detail Page ── */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-muted); font-size: 14px; cursor: pointer;
  margin-bottom: 24px; transition: all 0.15s;
}
.back-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

.detail-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f4c75 100%);
  border-radius: var(--radius); padding: 36px 40px;
  margin-bottom: 28px; color: white;
}
.detail-flag { font-size: 56px; margin-bottom: 12px; display: block; }
.detail-name { font-size: 36px; font-weight: 800; margin-bottom: 4px; }
.detail-country { color: #94a3b8; font-size: 16px; margin-bottom: 16px; }
.detail-meta { display: flex; gap: 24px; flex-wrap: wrap; }
.detail-meta-item {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08); padding: 8px 16px;
  border-radius: 8px; font-size: 14px;
}
.detail-meta-item .icon { font-size: 18px; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px; margin-bottom: 20px;
}
.detail-grid.full { grid-template-columns: 1fr; }

.detail-section {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.detail-section h3 {
  font-size: 16px; font-weight: 700; margin-bottom: 14px;
  color: var(--text); display: flex; align-items: center; gap: 8px;
  padding-bottom: 10px; border-bottom: 2px solid var(--border);
}
.detail-section ul { list-style: none; }
.detail-section ul li {
  padding: 7px 0; border-bottom: 1px solid var(--border);
  font-size: 14px; color: var(--text); display: flex;
  align-items: flex-start; gap: 8px; line-height: 1.5;
}
.detail-section ul li:last-child { border-bottom: none; }
.detail-section ul li::before {
  content: '•'; color: var(--primary); font-weight: 700;
  margin-top: 2px; flex-shrink: 0;
}
.overview-text {
  font-size: 15px; line-height: 1.8; color: var(--text);
}
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.detail-tag {
  padding: 5px 14px; border-radius: 20px;
  background: #f0f9ff; color: var(--primary);
  font-size: 13px; font-weight: 500; border: 1px solid #bae6fd;
}

/* ── Toast ── */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  background: #1e293b; color: white;
  padding: 12px 20px; border-radius: 8px;
  font-size: 14px; box-shadow: var(--shadow-lg);
  transition: all 0.3s; z-index: 999;
}
.toast.hidden { opacity: 0; pointer-events: none; transform: translateY(8px); }

/* ── Loading ── */
.loading {
  display: flex; justify-content: center; align-items: center;
  height: 200px; gap: 8px; color: var(--text-muted);
  font-size: 16px;
}
.spinner {
  width: 24px; height: 24px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 16px; }

@media (max-width: 1024px) {
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 20px 16px; }
  .search-box input { width: 200px; }
  .dest-grid { grid-template-columns: 1fr; }
}
