/* ============================================================
   Citation GeoMap — dashboard styles
   Re-skinned onto the site's CORE design system (core.css).
   All colours derive from the shared tokens (--teal, --bg*, …)
   so the dashboard follows the same dark/light theme + palette
   as the rest of Dr. B. Sudheer Kumar's portfolio.
   ============================================================ */

/* Map the dashboard's legacy --gm-* names onto the core tokens,
   so existing rules keep working but now theme-react automatically. */
:root {
  --gm-bg:      var(--bg0);
  --gm-panel:   var(--bg2);
  --gm-border:  var(--border);
  --gm-accent:  var(--teal);
  --gm-text:    var(--text);
  --gm-muted:   var(--muted);
}

body {
  font-family: var(--ff-body);
  background: var(--bg0);
  color: var(--text);
}

/* Buttons re-skinned to brand teal */
.btn-success { background: var(--teal); border-color: var(--teal); color: #06080F; font-weight: 600; }
.btn-success:hover { background: var(--teal-dark); border-color: var(--teal-dark); color:#fff; }
.btn-outline-light { color: var(--text); border-color: var(--border); }
.btn-outline-light:hover { background: var(--surface2); color: var(--text); border-color: var(--border2); }
.btn-outline-info { color: var(--teal); border-color: var(--border2); }
.btn-outline-info:hover { background: var(--teal); border-color: var(--teal); color:#06080F; }
.btn-outline-primary { color: var(--teal); border-color: var(--border2); }
.btn-outline-primary:hover { background: var(--teal); border-color: var(--teal); color:#06080F; }
.btn-outline-secondary { color: var(--muted); border-color: var(--border); }
.btn-outline-secondary:hover { background: var(--surface2); color: var(--text); border-color: var(--border2); }

/* ── Panels / cards ── */
.panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 24px -14px rgba(0,0,0,.55);
}
.card-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: .9rem;
  font-family: var(--ff-display);
}
.text-muted, .small.text-muted { color: var(--muted) !important; }

/* status bar / alerts */
#status-bar, .alert-secondary {
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.badge.text-bg-dark { background: var(--bg3) !important; color: var(--text) !important; }
.badge.text-bg-success { background: var(--teal) !important; color: #06080F !important; }
.badge.text-bg-secondary { background: var(--surface2) !important; color: var(--muted) !important; }

/* ── KPI cards ── */
.kpi-card {
  border: 1px solid var(--border);
  background: var(--bg2);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s;
}
.kpi-card:hover { transform: translateY(-3px); border-color: var(--border2); }
.kpi-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--teal);
}
.kpi-label {
  font-family: var(--ff-mono);
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-size: .72rem; margin: 0;
}
.kpi-value {
  font-family: var(--ff-display); font-weight: 700;
  font-size: 1.9rem; margin: 4px 0 0; color: var(--text);
  line-height: 1.1;
}
.kpi-primary::before    { background: var(--teal); }
.kpi-success::before    { background: #50FA7B; }
.kpi-info::before       { background: #8BE9FD; }
.kpi-warning::before    { background: #F1FA8C; }
.kpi-danger::before     { background: #FF6E6E; }
.kpi-secondary::before  { background: var(--violet); }
.kpi-dark::before       { background: #6272A4; }

/* ── Map ── */
#map {
  height: 540px;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  background: var(--bg3);
}
.leaflet-container { background: var(--bg3); }
.leaflet-popup-content-wrapper {
  background: var(--bg1); color: var(--text); border: 1px solid var(--border); border-radius: var(--r);
}
.leaflet-popup-tip { background: var(--bg1); }
.leaflet-tooltip {
  background: var(--bg2); color: var(--text); border: 1px solid var(--border);
  font-family: var(--ff-body); font-size: 12px;
}
/* Permanent marker count labels (toggleable in map settings) */
.leaflet-tooltip.gm-marker-label {
  background: transparent; border: none; box-shadow: none;
  color: var(--text); font-family: var(--ff-mono); font-weight: 600;
  font-size: 11px; text-shadow: 0 1px 3px rgba(0,0,0,.9);
}
.leaflet-tooltip.gm-marker-label::before { display: none; }

/* ── Map settings panel (visibility toggle + colour schemes) ── */
.map-settings {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 12px;
  animation: ms-slide .22s var(--ease);
}
@keyframes ms-slide { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.map-settings[hidden] { display: none; }

.ms-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ms-label {
  font-family: var(--ff-mono); font-size: .7rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
  min-width: 110px;
}
.ms-options { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-opt {
  font-family: var(--ff-body); font-size: .78rem; font-weight: 500;
  padding: 5px 12px; border-radius: 100px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer;
  transition: all .18s var(--ease);
}
.ms-opt:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); }
.ms-opt.active {
  color: var(--teal); border-color: var(--border2);
  background: var(--teal-dim); font-weight: 600;
}
.ms-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .8rem; color: var(--text2); cursor: pointer; user-select: none;
}
.ms-check input { accent-color: var(--teal); width: 15px; height: 15px; }

/* ── Legend ── */
.legend {
  background: var(--surface);
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.lg-dot {
  display: inline-block; border-radius: 50%;
  background: var(--lg-color, var(--teal)); opacity: .85;
  margin: 0 4px;
}
.lg-1 { width: 8px; height: 8px; }
.lg-3 { width: 12px; height: 12px; }
.lg-10 { width: 18px; height: 18px; }
.lg-30 { width: 24px; height: 24px; }

/* ── Tables ── */
table { color: var(--text) !important; }
table thead th {
  background: var(--surface);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .72rem;
  border-bottom: 1px solid var(--border);
}
table tbody td {
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  vertical-align: middle;
}
table tbody tr:hover td { background: var(--surface); }

/* ── Drilldown ── */
#drill-body .item {
  border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px;
}
#drill-body .chip {
  display: inline-block; padding: 2px 8px; margin: 2px 2px 2px 0;
  background: var(--teal-dim); color: var(--teal);
  border-radius: 999px; font-size: .72rem;
}
#drill-body a { color: var(--teal); }

canvas { max-height: 260px; }

/* ── Print ── */
@media print {
  #navbar, #mobile-menu, #footer, .skip-link, .btn, .legend, #btn-run, .card-header .btn-group, button,
  #scroll-progress, #cursor-glow, .map-settings, .theme-toggle { display: none !important; }
  body { background: white; color: black; }
  .panel, .card, .card-body, .kpi-card { background: white !important; color: black !important; border-color: #ccc !important; }
  #map { height: 320px; }
}
