/* ── National Opportunity Map ──────────────────────────────────────────────── */

.map-container {
  position: relative;
  width: 100%;
}

#investpng-map {
  width: 100%;
  height: 600px;
  background: #d0e4f0;
}

/* ── Loading overlay ──────────────────────────────────────────────────────── */

.map-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(208, 228, 240, 0.85);
  font-size: 14px;
  color: #344146;
  z-index: 10;
  pointer-events: none;
}

.map-loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #344146;
  border-top-color: transparent;
  border-radius: 50%;
  animation: investpng-map-spin 0.8s linear infinite;
}

@keyframes investpng-map-spin {
  to { transform: rotate(360deg); }
}

/* ── Empty state ──────────────────────────────────────────────────────────── */

.map-empty {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #5a6170;
  z-index: 10;
  pointer-events: none;
}

/* ── Mapbox popup overrides ───────────────────────────────────────────────── */

.mapboxgl-popup-content {
  padding: 16px 18px;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 280px;
}

.mapboxgl-popup-close-button {
  font-size: 18px;
  color: #5a6170;
  padding: 4px 8px;
}

.mapboxgl-popup-close-button:hover {
  color: #344146;
  background: transparent;
}

/* ── Popup card ───────────────────────────────────────────────────────────── */

.map-popup-card {
  line-height: 1.4;
}

.map-popup-title {
  font-size: 14px;
  font-weight: 700;
  color: #344146;
  margin: 0 0 8px;
  line-height: 1.3;
}

.map-popup-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.map-popup-sector {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #A48C48;
}

.map-popup-stage {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5a6170;
}

.map-popup-region {
  font-size: 11px;
  color: #5a6170;
  margin: 4px 0;
}

.map-popup-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0;
}

.map-popup-capital {
  font-size: 12px;
  color: #5a6170;
  margin: 4px 0;
}

.map-popup-capital-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
}

.map-popup-capital-secured {
  background: #e8f5e9;
  color: #2e7d32;
}

.map-popup-capital-seeking {
  background: #fff3e0;
  color: #e65100;
}

.map-popup-readiness {
  font-size: 12px;
  color: #5a6170;
  margin: 4px 0;
}

.map-popup-summary {
  font-size: 12px;
  color: #344146;
  line-height: 1.5;
  margin: 6px 0;
}

.map-popup-cta {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #A48C48;
  text-decoration: none;
}

.map-popup-cta:hover {
  color: #344146;
}

/* ── Style toggle ────────────────────────────────────────────────────────── */

.map-style-toggle {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  gap: 0;
  z-index: 5;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.map-style-btn {
  appearance: none;
  border: none;
  background: #ffffff;
  color: #5a6170;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-right: 1px solid #e2e2e2;
}

.map-style-btn:last-child {
  border-right: none;
}

.map-style-btn:hover {
  background: #f5f5f0;
  color: #344146;
}

.map-style-btn.is-active {
  background: #344146;
  color: #ffffff;
}

/* ── Cooperative gestures hint ───────────────────────────────────────────── */

.mapboxgl-cooperative-gesture-screen {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  #investpng-map {
    height: 420px;
  }

  .mapboxgl-popup-content {
    max-width: 240px;
    padding: 12px 14px;
  }
}
