/* ============================================================
   Etosha Grid Risk Assessment — Styles
   ============================================================ */

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
}

/* ---------- Header ---------- */
#app-header {
  background: #16213e;
  padding: 14px 24px;
  border-bottom: 2px solid #0f3460;
}
#app-header h1 {
  font-size: 1.25rem;
  color: #e0e0e0;
  font-weight: 600;
}
.subtitle {
  font-size: 0.82rem;
  color: #8899aa;
  margin-top: 2px;
}

/* ---------- App layout ---------- */
#app {
  display: flex;
  height: calc(100vh - 62px);
}

/* ---------- Sidebar ---------- */
#sidebar {
  width: 290px;
  min-width: 260px;
  background: #16213e;
  border-right: 2px solid #0f3460;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel {
  background: #1a1a2e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  padding: 12px;
}
.panel h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8899aa;
  margin-bottom: 10px;
}
.panel h3 {
  font-size: 0.78rem;
  color: #8899aa;
}

/* ---------- Sliders ---------- */
label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.82rem;
}
.label-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.slider-val {
  font-weight: 700;
  color: #4fc3f7;
  min-width: 28px;
  text-align: right;
}
input[type="range"] {
  width: 100%;
  accent-color: #4fc3f7;
  cursor: pointer;
}

/* ---------- Toggles ---------- */
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 0.82rem;
}
.toggle input { cursor: pointer; accent-color: #4fc3f7; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #e0e0e0;
  background: #0f3460;
  border: 1px solid #4fc3f7;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 6px;
}
.btn:hover { background: #1a5276; }
.btn-small { padding: 5px 10px; font-size: 0.72rem; }

/* ---------- Detail table ---------- */
#detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
#detail-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #0f3460;
}
#detail-table td:first-child {
  color: #8899aa;
  width: 55%;
}
#detail-table td:last-child {
  font-weight: 600;
  text-align: right;
}
.composite-row td {
  color: #ffcc00 !important;
  font-size: 0.88rem;
}
.hint {
  font-size: 0.75rem;
  color: #667788;
  font-style: italic;
}
kbd {
  background: #0f3460;
  border: 1px solid #4fc3f7;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.72rem;
  font-family: inherit;
}

/* ---------- Legend ---------- */
#legend-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend-label {
  font-size: 0.72rem;
  white-space: nowrap;
}
#legend-gradient {
  flex: 1;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(to right, hsl(120, 85%, 50%), hsl(60, 85%, 50%), hsl(0, 85%, 50%));
}

/* ---------- Map container ---------- */
#map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
#map-image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
#canvas-heatmap,
#canvas-overlay,
#canvas-interaction {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  pointer-events: none;
}
/* Only the top canvas receives mouse events */
#canvas-interaction {
  pointer-events: auto;
  cursor: crosshair;
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
