.sidebar-panel {
  width: 320px;
  height: 100%;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 5;
  background: var(--surface-color);
  overflow-y: auto;
  position: relative;
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.02);
}

.sidebar-header {
  padding: 18px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.sidebar-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

/* Tool controls list */
.tool-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-btn {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  font-family: var(--font-sans);
}

.tool-btn:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}

.tool-btn i {
  color: var(--primary);
  font-size: 15px;
}

/* Layer toggles panel */
.layer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.layer-item:hover {
  background: var(--surface-hover);
}

.layer-item label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.layer-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Info Box */
.info-box-container {
  display: flex;
  flex-direction: column;
}

#infoBox {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  min-height: 80px;
  transition: var(--transition-normal);
}

#infoBox.active {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.02);
}

.info-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  margin: 4px 0;
  font-size: 12px;
}

.info-label {
  color: var(--text-secondary);
}

.info-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* Legend Styling */
.legend-panel {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
}

.legend-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  list-style: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Specific mineral dot colors */
.color-copper { background: var(--color-copper); }
.color-gold { background: var(--color-gold); }
.color-chromite { background: var(--color-chromite); }
.color-emerald { background: var(--color-emerald); }
.color-coal { background: var(--color-coal); }
.color-marble { background: var(--color-marble); border: 1px solid #94a3b8; }
.color-default { background: var(--color-default); }

/* Horizontal separator */
hr.panel-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 8px 0;
}

/* Dynamic Mineral Indicators & Markers */
.mineral-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.mineral-map-marker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
  transition: transform 0.15s ease-in-out;
}

.mineral-map-marker:hover {
  transform: scale(1.2);
  z-index: 999 !important;
}

.mineral-layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Override Leaflet default marker icon background */
.custom-mineral-marker {
  background: transparent !important;
  border: none !important;
}

/* Cluster bubble */
.mineral-cluster-icon {
  background: transparent !important;
  border: none !important;
}

/* Popup styling */
.leaflet-popup-content-wrapper {
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18) !important;
  padding: 0 !important;
}
.leaflet-popup-content {
  margin: 14px 16px !important;
}