/* ============================================================
   FILE: assets/css/colorado-map.css
   Colorado Service Map Section Styles
   ============================================================ */

/* ── Section wrapper ────────────────────────────────────────── */
.service-map-section {
  padding: 80px 0 60px;
  background: #f8f9fb;
  position: relative;
  overflow: hidden;
}

/* Subtle top border accent */
.service-map-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2a6496 0%, #3aafa9 50%, #2a6496 100%);
}

/* ── Inner container ────────────────────────────────────────── */
.smap-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ─────────────────────────────────────────────────── */
.smap-header {
  text-align: center;
  margin-bottom: 32px;
}

.smap-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #2a6496;
  margin-bottom: 10px;
}

.smap-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 700;
  color: #1a2733;
  margin: 0 0 12px;
  line-height: 1.2;
}

.smap-subtitle {
  font-size: 16px;
  color: #5a6a78;
  margin: 0;
}

/* ── Legend ─────────────────────────────────────────────────── */
.smap-legend {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.smap-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #3a4a56;
}

.smap-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

/* Status colours — used both in legend and on the map */
.smap-dot--active,
.leaflet-interactive.status-active {
  background-color: #27ae60;
}

.smap-dot--partial,
.leaflet-interactive.status-partial {
  background-color: #f39c12;
}

.smap-dot--inactive,
.leaflet-interactive.status-inactive {
  background-color: #c0cdd6;
}

/* ── Map wrapper ────────────────────────────────────────────── */
.smap-map-wrapper {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.06);
  overflow: hidden;
  position: relative;
}

#colorado-map {
  width: 100%;
  height: clamp(320px, 45vw, 520px);
  background: #eaf4fb;
  display: block;
  outline: none;
}

#colorado-map:focus-visible {
  box-shadow: inset 0 0 0 3px #2a6496;
}

/* ── Loading overlay ────────────────────────────────────────── */
.smap-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 14px;
  color: #5a6a78;
  background: #eaf4fb;
  z-index: 1000;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.smap-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.smap-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #d0e4ef;
  border-top-color: #2a6496;
  border-radius: 50%;
  animation: smap-spin 0.8s linear infinite;
}

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

/* ── Leaflet overrides ──────────────────────────────────────── */
/* Remove default tile attribution prominence */
.leaflet-control-attribution {
  font-size: 10px !important;
  background: rgba(255,255,255,0.7) !important;
}

/* County polygons */
.smap-county {
  transition: fill-opacity 0.18s ease, stroke-width 0.18s ease;
}

.smap-county:hover,
.smap-county:focus {
  fill-opacity: 0.85 !important;
  stroke-width: 2.5px !important;
  cursor: pointer;
}

/* ── Custom Tooltip ─────────────────────────────────────────── */
.smap-tooltip {
  background: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 28px rgba(0,0,0,0.14) !important;
  padding: 0 !important;
  pointer-events: none !important;
  min-width: 170px;
}

.smap-tooltip::before {
  display: none !important;
}

.smap-tooltip-inner {
  padding: 12px 16px;
}

.smap-tooltip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.smap-tooltip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.smap-tooltip-name {
  font-size: 14px;
  font-weight: 700;
  color: #1a2733;
  margin: 0;
}

.smap-tooltip-status {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  display: inline-block;
}

.smap-tooltip-status--active {
  background: #e8f8ef;
  color: #1d8348;
}

.smap-tooltip-status--partial {
  background: #fef5e4;
  color: #b7770d;
}

.smap-tooltip-status--inactive {
  background: #f0f3f5;
  color: #6b8293;
}

.smap-tooltip-note {
  font-size: 11.5px;
  color: #8a9aa6;
  margin: 6px 0 0;
  line-height: 1.5;
}

/* ── Stats bar ──────────────────────────────────────────────── */
.smap-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-top: 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  padding: 16px 0;
  flex-wrap: wrap;
}

.smap-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 40px;
}

.smap-stat-num {
  font-size: 28px;
  font-weight: 700;
  color: #1a2733;
  line-height: 1;
  margin-bottom: 4px;
}

.smap-stat-label {
  font-size: 12px;
  color: #7a8d99;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.smap-stat-divider {
  width: 1px;
  height: 36px;
  background: #e4eaee;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .service-map-section {
    padding: 50px 0 40px;
  }

  .smap-legend {
    gap: 14px;
  }

  .smap-stat {
    padding: 8px 20px;
  }

  .smap-stat-divider {
    display: none;
  }

  .smap-stats {
    gap: 4px;
  }
}
