
/* =========================
   Mind the Gap — Dark UI
   ========================= */

:root{
  --glass: rgba(0,0,0,0.12);
  --glass-strong: rgba(0,0,0,0.22);
  --ink: rgba(255,255,255,0.92);
  --ink-dim: rgba(255,255,255,0.72);
  --blood: rgba(215, 35, 35, 0.55);
  --flag-blue: rgba(0, 57, 166, 0.75);
  --line: rgba(255,255,255,0.10);
  --shadow: 0 10px 30px rgba(0,0,0,0.55);
}

/* Modern “dossier” vibe: system mono-ish stack */
body{
  margin:0;
  height:100vh;
  overflow:hidden;
  color:var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background:#000;
}

#mapWrap{ position:relative; width:100%; height:100vh; }
#map{ width:100%; height:100%; z-index:1; }

/* Mobile header */
#mobileHeader{
  position:fixed;
  top:0; left:0; right:0;
  height:48px;
  display:none;
  align-items:center;
  justify-content:space-between;
  padding:0 10px;
  z-index:3500; /* above popups */
  background:rgba(0,0,0,0.72);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.mh-left{ display:flex; align-items:center; gap:10px; min-width:0; }
.mh-title{
  font-size:15px;
  letter-spacing:0.5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:65vw;
}

/* Floating title (desktop) */
#titleBlock{
  position:absolute;
  top:18px; left:18px;
  z-index:3200; /* above points, below popups */
  pointer-events:auto;
  user-select:none;
  text-shadow: 0 3px 10px rgba(0,0,0,0.85);
}
#titleMain{
  font-size:28px;
  letter-spacing:1px;
  line-height:1.05;
}
#titleSub{
  margin-top:6px;
  font-size:13px;
  color:var(--ink-dim);
  max-width:360px;
}

/* Filters panel (desktop) */
#filtersPanel{
  position:absolute;
  left:18px;
  bottom:18px;
  width:320px;
  z-index:4000; /* below modal */
  background:var(--glass);
  backdrop-filter: blur(10px);
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow: var(--shadow);
  overflow:hidden;

  /* minimized state shows only header */
  transform: translateY(calc(100% - 44px));
  transition: transform 260ms ease;
}
#filtersPanel.open{
  transform: translateY(0);
}

#filtersHeader{
  height:44px;
  padding:0 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  cursor:pointer;
  border-bottom:1px solid var(--line);
  background:rgba(0,0,0,0.18);
}
#filtersHeader span{ font-size:14px; letter-spacing:0.8px; }
#filtersMinIcon{ font-size:18px; color:var(--ink-dim); }

#filtersBody{
  padding:12px;
  max-height:56vh;
  overflow:auto;
}

.f-row{ margin-bottom:10px; }
label{
  display:block;
  font-size:12px;
  color:var(--ink-dim);
  margin-bottom:6px;
}
input, select{
  width:100%;
  border-radius:10px;
  border:1px solid var(--line);
  background:rgba(0,0,0,0.40);
  color:var(--ink);
  padding:10px 10px;
  outline:none;
}
select{ padding:8px 10px; }
input:focus, select:focus{
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}
.hint{ font-size:11px; color:var(--ink-dim); margin-top:6px; opacity:0.85; }

.f-actions{
  display:flex;
  gap:8px;
  margin-top:10px;
}
.btn{
  flex:1;
  padding:10px 10px;
  border-radius:10px;
  border:1px solid var(--line);
  background:rgba(0,0,0,0.34);
  color:var(--ink);
  cursor:pointer;
}
.btn:hover{ border-color: rgba(255,255,255,0.18); }
.btn-primary{
  background: rgba(0, 57, 166, 0.35);
  border-color: rgba(0, 57, 166, 0.55);
}
.btn-ghost{
  background: rgba(0,0,0,0.18);
}

.empty-state{
  margin-top:10px;
  padding:10px;
  border-radius:10px;
  border:1px dashed rgba(255,255,255,0.18);
  color:var(--ink-dim);
}
.empty-state .quip{ color: rgba(255,255,255,0.85); }

/* Suggest dropdown */
.suggest{
  margin-top:6px;
  border-radius:10px;
  border:1px solid var(--line);
  background:rgba(0,0,0,0.70);
  max-height:160px;
  overflow:auto;
}
.suggest button{
  display:block;
  width:100%;
  text-align:left;
  padding:8px 10px;
  background:transparent;
  border:0;
  color:var(--ink);
  cursor:pointer;
}
.suggest button:hover{
  background: rgba(255,255,255,0.06);
}

/* Mobile filter drawer */
#mobileFilters{
  position:fixed;
  top:48px; left:0; right:0;
  z-index:4000;
  background:rgba(0,0,0,0.86);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
  box-shadow: var(--shadow);
}
.mf-actions{
  display:flex;
  gap:8px;
  padding:10px;
  border-bottom:1px solid var(--line);
}
.mf-body{ padding:10px; max-height:70vh; overflow:auto; }

/* Icon buttons */
.icon-btn{
  border:1px solid var(--line);
  background: rgba(0,0,0,0.30);
  color: var(--ink);
  border-radius:10px;
  padding:7px 10px;
  cursor:pointer;
}
.icon-btn:hover{ border-color: rgba(255,255,255,0.18); }

/* Leaflet popup styling */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip{
  background: rgba(0,0,0,0.12) !important;
}
.leaflet-popup-content-wrapper{
  border-radius:12px !important;
  box-shadow: 6px 10px 20px var(--blood) !important; /* subtle menacing red */
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.10);
}
.leaflet-popup-content{
  margin:12px 14px !important;
  min-width: 260px;
  max-width: 320px;
}
.popup-title{
  font-size:14px;
  letter-spacing:0.8px;
  margin-bottom:8px;
}
.popup-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:8px;
  font-size:12px;
  color:var(--ink);
}
.popup-k{ color:var(--ink-dim); font-size:11px; margin-bottom:2px; }
.popup-v a{ color: rgba(215,35,35,0.85); text-decoration:none; }
.popup-v a:hover{ text-decoration:underline; }

/* DivIcon square markers */
.death-square{
  width:10px;
  height:10px;
  border-radius:2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10);
}

/* Attribution modal */
#modalBackdrop{
  position:fixed;
  inset:0;
  z-index:5000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
}
#attribModal{
  position:fixed;
  z-index:5100;
  top:60px;
  left:50%;
  transform:translateX(-50%);
  width:min(560px, calc(100vw - 24px));
  max-height:calc(100vh - 100px);
  overflow:auto;
  background: rgba(0,0,0,0.82);
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow: var(--shadow);
}
.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 12px;
  border-bottom:1px solid var(--line);
}
.modal-title{ letter-spacing:0.8px; }
.modal-body{ padding:12px; color:var(--ink-dim); font-size:13px; }
.modal-body strong{ color:var(--ink); }
.wm-link{ color: rgba(215,35,35,0.90); }
.fineprint{ font-size:12px; opacity:0.85; }

/* Responsive rules */
@media (max-width: 640px){
  #mobileHeader{ display:flex; }
  #titleBlock{ display:none; }
  #filtersPanel{ display:none; }
  #mapWrap{ height:100vh; }
  #map{ height:100vh; }
}
