/* ===== RESET & BASE ===== */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
}

/* ===== LAYOUT ===== */
#app-container {
  display: flex;
  height: calc(100vh - 52px);
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
#sidebar {
  width: 380px;
  min-width: 380px;
  display: flex;
  flex-direction: column;
  background: #f8f9fa;
  border-right: 1px solid #dee2e6;
  overflow: hidden;
}

#sidebar .nav-tabs {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 2px solid #dee2e6;
}

#sidebar .nav-tabs .nav-link {
  font-size: 0.8rem;
  padding: 0.5rem 0.25rem;
  color: #6c757d;
}

#sidebar .nav-tabs .nav-link.active {
  color: #0d6efd;
  font-weight: 600;
}

#sidebar-tab-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* ===== CHART PANEL ===== */
#chart-panel {
  height: 200px;
  min-height: 200px;
  border-top: 2px solid #dee2e6;
  background: #fff;
  display: flex;
  flex-direction: column;
  padding-bottom: 4px;
}

#chart-panel canvas {
  flex: 1;
  min-height: 0;
  padding: 2px 6px 4px;
}

/* ===== MAP ===== */
#map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
}

/* ===== MAP CONTROLS (floating) ===== */
#map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#map-controls .btn {
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  background: #fff;
  border-color: #ccc;
  font-size: 0.78rem;
  padding: 4px 8px;
  white-space: nowrap;
}

#map-controls .btn.active,
#map-controls .btn:active {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

/* ===== DRAWING MODE INDICATOR ===== */
#drawing-mode-indicator {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: all;
}

/* ===== COORDINATES BAR ===== */
#coordinates-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  background: rgba(255,255,255,0.85);
  padding: 3px 10px;
  font-size: 0.75rem;
  color: #555;
  border-top: 1px solid #ddd;
  pointer-events: none;
}

/* ===== WELL LIST ===== */
.well-card {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #fff;
  font-size: 0.82rem;
  transition: border-color 0.15s;
}

.well-card:hover {
  border-color: #86b7fe;
}

.well-card.selected {
  border-color: #0d6efd;
  background: #f0f6ff;
}

.well-card .badge-existing {
  background-color: #0d6efd;
  color: #fff;
}

.well-card .badge-proposed {
  background-color: #fd7e14;
  color: #fff;
}

.well-card .drawdown-val {
  font-weight: 600;
  color: #0d6efd;
}

.well-card .drawdown-val.high {
  color: #dc3545;
}

/* ===== AREA LIST ===== */
.area-card {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #fff;
  font-size: 0.82rem;
}

.area-card .area-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

/* ===== LAYER LIST ===== */
.layer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-bottom: 4px;
  background: #fafafa;
  font-size: 0.8rem;
}

.layer-row:hover {
  background: #f0f4ff;
}

.layer-drag-handle {
  cursor: grab;
  color: #aaa;
  font-size: 1rem;
}

.layer-drag-handle:active {
  cursor: grabbing;
}

.layer-row.drag-over {
  border-color: #0d6efd;
  background: #e8f0fe;
}

.layer-type-badge {
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 10px;
}

.layer-type-unconfined {
  background: #e3f2fd;
  color: #1565c0;
}

.layer-type-confined {
  background: #fce4ec;
  color: #880e4f;
}

/* ===== ANALYSIS POINTS ===== */
.analysis-point-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.8rem;
}

/* ===== SCENARIO GUIDANCE ===== */
#scenario-guidance-content details summary {
  user-select: none;
  list-style: none;
  font-size: 0.78rem;
}
#scenario-guidance-content details summary::-webkit-details-marker { display: none; }
#scenario-guidance-content details[open] summary { color: #0d6efd; }

/* ===== NAVBAR ===== */
.navbar-brand {
  font-size: 0.95rem !important;
}

/* ===== MODALS ===== */
.modal-header {
  padding: 0.75rem 1rem;
}

.modal-body {
  padding: 1rem;
}

.modal-footer {
  padding: 0.5rem 1rem;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* ===== MAP CURSOR STATES ===== */
#map.mode-add-well {
  cursor: crosshair !important;
}

#map.mode-add-point {
  cursor: cell !important;
}

#map.mode-add-septic {
  cursor: crosshair !important;
}

/* ===== HEATMAP LEGEND ===== */
#heatmap-legend {
  position: absolute;
  bottom: 36px;
  right: 10px;
  z-index: 5;
  background: rgba(255,255,255,0.9);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.72rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  pointer-events: none;
}

#heatmap-legend .gradient-bar {
  width: 100px;
  height: 10px;
  background: linear-gradient(to right, rgba(0,0,255,0.1), rgba(0,0,255,0.5), rgba(255,165,0,0.7), rgba(255,0,0,0.85));
  border-radius: 3px;
  margin-bottom: 2px;
}

/* ===== UTILITY ===== */
.text-xs {
  font-size: 0.72rem;
}

.btn-xs {
  padding: 0.1rem 0.35rem;
  font-size: 0.72rem;
}

.form-label {
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.input-group-text {
  font-size: 0.8rem;
}

.form-control-sm, .form-select-sm {
  font-size: 0.8rem;
}

/* Layer T preview */
#layer-T-preview {
  color: #0d6efd;
}

/* Tab pane spacing */
.tab-pane {
  min-height: 100px;
}

/* Well summary bar */
#well-summary {
  padding: 6px 8px;
  font-size: 0.78rem;
  background: #fff;
  flex-shrink: 0;
}

/* Ensure map Google controls don't overlap our buttons */
.gm-bundled-control {
  right: 115px !important;
}
