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

:root {
  --bg:        #f5f6f8;
  --surface:   #ffffff;
  --surface2:  #f0f2f5;
  --border:    #e2e5eb;
  --accent:    #3b72f0;
  --accent2:   #7c5cbf;
  --text:      #1a1d26;
  --muted:     #7a8099;
  --radius:    12px;
}

html, body { height: 100%; font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); }

/* ── Year filter bar (below map) ───────────────────────────────────────────── */
.year-filter {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.year-filter::-webkit-scrollbar { display: none; }

.chip-scroll { display: flex; gap: 6px; }


.chip {
  flex-shrink: 0;
  padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: .78rem;
  cursor: pointer; transition: all .15s; font-family: inherit;
  white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Site nav ──────────────────────────────────────────────────────────────── */
#sitenav {
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px;
  height: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.sitenav-logo {
  font-weight: 700; font-size: .95rem; color: var(--accent);
  text-decoration: none; letter-spacing: .03em; flex-shrink: 0;
}
.sitenav-links { display: flex; gap: 4px; }
.sitenav-link {
  padding: 5px 12px; border-radius: 6px;
  font-size: .82rem; font-weight: 500;
  color: var(--muted); text-decoration: none;
  transition: background .12s, color .12s;
}
.sitenav-link:hover  { background: var(--surface2); color: var(--text); }
.sitenav-link.active { background: var(--accent); color: #fff; }

/* ── Map ───────────────────────────────────────────────────────────────────── */
#map {
  height: 55vh;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.map-mode-toggle {
  position: absolute; top: 12px; left: 12px; z-index: 10;
  display: flex; border-radius: 8px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  border: 1px solid var(--border);
}
.mmt-btn {
  padding: 6px 14px; font-size: .78rem; font-weight: 600;
  font-family: inherit; cursor: pointer; border: none;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  color: var(--muted); transition: all .15s;
}
.mmt-btn:first-child { border-right: 1px solid var(--border); }
.mmt-btn.active { background: var(--accent); color: #fff; }
.mmt-btn:not(.active):hover { background: var(--surface2); color: var(--text); }

/* ── Year stats bar ────────────────────────────────────────────────────────── */
.year-stats {
  display: flex; flex-direction: column;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.ys-row {
  display: flex; align-items: stretch;
}
.ys-divider {
  height: 1px; background: var(--border); margin: 0;
}
.ys-item {
  flex: 1; min-width: 80px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 14px 10px; gap: 4px;
  border-right: 1px solid var(--border);
}
.ys-item:last-child { border-right: none; }
.ys-val {
  font-size: 1.5rem; font-weight: 700; line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ys-label {
  font-size: .68rem; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap; text-align: center;
}
.ys-sep { display: none; }

/* ── Main content ──────────────────────────────────────────────────────────── */
main {
  max-width: 1400px; margin: 0 auto; padding: 32px 20px 80px;
}

/* ── Global search ─────────────────────────────────────────────────────────── */
.global-search-wrap {
  position: relative; margin-bottom: 28px;
}
.global-search {
  font-size: .95rem; padding: 10px 16px;
  border-radius: 10px; margin-bottom: 0;
}
.global-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 500;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.1);
  max-height: 360px; overflow-y: auto;
}
.gr-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--border);
}
.gr-row:last-child { border-bottom: none; }
.gr-name {
  flex: 1; min-width: 0; font-size: .85rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text); text-decoration: none;
}
a.gr-name:hover { color: var(--accent); text-decoration: underline; }
.gr-loc  { font-size: .75rem; color: var(--muted); flex-shrink: 0; white-space: nowrap; }
.gr-count { font-size: .75rem; color: var(--muted); flex-shrink: 0; width: 28px; text-align: right; }
.gr-empty { padding: 16px; text-align: center; font-size: .85rem; color: var(--muted); }

.breadcrumb {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 28px;
  font-size: .875rem; color: var(--muted);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.breadcrumb button {
  margin-left: auto; background: transparent; border: 1px solid var(--border);
  color: var(--muted); border-radius: 6px; padding: 4px 10px;
  cursor: pointer; font-size: .8rem; font-family: inherit;
}
.breadcrumb button:hover { border-color: var(--accent); color: var(--accent); }

section { margin-bottom: 40px; }
section h2 {
  font-size: .8rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 16px;
}

/* ── Country timeline ──────────────────────────────────────────────────────── */
.country-timeline {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  display: flex; flex-wrap: wrap; gap: 8px 24px;
}
.tl-row {
  display: flex; align-items: center; gap: 10px;
}
.tl-year {
  font-size: .82rem; font-weight: 600; color: var(--muted);
  width: 36px; flex-shrink: 0;
}
.tl-months { display: flex; gap: 4px; flex-wrap: wrap; }
.tl-month {
  font-size: .72rem; font-weight: 500;
  padding: 2px 7px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(59,114,240,.12), rgba(124,92,191,.12));
  color: var(--accent); border: 1px solid rgba(59,114,240,.2);
  white-space: nowrap;
}

/* ── Two-column layout ─────────────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 40px;
  align-items: start;
}
.two-col section:last-child {
  grid-column: 1 / -1;
}

/* ── Search input ──────────────────────────────────────────────────────────── */
.search-input {
  width: 100%; padding: 8px 12px; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font-size: .85rem; font-family: inherit;
  outline: none; transition: border-color .15s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--muted); }

