/* ─────────────────────────────────────────────────────────────────────────
   NepalConnect Mapbox 2D & OpenStreetMap Styling
   Rock-solid marker pins, clean 2D polygon overlays, polished controls
   ───────────────────────────────────────────────────────────────────────── */

.mapboxgl-map {
  font-family: inherit;
}

.cov-map,
#adminCovMap {
  position: relative;
  width: 100%;
  height: 500px;
  min-height: 440px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--color-border, #EAE5DD);
  background: #F3F4F6;
}

.mapboxgl-canvas-container,
.mapboxgl-canvas {
  outline: none !important;
}

/* Hide Mapbox logo watermark and bottom attribution bar */
.mapboxgl-ctrl-logo,
a.mapboxgl-ctrl-logo,
.mapboxgl-ctrl-attrib,
.mapboxgl-ctrl-attrib-inner {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   Map Style Toolbar — Sleek Segmented Pill Control
   ───────────────────────────────────────────────────────────────────────── */
.nc-map-toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 3px;
  border-radius: 9999px;
  border: 1px solid rgba(226, 220, 212, 0.92);
  box-shadow: 0 4px 16px rgba(18, 15, 13, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.nc-map-style-btn {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  padding: 6px 13px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: #57534E;
  border-radius: 9999px;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.nc-map-style-btn:hover {
  color: #171412;
  background: rgba(0, 0, 0, 0.04);
}

.nc-map-style-btn.active {
  background: #171412;
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(23, 20, 18, 0.22);
}

/* ─────────────────────────────────────────────────────────────────────────
   Rock-Solid Pointer Markers
   IMPORTANT: .nc-marker must have NO CSS transform or transition!
   Mapbox GL controls the outer element positioning.
   Micro-animations run strictly on the inner .nc-marker-pin.
   ───────────────────────────────────────────────────────────────────────── */
.nc-marker {
  position: relative;
  width: 30px;
  height: 40px;
  cursor: pointer;
  pointer-events: auto;
}

.nc-marker-pin {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: 50% 100%;
  transition: transform 0.16s ease-out;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.22));
}

.nc-marker:hover .nc-marker-pin {
  transform: scale(1.16) translateY(-3px);
  filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.28));
}

.nc-marker svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* User GPS Pulse Wave (Centered on the pin tip) */
.nc-marker-pulse {
  position: absolute;
  left: 50%;
  bottom: 0px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.35);
  transform: translate(-50%, 50%);
  pointer-events: none;
  animation: nc-beacon-pulse 2s cubic-bezier(0.2, 0, 0, 1) infinite;
}

