/* ═══════════════════════════════════════
   首爾賞櫻地圖 — Editorial Cartography
   ═══════════════════════════════════════ */

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

:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-warm: #fdfcfa;
  --border: #eae8e4;
  --border-light: #f2f0ec;
  --text: #1a1a1a;
  --text-secondary: #6b6560;
  --text-tertiary: #9e9890;
  --accent: #c9566e;
  --accent-light: #f5e6ea;
  --accent-muted: #d4899a;
  --radius: 10px;
  --radius-sm: 7px;
  --font-display: 'Noto Serif TC', 'Georgia', serif;
  --font-body: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══ Header ═══ */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 18px 0 16px;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
}
.header-eyebrow {
  font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 2px;
}
.header h1 {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 900; line-height: 1.15;
  color: var(--text); letter-spacing: -0.5px;
}
.header .subtitle {
  font-size: 12px; color: var(--text-secondary); margin-top: 4px; font-weight: 400;
}

/* Share */
.share-btns { display: flex; gap: 6px; flex-shrink: 0; align-items: flex-end; }
.share-btn {
  padding: 6px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); font-size: 11px; font-weight: 600;
  cursor: pointer; font-family: var(--font-body); transition: all .15s;
  letter-spacing: 0.3px;
}
.share-btn:hover { border-color: var(--text-tertiary); color: var(--text); }
.share-btn:active { transform: scale(.97); }

/* ═══ Toolbar ═══ */
.toolbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 999;
}
.search-wrap { padding: 10px 20px 0; }
.search-input {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: var(--font-body); outline: none;
  background: var(--bg); color: var(--text);
  transition: all .2s;
}
.search-input:focus { border-color: var(--accent-muted); background: var(--surface); }
.search-input::placeholder { color: var(--text-tertiary); }

.filter-bar {
  padding: 8px 20px 10px; display: flex; gap: 4px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-btn {
  flex-shrink: 0; padding: 5px 12px; border-radius: 4px;
  border: none; background: transparent;
  color: var(--text-tertiary); font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: var(--font-body); transition: all .15s;
  white-space: nowrap;
}
.filter-btn:hover { color: var(--text-secondary); background: var(--border-light); }
.filter-btn.active {
  color: var(--accent); background: var(--accent-light);
  font-weight: 600;
}
.filter-btn .count { font-size: 10px; opacity: .6; margin-left: 1px; }
.fave-filter { color: var(--accent-muted); }

/* ═══ Map ═══ */
#map { width: 100%; height: 56vh; min-height: 280px; border-bottom: 1px solid var(--border); }

/* ═══ Stats ═══ */
.stats-bar {
  padding: 8px 20px; display: flex;
  justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text-tertiary);
  background: var(--surface-warm); border-bottom: 1px solid var(--border-light);
}
.result-count { font-weight: 700; color: var(--accent); }

