/* ==========================================================================
   ps-cities-map.css
   Styles for the embedded Mapbox city map in the dashboard.
   ========================================================================== */

/* --- Map Card & Container --- */
/* --- Map Card & Container --- */
.map-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.map-card h2 {
  margin: 0;
  padding: 14px 20px 4px;
  font-size: 1.2rem;
  color: #444;
}

.map-card .map-description {
  margin: 0;
  padding: 0 20px 12px;
  font-size: 0.82rem;
  color: #666;
}

.map-card .map-description a {
  color: #548177;
  font-weight: 600;
  text-decoration: none;
}

.map-card .map-description a:hover {
  text-decoration: underline;
  color: #78B9AB;
}

#cities-map {
  width: 100%;
  height: 500px;
}

/* --- Map Controls Overlay --- */
.map-controls {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.map-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: white;
  padding: 6px 12px;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
  font-size: 13px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  user-select: none;
}

.map-control-group input[type="checkbox"] {
  cursor: pointer;
  accent-color: #78B9AB;
  width: 14px;
  height: 14px;
}

/* --- Map Loading State --- */
.map-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  padding: 12px 20px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
  color: #555;
}

/* --- Popup Styles --- */

/* Override Mapbox popup defaults */
.mapboxgl-popup-content {
  padding: 0 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
  overflow: hidden;
}

.ps-map-popup {
  padding: 14px 16px;
  border-left: 4px solid #78B9AB;
  font-size: 13px;
  line-height: 1.5;
}

.ps-map-popup-title {
  font-weight: 700;
  font-size: 1.05em;
  color: #333;
  margin-bottom: 2px;
}

.ps-map-popup-meta {
  color: #666;
  font-size: 0.88em;
  margin-bottom: 10px;
}

.ps-map-popup-stats {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

.ps-map-popup-stats td {
  padding: 2px 0;
  border: none;
}

.ps-map-popup-stats td:first-child {
  color: #777;
  padding-right: 12px;
  white-space: nowrap;
}

.ps-map-popup-stats td:last-child {
  font-weight: 600;
  color: #333;
  text-align: right;
}

.ps-map-popup-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.ps-map-popup-links a {
  color: #548177;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92em;
}

.ps-map-popup-links a:hover {
  text-decoration: underline;
  color: #78B9AB;
}