/* ── Countries list ────────────────────────────────────────────────────────── */
.countries-list {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; max-height: 420px; overflow-y: auto;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.countries-list::-webkit-scrollbar { width: 4px; }
.countries-list::-webkit-scrollbar-track { background: transparent; }
.countries-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.country-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.country-row:last-child { border-bottom: none; }
.country-row:hover { background: var(--surface2); }
.country-row.active { background: rgba(59,114,240,.07); }

.cr-flag  { font-size: 1.2rem; flex-shrink: 0; line-height: 1; }
.cr-name  { font-size: .85rem; font-weight: 500; flex: 1; min-width: 0;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-bar-wrap { width: 60px; height: 4px; background: var(--surface2);
               border-radius: 2px; flex-shrink: 0; overflow: hidden; }
.cr-bar   { height: 100%; border-radius: 2px;
            background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.cr-count { font-size: .75rem; color: var(--muted); flex-shrink: 0; width: 32px; text-align: right; }

/* ── Cities list ───────────────────────────────────────────────────────────── */
.cities-list {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; max-height: 420px; overflow-y: auto;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.cities-list::-webkit-scrollbar { width: 4px; }
.cities-list::-webkit-scrollbar-track { background: transparent; }
.cities-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.city-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.city-row:last-child { border-bottom: none; }
.city-row:hover { background: var(--surface2); }
.city-row.active { background: rgba(124,92,191,.07); }

.cir-flag  { font-size: 1rem; flex-shrink: 0; }
.cir-info  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cir-name  { font-size: .85rem; font-weight: 500;
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cir-dates { font-size: .72rem; color: var(--muted); }
.cir-count { font-size: .75rem; color: var(--muted); flex-shrink: 0; width: 28px; text-align: right; }

/* ── Venues list ───────────────────────────────────────────────────────────── */
.venues-list {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; max-height: 420px; overflow-y: auto;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.venues-list::-webkit-scrollbar { width: 4px; }
.venues-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.venue-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--border);
}
.venue-row:last-child { border-bottom: none; }

a.vr-name, span.vr-name {
  flex: 1; min-width: 0; font-size: .85rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text); text-decoration: none;
}
a.vr-name:hover { color: var(--accent); text-decoration: underline; }
.vr-dates { font-size: .72rem; color: var(--muted); flex-shrink: 0; white-space: nowrap; }
.vr-count { font-size: .75rem; color: var(--muted); flex-shrink: 0; width: 28px; text-align: right; }
.vr-cat {
  font-size: .65rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; flex-shrink: 0;
  background: var(--surface2); color: var(--muted);
}
.vr-cat-food    { background: #fef3c7; color: #92400e; }
.vr-cat-bar     { background: #ede9fe; color: #5b21b6; }
.vr-cat-hotel   { background: #dbeafe; color: #1e40af; }
.vr-cat-airport { background: #d1fae5; color: #065f46; }
.vr-cat-transport { background: #e0f2fe; color: #0c4a6e; }
.vr-cat-shopping  { background: #fce7f3; color: #9d174d; }
.vr-cat-culture   { background: #fff7ed; color: #9a3412; }
.vr-cat-nature    { background: #dcfce7; color: #14532d; }
.vr-cat-sport     { background: #fef9c3; color: #713f12; }

/* ── Year bars ─────────────────────────────────────────────────────────────── */
.year-bars { display: flex; flex-direction: column; gap: 8px; }
.year-row {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.year-label {
  width: 40px; font-size: .82rem; color: var(--muted); font-weight: 500; flex-shrink: 0;
}
.year-bar-wrap {
  flex: 1; height: 28px; background: var(--surface2);
  border-radius: 6px; overflow: hidden; border: 1px solid var(--border);
  transition: border-color .15s;
}
.year-row:hover .year-bar-wrap { border-color: var(--accent); }
.year-row.active .year-bar-wrap { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.year-bar {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .4s ease;
}
.year-count {
  width: 36px; text-align: right; font-size: .8rem; color: var(--muted); flex-shrink: 0;
}

/* ── Point popup ───────────────────────────────────────────────────────────── */
.point-popup {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  max-width: 340px; width: calc(100% - 40px);
  z-index: 2000; box-shadow: 0 8px 32px rgba(0,0,0,.12);
  transition: opacity .2s;
}
.pp-venue { font-weight: 600; font-size: .95rem; color: var(--text); }
.pp-meta  { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.pp-shout { font-size: .82rem; color: var(--accent); margin-top: 6px; font-style: italic; }

/* ── World Countries Checklist ─────────────────────────────────────────────── */
#sectionWorldChecklist {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}

.world-checklist {
  display: flex; flex-direction: column; gap: 28px;
}

.wc-region {}
.wc-region-title {
  font-size: .7rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: 10px;
}
.wc-countries {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.wc-country {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px;
  font-size: .78rem; font-weight: 500;
  white-space: nowrap; transition: opacity .15s;
  cursor: default; user-select: none;
}
.wc-country.visited {
  background: #1e3a8a; color: #fff;
}
.wc-country.not-visited {
  background: #dbeafe; color: #1e40af;
}

/* ── Utilities ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Mobile ────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #map { height: 42vh; }
  main { padding: 20px 12px 60px; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .two-col section:last-child { grid-column: 1; }
  .countries-list, .cities-list { max-height: 300px; }
}
