/* GoWhere map — dopasowanie Leaflet do sea/ink/sand */
.gw-map {
  position: relative;
  /* Wysokość tu, nie tylko w Tailwind — h-72/h-80 bywały poza buildem app.css → mapa 0px. */
  width: 100%;
  height: 18rem;
  min-height: 18rem;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(61, 155, 143, 0.12), transparent 55%),
    radial-gradient(ellipse at 90% 80%, rgba(240, 194, 122, 0.10), transparent 50%),
    #e8eef1;
}
@media (min-width: 640px) {
  .gw-map { height: 20rem; min-height: 20rem; }
}
html.dark .gw-map {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(61, 155, 143, 0.10), transparent 55%),
    radial-gradient(ellipse at 90% 80%, rgba(240, 194, 122, 0.06), transparent 50%),
    #0e2435;
}

/* Delikatny winiet — mapa nie „wypada” z karty */
.gw-map::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 450;
  box-shadow: inset 0 0 0 1px rgba(12, 31, 46, 0.06), inset 0 -28px 40px -24px rgba(12, 31, 46, 0.12);
  border-radius: inherit;
}
html.dark .gw-map::after {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 -28px 40px -24px rgba(0, 0, 0, 0.35);
}

/* L.map(el) dodaje .leaflet-container NA ten sam element co .gw-map */
.gw-map.leaflet-container,
.gw-map .leaflet-container {
  width: 100% !important;
  height: 100% !important;
  min-height: 18rem;
  background: transparent;
  font: 12px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  color: #0c1f2e;
}
html.dark .gw-map.leaflet-container,
html.dark .gw-map .leaflet-container { color: #e9eff5; }

/* Zoom — miękkie „pigułki” jak reszta UI */
.gw-map .leaflet-control-zoom {
  border: 0 !important;
  box-shadow: 0 8px 24px rgba(7, 19, 28, 0.12) !important;
  border-radius: 14px !important;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
html.dark .gw-map .leaflet-control-zoom {
  background: rgba(20, 38, 58, 0.92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}
.gw-map .leaflet-bar a,
.gw-map .leaflet-touch .leaflet-bar a {
  width: 36px;
  height: 36px;
  line-height: 34px;
  border: 0 !important;
  background: transparent;
  color: #2f7d73;
  font-size: 18px;
  font-weight: 600;
}
.gw-map .leaflet-bar a:hover,
.gw-map .leaflet-bar a:focus {
  background: rgba(61, 155, 143, 0.12);
  color: #2f7d73;
}
html.dark .gw-map .leaflet-bar a { color: #4db6a9; }
html.dark .gw-map .leaflet-bar a:hover,
html.dark .gw-map .leaflet-bar a:focus {
  background: rgba(77, 182, 169, 0.16);
  color: #4db6a9;
}
.gw-map .leaflet-bar a.leaflet-disabled { opacity: 0.35; }

/* Atrybucja — dyskretny pasek */
.gw-map .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(28, 70, 96, 0.55);
  font-size: 9px !important;
  padding: 2px 8px !important;
  border-radius: 10px 0 0 0;
  margin: 0 !important;
  box-shadow: none;
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.dark .gw-map .leaflet-control-attribution {
  background: rgba(10, 24, 36, 0.75) !important;
  color: rgba(188, 201, 212, 0.55);
}
.gw-map .leaflet-control-attribution a { color: inherit; }

/* Popup w stylu karty */
.gw-map .leaflet-popup-content-wrapper {
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 12px 32px rgba(7, 19, 28, 0.18);
  border: 1px solid rgba(12, 31, 46, 0.06);
  background: rgba(255, 255, 255, 0.97);
  color: #0c1f2e;
}
html.dark .gw-map .leaflet-popup-content-wrapper {
  background: #14263a;
  border-color: rgba(255, 255, 255, 0.08);
  color: #e9eff5;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.gw-map .leaflet-popup-content {
  margin: 12px 14px;
  font-size: 13px;
  line-height: 1.4;
  min-width: 140px;
}
.gw-map .leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: none;
}
html.dark .gw-map .leaflet-popup-tip { background: #14263a; }
.gw-map .leaflet-popup-close-button {
  color: rgba(28, 70, 96, 0.45) !important;
  top: 6px !important;
  right: 8px !important;
  font-size: 18px !important;
  width: 24px !important;
  height: 24px !important;
}
html.dark .gw-map .leaflet-popup-close-button { color: rgba(188, 201, 212, 0.5) !important; }
.gw-map .gw-popup-meta {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #2f7d73;
  margin-bottom: 2px;
}
.gw-map .gw-popup-title { font-weight: 600; font-size: 13px; }
.gw-map .gw-popup-nav {
  display: inline-flex;
  margin-top: 8px;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #3d9b8f;
  text-decoration: none;
}
html.dark .gw-map .gw-popup-nav { color: #4db6a9; }

/* Numerowane pinezki */
.gw-map-pin {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 12px rgba(7, 19, 28, 0.28), 0 0 0 1px rgba(12, 31, 46, 0.08);
  transform: translate(-50%, -50%);
}
html.dark .gw-map-pin {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.gw-map-pin--start {
  width: 32px;
  height: 32px;
  font-size: 12px;
  box-shadow: 0 6px 16px rgba(61, 155, 143, 0.4), 0 0 0 3px rgba(61, 155, 143, 0.2);
}

/* Legenda dni pod mapą */
.gw-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
}
.gw-map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(28, 70, 96, 0.7);
  background: rgba(7, 19, 28, 0.04);
  border: 0;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.gw-map-legend-item.is-off { opacity: 0.4; }
.gw-map-legend-meta {
  font-weight: 500;
  color: rgba(28, 70, 96, 0.45);
  margin-left: 0.15rem;
}
html.dark .gw-map-legend-item {
  color: rgba(188, 201, 212, 0.7);
  background: rgba(255, 255, 255, 0.06);
}
html.dark .gw-map-legend-meta { color: rgba(188, 201, 212, 0.45); }
.gw-map-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
}