/* ═══ Spot cards ═══ */
.spot-list {
  padding: 16px 20px 40px;
  display: flex; flex-direction: column; gap: 8px;
}
.spot-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 16px 18px; cursor: pointer; transition: all .2s;
  border: 1px solid var(--border-light);
}
.spot-card:hover { border-color: var(--border); box-shadow: 0 2px 12px rgba(0,0,0,.04); }
.spot-card:active { transform: scale(.995); }
.spot-faved { border-left: 3px solid var(--accent); }
.spot-name {
  font-size: 15px; font-weight: 700; color: var(--text);
  line-height: 1.3; margin-bottom: 1px;
}
.spot-name-kr { font-size: 11px; color: var(--text-tertiary); margin-bottom: 8px; }
.spot-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 7px; border-radius: 3px; font-size: 10px; font-weight: 500;
  letter-spacing: 0.2px;
}
.tag-flower { background: var(--accent-light); color: var(--accent); }
.tag-district { background: #eef2f7; color: #4a6182; }
.tag-type { background: #eef5f0; color: #3d6b4f; }
.tag-bloom { background: #f7f3eb; color: #8a7350; }
.tag-hot { background: #fef2f2; color: #b33b3b; }
.tag-hidden { background: #eef0f8; color: #4a4e8a; }
.spot-info {
  font-size: 11px; color: var(--text-tertiary); line-height: 1.5;
  margin-top: 2px;
}
.spot-actions { margin-top: 10px; display: flex; gap: 6px; }
.btn-nav {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 6px 12px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600;
  border: none; cursor: pointer; font-family: var(--font-body); transition: all .15s;
  text-decoration: none; letter-spacing: 0.2px;
}
.btn-nav-primary {
  background: var(--accent-light); color: var(--accent);
  border: 1px solid #e8cdd4;
}
.btn-nav-primary:hover { background: #f0dae0; }
.btn-nav-naver {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-nav-naver:hover { border-color: var(--text-tertiary); color: var(--text); }

/* Fave */
.fave-btn {
  background: none; border: none; font-size: 18px; cursor: pointer;
  padding: 0 2px; transition: transform .15s; flex-shrink: 0; line-height: 1;
}
.fave-btn:hover { transform: scale(1.15); }

/* ═══ Leaflet popup ═══ */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius) !important; padding: 0 !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.12) !important;
  border: 1px solid var(--border) !important;
}
.leaflet-popup-content { margin: 0 !important; min-width: 220px !important; }
.popup-content { padding: 16px; }
.popup-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 1px; }
.popup-name-kr { font-size: 11px; color: var(--text-tertiary); margin-bottom: 8px; }
.popup-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 8px; }
.popup-detail { font-size: 11px; color: var(--text-secondary); line-height: 1.6; }
.popup-nav { margin-top: 10px; display: flex; gap: 5px; }
.popup-nav a {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 5px 10px; border-radius: 5px; text-decoration: none;
  font-size: 11px; font-weight: 600;
}
.popup-nav-google { background: var(--accent-light); color: var(--accent); border: 1px solid #e8cdd4; }
.popup-nav-naver { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }

/* ═══ Map markers ═══ */
.cherry-marker {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; font-size: 15px;
  box-shadow: 0 1px 6px rgba(0,0,0,.12); border: 2px solid white;
}
.cherry-marker-cherry { background: #f5d5dc; }
.cherry-marker-forsythia { background: #f5eecc; }
.cherry-marker-azalea { background: #f0d0d0; }
.cherry-marker-tulip { background: #f0dcc8; }
.cherry-marker-other { background: #d5e8da; }

/* Cluster */
.marker-cluster-small { background: rgba(201,86,110,.15) !important; }
.marker-cluster-small div { background: var(--accent-muted) !important; color: white !important; font-weight: 600 !important; font-size: 12px !important; }
.marker-cluster-medium { background: rgba(201,86,110,.2) !important; }
.marker-cluster-medium div { background: var(--accent) !important; color: white !important; font-weight: 600 !important; font-size: 12px !important; }
.marker-cluster-large { background: rgba(201,86,110,.25) !important; }
.marker-cluster-large div { background: #a3445a !important; color: white !important; font-weight: 600 !important; font-size: 12px !important; }

/* ═══ Bloom tip ═══ */
.bloom-tip {
  padding: 16px 20px; background: var(--surface-warm);
  border-top: 1px solid var(--border-light);
}
.bloom-tip-inner {
  max-width: 640px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.bloom-tip-text { flex: 1; }
.bloom-tip-text strong {
  display: block; font-size: 12px; color: var(--text);
  margin-bottom: 3px; font-weight: 700;
}
.bloom-tip-text span { font-size: 11px; color: var(--text-secondary); line-height: 1.5; }
.bloom-tip-links { display: flex; gap: 4px; flex-shrink: 0; }
.bloom-tip-dl {
  padding: 5px 12px; border-radius: var(--radius-sm);
  background: var(--text); color: var(--surface);
  text-decoration: none; font-size: 10px; font-weight: 600;
  letter-spacing: 0.3px; transition: opacity .15s;
}
.bloom-tip-dl:hover { opacity: .8; }

/* ═══ Footer ═══ */
.footer {
  background: var(--text); padding: 24px 20px;
}
.footer-inner {
  max-width: 640px; margin: 0 auto; text-align: center;
}
.footer-links {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.footer-links a {
  font-size: 11px; color: rgba(255,255,255,.5); text-decoration: none;
  transition: color .15s;
}
.footer-links a:hover { color: rgba(255,255,255,.8); }
.footer-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(255,255,255,.2);
}
.footer p { font-size: 10px; color: rgba(255,255,255,.3); line-height: 1.6; }
.footer-credit { margin-top: 12px; }
.footer-credit a {
  font-size: 10px; color: rgba(255,255,255,.25); text-decoration: none;
  letter-spacing: 1px; text-transform: uppercase;
}
.footer-credit a:hover { color: rgba(255,255,255,.5); }

/* ═══ Scroll top ═══ */
.scroll-top {
  position: fixed; bottom: 20px; right: 20px; width: 36px; height: 36px;
  border-radius: 50%; background: var(--text); color: var(--surface); border: none;
  font-size: 14px; cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,.15); z-index: 998;
  display: none; align-items: center; justify-content: center;
  transition: all .15s;
}
.scroll-top:hover { opacity: .8; transform: translateY(-2px); }

/* ═══ Responsive ═══ */
@media (max-width: 767px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 0 14px; }
  .share-btns { width: 100%; }
  .share-btn { flex: 1; text-align: center; }
  .header h1 { font-size: 22px; }
  .bloom-tip-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .bloom-tip-links { width: 100%; }
  .bloom-tip-dl { flex: 1; text-align: center; padding: 8px 12px; }
}
@media (min-width: 768px) {
  .header { padding: 0 32px; }
  .toolbar .search-wrap { padding: 10px 32px 0; }
  .toolbar .filter-bar { padding: 8px 32px 10px; }
  .stats-bar { padding: 8px 32px; }
  .spot-list { padding: 16px 32px 40px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .bloom-tip { padding: 20px 32px; }
  #map { height: 60vh; }
}
@media (min-width: 1080px) {
  .spot-list { grid-template-columns: repeat(3, 1fr); }
}
