/* Map engines (js/map/*): the canvas host of both adapters, attribution in both themes, Leaflet
   DOM pins (the MapLibre ones are canvas images from js/map/pins.js and look the same), the
   draggable pick pin and the «you are here» dot. The point picker is in map-picker.css. */

/* MapLibre's own stylesheet makes the host position: relative, so it is sized, not inset. */
.gp-map-canvas {
  width: 100%;
  height: 100%;
}

:root[data-theme='dark'] .maplibregl-ctrl.maplibregl-ctrl-attrib {
  background: rgba(23, 33, 43, 0.8);
  color: #c5ced8;
}

:root[data-theme='dark'] .maplibregl-ctrl-attrib a {
  color: #c5ced8;
}

/* Leaflet fallback. */
.gp-leaflet.leaflet-container {
  background: var(--bg2);
  font: inherit;
}

.gp-dark-tiles .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.9);
}

.gp-attrib {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1000;
  padding: 2px 6px;
  border-top-left-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  color: #333333;
  font-size: 11px;
  line-height: 16px;
  text-decoration: none;
}

:root[data-theme='dark'] .gp-attrib {
  background: rgba(23, 33, 43, 0.85);
  color: #c5ced8;
}

.gp-licon {
  background: none;
  border: 0;
}

/* Exact pin: a 40×50 teardrop whose tip (20, 47) is the point, as in the canvas artwork. */
.gp-lpin {
  position: relative;
  width: 40px;
  height: 50px;
  cursor: pointer;
}

.gp-lpin::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 3.5px;
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: -1px 1px 5px rgba(0, 0, 0, 0.35);
}

.gp-lpin-host::before {
  background: var(--accent);
  border-color: var(--accent);
}

.gp-lpin-in::before {
  background: #2e9d47;
  border-color: #2e9d47;
}

.gp-lpin-wait::before {
  background: #f5a623;
  border-color: #f5a623;
}

.gp-lpin-off::before {
  background: #9aa3ad;
  border-color: #9aa3ad;
}

.gp-lpin:not(.gp-lpin-open)::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 8.5px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
}

.gp-lpin-emoji {
  position: absolute;
  left: 0;
  right: 0;
  top: 10px;
  z-index: 1;
  font-size: 18px;
  line-height: 22px;
  text-align: center;
}

.gp-lpin-off .gp-lpin-emoji {
  opacity: 0.5;
}

/* Area centre: a round bubble with a dashed ring, deliberately unlike a pin. */
.gp-lpin.gp-lpin-area {
  width: 36px;
  height: 36px;
}

.gp-lpin.gp-lpin-area::before {
  left: 2px;
  top: 2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transform: none;
  background: rgba(255, 255, 255, 0.95);
  border: 2px dashed var(--accent);
}

.gp-lpin-area.gp-lpin-in::before {
  border-color: #2e9d47;
}

.gp-lpin-area.gp-lpin-wait::before {
  border-color: #f5a623;
}

.gp-lpin-area.gp-lpin-off::before {
  border-color: #9aa3ad;
}

.gp-lpin.gp-lpin-area::after {
  display: none;
}

.gp-lpin-area .gp-lpin-emoji {
  top: 7px;
  font-size: 16px;
}

.gp-lpin-label {
  position: absolute;
  top: 38px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #4c535c;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

:root[data-theme='dark'] .gp-lpin-label {
  background: rgba(23, 33, 43, 0.92);
  color: #d5dde6;
}

.gp-lcluster {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

/* Pick pin, 30×37 with the tip at the bottom centre (both adapters anchor it there). */
.gp-drop-wrap {
  position: relative;
  width: 30px;
  height: 37px;
  cursor: grab;
}

.gp-drop {
  position: absolute;
  left: 3px;
  top: 8px;
  width: 24px;
  height: 24px;
  border: 3px solid #ffffff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #e53935;
  box-shadow: -1px 1px 4px rgba(0, 0, 0, 0.4);
}

.gp-drop::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #ffffff;
}

.gp-self {
  width: 18px;
  height: 18px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #2481cc;
  box-shadow: 0 0 0 7px rgba(36, 129, 204, 0.22), 0 1px 4px rgba(0, 0, 0, 0.35);
}
