/* ─────────────────────────────────────────────────────────────────────────
   Geocore City Data Visualizer — styles
   ───────────────────────────────────────────────────────────────────────── */

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

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0d1117;
  color: #e6edf3;
}

/* ── Header ── */
#header {
  padding: 10px 16px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  z-index: 1000;
}
#logo {
  height: 28px;
  width: 28px;
  border-radius: 6px;
  flex-shrink: 0;
}
#header h1 {
  font-size: 15px;
  font-weight: 700;
  color: #58a6ff;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* ── Search ── */
#search-wrap {
  flex: 1;
  max-width: 380px;
  position: relative;
}
#search-input {
  width: 100%;
  padding: 6px 14px 6px 34px;
  border-radius: 20px;
  border: 1px solid #30363d;
  background: #0d1117;
  color: #e6edf3;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
#search-input:focus {
  border-color: #58a6ff;
}
#search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #8b949e;
  font-size: 14px;
  pointer-events: none;
}
#search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 20000;
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.sr-item {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #21262d;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.sr-item:last-child {
  border-bottom: none;
}
.sr-item:hover {
  background: #21262d;
}
.sr-city {
  font-weight: 500;
}
.sr-country {
  font-size: 11px;
  color: #8b949e;
  white-space: nowrap;
}

/* ── Load button ── */
#load-btn {
  padding: 6px 14px;
  background: #238636;
  border: 1px solid #2ea043;
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s;
}
#load-btn:hover {
  background: #2ea043;
}
#file-input {
  display: none;
}

#stats {
  font-size: 12px;
  color: #8b949e;
  white-space: nowrap;
  min-width: 120px;
}

/* ── Main layout ── */
#main {
  flex: 1;
  display: flex;
  overflow: hidden;
}
#map {
  flex: 1;
}

/* The ocean behind our own country outlines (no tile service). */
#map.leaflet-container {
  background: #0a1220;
}

/* ── Info panel ── */
#info-panel {
  width: 0;
  overflow: hidden;
  background: #161b22;
  border-left: 1px solid #30363d;
  transition: width 0.2s ease;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
#info-panel.open {
  width: 270px;
}
#info-inner {
  padding: 16px;
  width: 270px;
  overflow-y: auto;
  flex: 1;
}
#info-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
#info-city-name {
  font-size: 16px;
  font-weight: 700;
  color: #58a6ff;
  line-height: 1.3;
}
#info-close {
  cursor: pointer;
  color: #8b949e;
  font-size: 20px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
  margin-left: 8px;
}
#info-close:hover {
  color: #f85149;
}
.info-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}
.info-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #8b949e;
  margin-bottom: 2px;
}
.info-value {
  font-size: 13px;
  color: #e6edf3;
  word-break: break-word;
}
.info-value.big {
  font-size: 14px;
  font-weight: 500;
}
.info-divider {
  height: 1px;
  background: #21262d;
  margin: 10px 0;
}
.capital-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: #1f6feb33;
  color: #58a6ff;
  border: 1px solid #1f6feb66;
}

/* ── Loading overlay ── */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 17, 23, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 30000;
  gap: 14px;
}
#loading-overlay.hidden {
  display: none;
}
#loading-text {
  font-size: 14px;
  color: #e6edf3;
}
#loading-bar-bg {
  width: 280px;
  height: 4px;
  background: #30363d;
  border-radius: 2px;
  overflow: hidden;
}
#loading-bar {
  height: 100%;
  background: #58a6ff;
  border-radius: 2px;
  width: 0%;
  transition: width 0.08s linear;
}

/* ── Welcome hint ── */
#welcome {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 500;
}
#welcome img {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  margin-bottom: 14px;
  box-shadow: 0 0 40px rgba(88, 166, 255, 0.35);
}
#welcome h2 {
  font-size: 22px;
  color: #58a6ff;
  margin-bottom: 8px;
}
#welcome p {
  font-size: 14px;
  color: #8b949e;
}
#welcome.hidden {
  display: none;
}