@keyframes nc-beacon-pulse {
  0% {
    transform: translate(-50%, 50%) scale(0.2);
    opacity: 0.9;
  }
  70% {
    transform: translate(-50%, 50%) scale(1.5);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* Waitlist badge on demand pins */
.nc-marker-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: #4F46E5;
  color: #FFFFFF;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ─────────────────────────────────────────────────────────────────────────
   City Selector Chips
   ───────────────────────────────────────────────────────────────────────── */
.nc-city-chips-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nc-city-chips-bar::-webkit-scrollbar {
  display: none;
}

.nc-city-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary, #57534E);
  background: var(--color-surface, #FFFFFF);
  border: 1px solid var(--color-border, #EAE5DD);
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nc-city-chip:hover {
  background: var(--color-surface-hover, #F7F4EE);
  color: var(--color-text-primary, #1C1917);
  border-color: #D6CEC3;
}

.nc-city-chip.active {
  background: var(--color-primary, #C25E26);
  color: #FFFFFF;
  border-color: var(--color-primary-hover, #A74E1B);
  box-shadow: 0 2px 6px rgba(194, 94, 38, 0.25);
}

/* ─────────────────────────────────────────────────────────────────────────
   Search Bar
   ───────────────────────────────────────────────────────────────────────── */
.nc-map-search-bar {
  position: relative;
  margin-bottom: 12px;
}

.nc-map-search-inner {
  position: relative;
  display: flex;
  align-items: center;
}

.nc-map-search-input {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 36px;
  font-size: 13.5px;
  color: var(--color-text-primary, #1C1917);
  background: #FFFFFF;
  border: 1px solid var(--color-border, #EAE5DD);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
}

.nc-map-search-input:focus {
  outline: none;
  border-color: var(--color-primary, #C25E26);
  box-shadow: 0 0 0 3px var(--color-primary-glow, rgba(194, 94, 38, 0.15));
}

.nc-map-search-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  color: var(--color-text-muted, #78716C);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.nc-map-search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  font-size: 16px;
  color: #9CA3AF;
  cursor: pointer;
  padding: 4px;
  display: none;
}

.nc-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #FFFFFF;
  border: 1px solid var(--color-border, #EAE5DD);
  border-radius: 10px;
  box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.1);
  z-index: 50;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}

.nc-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #F3F4F6;
  transition: background 0.12s ease;
}

.nc-search-item:last-child {
  border-bottom: none;
}

.nc-search-item:hover {
  background: #F9FAFB;
}

/* ─────────────────────────────────────────────────────────────────────────
   Popups
   ───────────────────────────────────────────────────────────────────────── */
.nc-mapbox-popup .mapboxgl-popup-content {
  border-radius: 12px;
  padding: 12px 14px;
  background: #FFFFFF;
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.15), 0 3px 8px -2px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-border, #EAE5DD);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-primary, #1C1917);
  max-width: 270px;
}

.nc-mapbox-popup .mapboxgl-popup-close-button {
  font-size: 16px;
  color: #9CA3AF;
  padding: 4px 8px;
  right: 2px;
  top: 2px;
  border-radius: 50%;
  line-height: 1;
}

.nc-mapbox-popup .mapboxgl-popup-close-button:hover {
  color: var(--color-text-primary, #1C1917);
  background: #F3F4F6;
}

.nc-mapbox-popup .mapboxgl-popup-tip {
  border-top-color: #FFFFFF !important;
}

.nc-popup-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nc-popup-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 5px;
  margin-bottom: 3px;
}

.nc-popup-badge.badge-success {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #BBF7D0;
}

.nc-popup-badge.badge-warning {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.nc-popup-badge.badge-user {
  background: #DBEAFE;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.nc-popup-badge.badge-demand {
  background: #EDE9FE;
  color: #5B21B6;
  border: 1px solid #DDD6FE;
}

.nc-popup-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary, #1C1917);
}

.nc-popup-meta {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted, #78716C);
}

.nc-popup-desc {
  margin: 3px 0 5px;
  font-size: 12.5px;
  color: var(--color-text-secondary, #57534E);
}

.nc-popup-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF !important;
  background: var(--color-primary, #C25E26);
  border-radius: 6px;
  text-decoration: none !important;
  transition: background 0.15s ease;
}

.nc-popup-cta:hover {
  background: var(--color-primary-hover, #A74E1B);
}

/* Standard Mapbox Control polish */
.mapboxgl-ctrl-group {
  border-radius: 8px !important;
  border: 1px solid var(--color-border, #EAE5DD) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
  overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────────────────
   Coverage Toolbar, Legend & GPS Bar
   ───────────────────────────────────────────────────────────────────────── */
.cov-toolbar-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid #EAE5DD;
  border-radius: 14px;
  padding: 12px 18px;
  margin: 14px 0 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.cov-legend-group {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cov-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #292524;
}

.cov-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.cov-legend-dot--live {
  background: #16A34A;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.cov-legend-dot--planned {
  background: #D97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

.cov-legend-label {
  font-weight: 600;
  color: #1C1917;
}

.cov-legend-sub {
  font-size: 12.5px;
  color: #78716C;
}

.cov-gps-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #171412;
  background: #FAF7F2;
  border: 1px solid #EAE5DD;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.16s ease;
  line-height: 1;
}

.cov-gps-button:hover {
  background: #F5EFE6;
  border-color: #D6CEC3;
  color: #C25E26;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.cov-gps-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────────────────
   City Directory Cards Grid
   ───────────────────────────────────────────────────────────────────────── */
.cov-cities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 6px;
}

.cov-city {
  position: relative;
  background: #FFFFFF;
  border: 1px solid #EAE5DD;
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  cursor: pointer;
}

.cov-city:hover {
  border-color: #C25E26;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -4px rgba(194, 94, 38, 0.14), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.cov-city__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.cov-city__title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cov-city__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #171412 !important;
  letter-spacing: -0.01em;
  text-decoration: none !important;
  transition: color 0.16s ease;
}

.cov-city:hover .cov-city__title {
  color: #C25E26 !important;
}

.cov-city__badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 9999px;
}

.cov-city__badge.badge-live {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #BBF7D0;
}

.cov-city__badge.badge-soon {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.cov-city__arrow-wrap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #FAF7F2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.cov-city__arrow {
  font-size: 14px;
  font-weight: 700;
  color: #78716C;
  transition: all 0.18s ease;
}

.cov-city:hover .cov-city__arrow-wrap {
  background: #C25E26;
}

.cov-city:hover .cov-city__arrow {
  color: #FFFFFF;
  transform: translateX(2px);
}

.cov-city__body {
  margin-bottom: 14px;
}

.cov-city__areas {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.cov-area-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  line-height: 1.25;
}

.cov-area-pill.live {
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #DCFCE7;
}

.cov-area-empty {
  font-size: 12.5px;
  color: #78716C;
  font-style: italic;
}

.cov-city__soon {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #EAE5DD;
  font-size: 12px;
}

.cov-soon-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 4px;
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
  flex-shrink: 0;
}

.cov-soon-names {
  color: #57534E;
  line-height: 1.35;
}

.cov-city__footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #F5EFE6;
}

.cov-city__link {
  font-size: 12.5px;
  font-weight: 600;
  color: #C25E26 !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.15s ease;
}

.cov-city__link:hover {
  text-decoration: underline !important;
  gap: 6px;
}

@media (max-width: 640px) {
  .cov-map,
  #adminCovMap {
    height: 380px;
    min-height: 360px;
  }

  .cov-toolbar-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .cov-gps-button {
    width: 100%;
    justify-content: center;
  }
}
