/* PlanetActive Self-Hosted MapLibre GL Coastal Surface & Clean Dot Marker Styles */
@font-face {
  font-family: "Instrument Sans";
  src: url("../assets/packages/planetactive_design_system/assets/fonts/InstrumentSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("../assets/packages/planetactive_design_system/assets/fonts/InstrumentSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("../assets/packages/planetactive_design_system/assets/fonts/InstrumentSans-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("../assets/packages/planetactive_design_system/assets/fonts/InstrumentSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

.pa-map-host {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #B6DDF0;
  font-family: "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* Disable all DOM hit-testing when a Flutter modal sheet/dialog covers the map */
.pa-map-host.pa-map-non-interactive,
.pa-map-host.pa-map-non-interactive * {
  pointer-events: none !important;
}

.pa-map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Override MapLibre default chrome & font for calm daylight legibility */
.pa-map-host .maplibregl-map {
  font-family: "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.pa-map-host .maplibregl-canvas {
  outline: none;
}

.pa-map-host .maplibregl-ctrl-bottom-left {
  left: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.pa-map-host .maplibregl-ctrl-scale {
  margin: 0 !important;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid #0F172A;
  border-top: none;
  border-radius: 0 0 4px 4px;
  color: #0F172A;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px 2px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}

/* Mandatory OSM attribution pill */
.pa-map-attribution {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 12;
  background: rgba(255, 255, 255, 0.94);
  color: #334155;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.10);
  pointer-events: none;
}

.pa-map-host.has-scale .maplibregl-ctrl-bottom-left {
  bottom: 38px;
}

/* Floating top-right Map Controls (>= 48x48px accessible hit targets) */
.pa-map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pa-map-ctrl-group {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.14);
}

.pa-map-ctrl-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  color: #0F172A;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background-color 120ms ease;
}

.pa-map-ctrl-btn + .pa-map-ctrl-btn {
  border-top: 1px solid #E2E8F0;
}

.pa-map-ctrl-btn:hover {
  background: #F1F5F9;
}

.pa-map-ctrl-btn:active {
  background: #E2E8F0;
}

.pa-map-ctrl-btn:focus-visible {
  outline: 3px solid #0B4F6C;
  outline-offset: -3px;
}

.pa-map-ctrl-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* Clean solid coloured dot site markers (no outline, >= 48x48px accessible hit target)
 * NOTE: Never set `position: relative` here — MapLibre `.maplibregl-marker` requires `position: absolute`
 * (which is already a containing block for the positioned `.pa-map-pin-label` child). */
.pa-map-pin-btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  outline: none;
  overflow: visible;
}

.pa-map-pin-btn:hover,
.pa-map-pin-btn:focus-visible {
  z-index: 30;
}

.pa-map-pin-btn:hover .pa-map-pin-dot,
.pa-map-pin-btn:focus-visible .pa-map-pin-dot {
  transform: scale(1.1);
}

.pa-map-pin-btn:focus-visible .pa-map-pin-dot {
  box-shadow: 0 0 0 3px #0B4F6C, 0 4px 10px rgba(15, 23, 42, 0.28);
}

.pa-map-pin-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  font-family: "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.24);
  transition: transform 120ms ease;
}

.pa-map-pin-dot.is-planned-stop {
  width: 26px;
  height: 26px;
  font-size: 12.5px;
}

.pa-map-pin-label {
  position: absolute;
  top: calc(50% + 15px);
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border: none;
  color: #1E293B;
  font-family: "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  max-width: 136px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  pointer-events: none;
  transition: opacity 140ms ease;
}

.pa-map-pin-btn.label-above .pa-map-pin-label {
  top: auto;
  bottom: calc(50% + 15px);
}

.pa-map-pin-btn.label-hidden .pa-map-pin-label {
  opacity: 0;
  pointer-events: none;
}

.pa-map-pin-btn.label-hidden:hover .pa-map-pin-label,
.pa-map-pin-btn.label-hidden:focus-visible .pa-map-pin-label {
  opacity: 1;
}

.pa-map-offline-banner {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 68px;
  z-index: 16;
  background: #FFF3D6;
  color: #6B3700;
  border: 2px solid #6B3700;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

/* Compact mini-map mode (Home Dashboard Activity Map card) */
.pa-map-host.is-mini {
  pointer-events: none;
  touch-action: pan-y;
}

.pa-map-host.is-mini .pa-map-attribution {
  left: auto;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 9.5px;
  background: rgba(255, 255, 255, 0.86);
  border: none;
  box-shadow: none;
}

.pa-map-mini-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.32);
  box-sizing: border-box;
  pointer-events: none;
}
