/* ===========================================
   MetarMap v0.5 • Air-Plan Project
   Global + Map Styling
=========================================== */

:root {
  --bg: #f4f4f4;
  --fg: #222;
  --muted: #555;
  --panel: #ffffff;
  --border: #ccc;
  --accent: #3498db;
  --vfr: #28a745;
  --mvfr: #0080f0;
  --ifr: #dc3545;
  --lifr: #9722ce;
}

body.theme-dark {
  --bg: #0f172a;
  --fg: #f1f5f9;
  --muted: #94a3b8;
  --panel: #1e293b;
  --border: #334155;
  --accent: #38bdf8;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
}

#map {
  height: 100%;
  width: 100%;
}

/* --- ICAO pill markers --- */
.metar-pill .pill {
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid rgba(0,0,0,0.25);

  padding: 2px 6px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  box-shadow: 0 0 3px rgba(0,0,0,0.4);
  white-space: nowrap;
  transition: background-color 200ms eaase;
}

/* Striped style for stale/no-METAR stations */
.metar-pill.stale .pill {
  background: repeating-linear-gradient(
    45deg,
    #ccc,
    #ccc 6px,
    #eee 6px,
    #eee 12px
  );
  color: #444;
  border: 2px solid #999;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}


/* --- Theme toggle --- */
.theme-toggle {
  position: absolute;
  top: 8px;
  right: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
  z-index: 10000;
  transition: background 0.2s;
}
.theme-toggle:hover {
  background: var(--accent);
  color: #fff;
}

/* --- Spinner --- */
.map-spinner {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.loader {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Footer --- */
.map-footer {
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.7;
  z-index: 10000;
}
.map-footer:hover {
  opacity: 1;
}

/* --- Debug overlay --- */
.debug-toggle {
  position: absolute;
  top: 8px;
  left: 10px;
  background: rgba(0,0,0,0.25);
  color: #fff;
  border-radius: 4px;
  padding: 4px 6px;
  cursor: pointer;
  z-index: 12000;
}
body.theme-dark .debug-toggle {
  background: rgba(255,255,255,0.15);
}
.debug-panel {
  position: absolute;
  top: 38px;
  left: 10px;
  background: rgba(20,20,20,0.85);
  color: #0ff;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 12px;
  z-index: 12000;
  display: none;
}
.debug-panel.visible {
  display: block;
}

.map-status {
  position: fixed;
  bottom: 15px;
  left: 15px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 9999;
}
.theme-dark .map-status {
  background: rgba(255, 255, 255, 0.15);
}
.map-status.visible {
  opacity: 1;
}
