:root {
  --bg-primary:    #ffffff;
  --bg-secondary:  #f9fafb;
  --bg-muted:      #f3f4f6;
  --text-title:    #111827;
  --text-body:     #4b5563;
  --text-muted:    #9ca3af;
  --border:        #e5e7eb;
  --accent:        #2563eb;
  --accent-light:  #eff6ff;
  --status-green:  #10b981;
  --status-yellow: #f59e0b;
  --status-red:    #ef4444;
  --status-gray:   #9ca3af;
  --radius-card:   8px;
  --radius-sm:     6px;
  --shadow-card:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-float:  0 4px 12px rgba(0,0,0,0.12);
  --shadow-panel:  -4px 0 24px rgba(0,0,0,0.10);
  --sidebar-w:     300px;
  --panel-w:       380px;
  --font:          'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ── Map container ── */
#map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
}

/* ── Floating base map switcher ── */
#basemap-switcher {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 15;
  display: flex;
  gap: 4px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-float);
  padding: 4px;
}

.bm-btn {
  padding: 6px 12px;
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  color: var(--text-body);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.bm-btn:hover {
  background: var(--bg-muted);
}

.bm-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ── Floating sync bar ── */
#sync-bar {
  position: absolute;
  bottom: 28px;
  left: calc(var(--sidebar-w) + 12px);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-float);
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text-body);
}

#sync-bar svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

#last-updated {
  color: var(--text-muted);
}

#refresh-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

#refresh-btn:hover {
  background: #dbeafe;
}

/* ── Station markers ── */
.station-marker {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 3px solid rgba(255,255,255,0.8);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  /* KHÔNG transition transform — MapLibre set transform trực tiếp lên element này để định vị */
  transition: box-shadow 0.15s, border-width 0.15s;
  user-select: none;
}

.station-marker:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  border-width: 4px;
}

.station-marker.active {
  box-shadow: 0 4px 20px rgba(0,0,0,0.40);
  border-color: #fff;
  border-width: 4px;
}

.marker-value {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.marker-label {
  font-size: 10px;
  color: rgba(255,255,255,0.85);
  line-height: 1;
}

/* ── Scrollbar style ── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
