/* mapview.css — Map view tab styling.
 *
 * Owner: Compass (pin 5142) — CRM P2 sprint, task C1, sub-feature 2.
 */
#mapMount {
  position: relative;
  width: 100%;
  height: calc(100vh - 200px);
  min-height: 480px;
  background: #0d1117;
  overflow: hidden;
}

#mapCanvas {
  width: 100%;
  height: 100%;
  background: #0a0d12;
  /* Leaflet adds its own positioning; ensure the container is positioned */
  position: relative;
}

/* Loading & empty states */
.map-loading,
.map-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7480;
  font-size: 13px;
  text-align: center;
  pointer-events: none;
  z-index: 5;
}
.map-empty { padding: 24px; }

/* Toolbar */
.map-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 600;
  background: rgba(17, 21, 28, 0.94);
  border: 1px solid #1f2630;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: #c8d0d8;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.map-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.map-toolbar input[type="checkbox"] { cursor: pointer; }
.map-toolbar select {
  background: #0d1117;
  color: #e6edf3;
  border: 1px solid #1f2630;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11px;
}
.map-toolbar .map-stat {
  color: #6b7480;
  font-size: 10px;
  padding-left: 6px;
  border-left: 1px solid #1f2630;
}

/* Custom marker icons */
.map-marker-contact {
  background: #58a6ff;
  border: 2px solid #0d1117;
  width: 14px !important;
  height: 14px !important;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #58a6ff80;
}
.map-marker-job {
  background: #3fb950;
  border: 2px solid #0d1117;
  width: 14px !important;
  height: 14px !important;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #3fb95080;
}
.map-marker-job-today {
  background: #f0883e;
  border: 2px solid #0d1117;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #f0883e80;
}

/* Leaflet cluster appearance (Leaflet.markercluster default theme is light;
 * we ship a dark-friendly fallback for un-clustered fallback case.)
 */
.leaflet-marker-icon.map-cluster {
  background: #1f2630;
  color: #e6edf3;
  border: 2px solid #58a6ff;
  border-radius: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
}

/* Contact card overlay — reuses styling cues from main app */
.map-popup .leaflet-popup-content-wrapper,
.map-popup .leaflet-popup-tip {
  background: #11151c;
  color: #e6edf3;
  border: 1px solid #1f2630;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}
.map-popup .leaflet-popup-content {
  margin: 12px 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 12px;
  min-width: 220px;
}
.map-popup .leaflet-popup-content h4 {
  margin: 0 0 4px;
  color: #e6edf3;
  font-size: 14px;
}
.map-popup .leaflet-popup-content .sub {
  color: #6b7480;
  font-size: 11px;
  margin-bottom: 8px;
}
.map-popup .leaflet-popup-content .row {
  color: #c8d0d8;
  font-size: 12px;
  padding: 2px 0;
}
.map-popup .leaflet-popup-content .row b {
  color: #6b7480;
  font-weight: 500;
  display: inline-block;
  width: 60px;
}
.map-popup .leaflet-popup-content .actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
}
.map-popup .leaflet-popup-content .actions button {
  background: #1f2630;
  color: #e6edf3;
  border: 1px solid #2a3340;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
}
.map-popup .leaflet-popup-content .actions button:hover {
  background: #2a3340;
}
.map-popup .leaflet-popup-close-button {
  color: #6b7480;
}
