/* ===========================================================
   Lixsady Geodata — stylesheet
   Palette: near-black base, per-layer accent colors (telemetry feel)
   Type: DM Sans (UI) + JetBrains Mono (data/coords)
   =========================================================== */

:root{
  --bg:        #0a0c10;
  --panel:     #11141a;
  --panel-2:   #161a22;
  --line:      #232834;
  --text:      #e7e9ee;
  --text-dim:  #8b93a3;

  --traffic:   #f5a623;
  --news:      #ef4444;
  --events:    #a78bfa;
  --weather:   #38bdf8;
  --crime:     #f43f5e;
  --flights:   #84cc16;
  --marine:    #22d3ee;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
  overflow: hidden;
}

/* ---------- HUD strip (signature element) ---------- */
#hud{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 16px;
  background: rgba(10,12,16,0.92);
  border-bottom: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  backdrop-filter: blur(6px);
}

#hud .brand{
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-right: 4px;
}
#hud .brand span{ color: var(--flights); }

#hud .sep{ color: var(--line); }
#hud .val{ color: var(--text); }

/* ---------- Layout ---------- */
#app{
  position: absolute;
  top: 34px; left: 0; right: 0; bottom: 0;
  display: flex;
}

#map{
  flex: 1;
  height: 100%;
  background: #07080b;
}

/* dark-mode filter on OSM tiles to match the brand */
#map.dark-tiles .leaflet-tile-pane{
  filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.9) saturate(0.8);
}

/* ---------- Side panel ---------- */
#panel{
  width: 280px;
  height: 100%;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  overflow-y: auto;
}

#panel h1{
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 14px 0;
  font-weight: 700;
}

.locate-btn{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.locate-btn:hover{ border-color: var(--flights); background: #1a1f29; }
.locate-btn:active{ transform: translateY(1px); }

.section-label{
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 6px 0 8px 0;
}

.layer-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  margin-bottom: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease;
}
.layer-row:hover{ border-color: #303747; }
.layer-row.active{ border-color: var(--row-color, var(--flights)); }

.layer-name{
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}
.dot{
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--row-color, var(--text-dim));
  flex-shrink: 0;
}
.layer-row:not(.active) .dot{ opacity: 0.35; }

.switch{
  width: 30px; height: 16px;
  border-radius: 999px;
  background: #2a313e;
  position: relative;
  flex-shrink: 0;
  transition: background .15s ease;
}
.layer-row.active .switch{ background: var(--row-color, var(--flights)); }
.switch::after{
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: left .15s ease;
}
.layer-row.active .switch::after{ left: 16px; }

.key-needed{
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ---------- Status / info readout ---------- */
#status{
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.6;
}
#status .line{ display: flex; justify-content: space-between; gap: 8px; }
#status .line b{ color: var(--text); font-weight: 500; }

/* ---------- Leaflet overrides ---------- */
.leaflet-popup-content-wrapper{
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
}
.leaflet-popup-tip{ background: var(--panel-2); }
.leaflet-popup-content{ margin: 10px 12px; }
.leaflet-popup-content b{ display:block; margin-bottom:4px; font-size: 12px; }
.leaflet-bar a{
  background: var(--panel-2);
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.leaflet-bar a:hover{ background: #1a1f29; }
.leaflet-control-attribution{
  background: rgba(10,12,16,0.8) !important;
  color: var(--text-dim) !important;
}
.leaflet-control-attribution a{ color: var(--text-dim) !important; }

/* simple colored marker pin via divIcon */
.geo-pin{
  width: 12px; height: 12px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #0a0c10;
}

/* scrollbar */
#panel::-webkit-scrollbar{ width: 6px; }
#panel::-webkit-scrollbar-thumb{ background: var(--line); border-radius: 3px; }

@media (max-width: 720px){
  #panel{ width: 220px; }
  #hud{ font-size: 10px; gap: 12px; }
}
