/* Interactive city map (/mapa). Full-height app layout below the site navigation: list panel + map. */

.mapa-page {
  overflow: hidden;
}

/* Buttons and boxes below set their own display, which would otherwise override the hidden attribute. */
.mp-page [hidden] {
  display: none !important;
}

/* Category colours. */
.mp-c-praca { --c: #ed9b16; }
.mp-c-sluzby { --c: #168dff; }
.mp-c-biznes { --c: #9346e5; }
.mp-c-sklep { --c: #18ae58; }
.mp-c-warsztat { --c: #e74632; }
.mp-c-rozrywka { --c: #e22f82; }
.mp-c-miejsce { --c: #e4b329; }
.mp-c-inne { --c: #8a98a8; }

.mp-page {
  position: fixed;
  inset: var(--sn-h, 72px) 0 0 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 360px 1fr;
  color: #faf7f3;
}

/* ---------- Panel ---------- */

.mp-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--plrp-panel-strong, #110c0a);
  border-right: 1px solid var(--plrp-line, rgba(232, 168, 97, 0.16));
}

.mp-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 20px 14px;
}

.mp-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--plrp-amber, #e8a861);
}

.mp-panel-head h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.mp-sheet-toggle {
  display: none;
}

.mp-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 20px 20px;
  overscroll-behavior: contain;
}

.mp-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(250, 247, 243, 0.55);
}

.mp-search:focus-within {
  border-color: var(--plrp-amber, #e8a861);
  color: var(--plrp-amber, #e8a861);
}

.mp-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #faf7f3;
  font: inherit;
  font-size: 14px;
}

.mp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 10px;
}

.mp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(250, 247, 243, 0.78);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mp-chip svg {
  color: var(--c, currentColor);
}

.mp-chip small {
  font-size: 11px;
  color: rgba(250, 247, 243, 0.45);
}

.mp-chip:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.mp-chip[aria-pressed="true"] {
  border-color: var(--c, var(--plrp-amber, #e8a861));
  background: color-mix(in srgb, var(--c, #e8a861) 16%, transparent);
  color: #fff;
}

.mp-count {
  margin: 4px 0 8px;
  font-size: 12px;
  color: rgba(250, 247, 243, 0.5);
}

.mp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mp-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mp-item:hover,
.mp-item:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  outline: none;
}

.mp-item-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 15%, transparent);
}

.mp-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mp-item-text strong {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-item-text small {
  font-size: 12px;
  color: rgba(250, 247, 243, 0.5);
}

.mp-empty {
  padding: 18px 4px;
  font-size: 13px;
  color: rgba(250, 247, 243, 0.55);
}

/* ---------- Edit mode and form ---------- */

.mp-editbar {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.mp-hint {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(250, 247, 243, 0.55);
}

.mp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #faf7f3;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.mp-btn:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

.mp-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.mp-btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--plrp-amber, #e8a861), var(--plrp-copper, #d9793f));
  color: #1a0f08;
}

.mp-btn-primary[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--plrp-amber, #e8a861);
  color: var(--plrp-amber, #e8a861);
}

.mp-btn-danger {
  margin-left: auto;
  border-color: rgba(255, 107, 90, 0.4);
  color: #ff8b7d;
}

.mp-form h2 {
  margin: 0 0 14px;
  font-size: 17px;
}

.mp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(250, 247, 243, 0.75);
}

.mp-field small {
  font-weight: 400;
  color: rgba(250, 247, 243, 0.45);
}

.mp-field input,
.mp-field select,
.mp-field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #faf7f3;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
}

.mp-field select option {
  background: #1a1410;
}

.mp-field textarea {
  resize: vertical;
  min-height: 84px;
}

.mp-field input:focus,
.mp-field select:focus,
.mp-field textarea:focus {
  outline: none;
  border-color: var(--plrp-amber, #e8a861);
}

.mp-field-help {
  font-size: 12px !important;
  line-height: 1.45;
}

.mp-field-help.is-error {
  color: #ff8b7d !important;
}

.mp-form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 107, 90, 0.12);
  color: #ffb1a7;
  font-size: 13px;
}

.mp-form-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Map ---------- */

/* Its own stacking layer, so Leaflet's panes (z-index 400+) stay under the panel and the bottom sheet. */
.mp-map-wrap {
  position: relative;
  z-index: 1;
  isolation: isolate;
  min-height: 0;
  min-width: 0;
}

.mp-map {
  position: absolute;
  inset: 0;
  background: #0fa8d2;
  font-family: inherit;
}

.mp-page[data-style="satellite"] .mp-map {
  background: #153e6a;
}

.mp-load-state {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 600;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  padding: 18px 22px;
  border-radius: 12px;
  background: #100e0e;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 13px;
  text-align: center;
}

.mp-overview button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  background: rgba(12, 9, 8, 0.9);
  color: #faf7f3;
  cursor: pointer;
}

.mp-overview button:hover {
  background: #281e18;
}

.mp-page.is-editing .mp-map {
  cursor: crosshair;
}

.mp-styles {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 500;
  display: flex;
  padding: 4px;
  gap: 4px;
  border-radius: 12px;
  background: rgba(12, 9, 8, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.mp-style {
  padding: 7px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(250, 247, 243, 0.7);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.mp-style[aria-checked="true"] {
  background: var(--plrp-amber, #e8a861);
  color: #1a0f08;
}

.mp-coords {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 500;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(12, 9, 8, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Space Grotesk', monospace;
  font-size: 13px;
  white-space: pre;
  pointer-events: none;
}

.mp-coords:empty {
  display: none;
}

.mp-toast {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 600;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(12, 9, 8, 0.92);
  border: 1px solid var(--plrp-line, rgba(232, 168, 97, 0.25));
  font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  overflow-wrap: anywhere;
}

/* Leaflet controls in the site's colours. */
.mp-map .leaflet-bar {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.mp-map .leaflet-bar a {
  width: 36px;
  height: 36px;
  line-height: 36px;
  background: rgba(12, 9, 8, 0.85);
  color: #faf7f3;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.mp-map .leaflet-bar a:hover {
  background: rgba(40, 30, 24, 0.95);
}

.mp-map .leaflet-control-attribution {
  background: rgba(12, 9, 8, 0.7);
  color: rgba(250, 247, 243, 0.6);
  font-size: 10.5px;
}

.mp-map .leaflet-control-attribution a {
  color: rgba(250, 247, 243, 0.8);
}

/* ---------- Pins ---------- */

.mp-marker {
  background: none;
  border: 0;
}

/* Radar badges stay centred on their exact in-game coordinates at every zoom. */
.mp-pin-wrap {
  display: block;
  width: 34px;
  height: 34px;
  transform-origin: center;
  transition: transform 0.2s ease;
}

.mp-page[data-pins="small"] .mp-pin-wrap {
  transform: scale(0.8);
}

.mp-page[data-pins="tiny"] .mp-pin-wrap {
  transform: scale(0.6);
}

.mp-pin {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, #333c43, #10161b 70%);
  border: 1.5px solid var(--c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px #080c10, 0 2px 4px rgba(0, 0, 0, 0.65);
  color: #f4f5f2;
  transition: transform 0.15s ease;
}

.mp-pin::after {
  content: '';
  position: absolute;
  right: -1px;
  bottom: 1px;
  width: 7px;
  height: 7px;
  border: 1px solid #080c10;
  border-radius: 50%;
  background: var(--c);
}

/* Native GTA sprites retain their antialiasing and black outline on both map styles. */
.mp-blip {
  display: inline-block;
  flex: 0 0 auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.mp-marker:hover .mp-pin,
.mp-marker:focus-visible .mp-pin {
  transform: scale(1.12);
}

.mp-pin.is-selected,
.mp-pin.is-new {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9), 0 6px 16px rgba(0, 0, 0, 0.5);
}

.mp-pin.is-new {
  animation: mp-bounce 1s ease-in-out infinite alternate;
}

@keyframes mp-bounce {
  to { transform: translateY(-3px); }
}

/* ---------- Popups ---------- */

.mp-popup .leaflet-popup-content-wrapper {
  border-radius: 14px;
  background: rgba(16, 12, 10, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #faf7f3;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}

.mp-popup .leaflet-popup-tip {
  background: rgba(16, 12, 10, 0.97);
}

.mp-popup .leaflet-popup-content {
  margin: 14px 16px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
}

.mp-popup a.leaflet-popup-close-button {
  color: rgba(250, 247, 243, 0.6);
  top: 6px;
  right: 6px;
}

.mp-pop {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mp-pop-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: var(--c);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mp-pop-name {
  font-size: 16px;
  line-height: 1.3;
  padding-right: 14px;
}

.mp-pop-desc {
  margin: 0;
  color: rgba(250, 247, 243, 0.78);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mp-pop-desc .msg-link,
.mp-pop-link {
  color: var(--plrp-amber-soft, #f0c48f);
}

.mp-pop-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-decoration: none;
}

.mp-pop-link:hover {
  text-decoration: underline;
}

.mp-pop-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.mp-pop-btn {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(250, 247, 243, 0.85);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.mp-pop-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

/* ---------- Phones: the panel becomes a bottom sheet over the map ---------- */

@media (max-width: 900px) {
  .mp-page {
    grid-template-columns: 1fr;
  }

  .mp-map-wrap {
    grid-row: 1;
    grid-column: 1;
  }

  .mp-panel {
    grid-row: 1;
    grid-column: 1;
    align-self: end;
    max-height: 132px;
    border-right: 0;
    border-top: 1px solid var(--plrp-line, rgba(232, 168, 97, 0.2));
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.45);
    transition: max-height 0.25s ease;
  }

  .mp-panel.is-open {
    max-height: 72%;
  }

  .mp-panel-head {
    padding: 14px 16px 10px;
    align-items: center;
  }

  .mp-panel-head h1 {
    font-size: 19px;
  }

  .mp-kicker {
    display: none;
  }

  .mp-sheet-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #faf7f3;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }

  .mp-sheet-toggle svg {
    transition: transform 0.2s ease;
  }

  .mp-panel.is-open .mp-sheet-toggle svg {
    transform: rotate(180deg);
  }

  .mp-panel-body {
    padding: 0 16px 16px;
  }

  .mp-panel:not(.is-open) .mp-chips,
  .mp-panel:not(.is-open) .mp-count,
  .mp-panel:not(.is-open) .mp-list,
  .mp-panel:not(.is-open) .mp-editbar {
    display: none;
  }

  .mp-panel:not(.is-open) .mp-search {
    margin-bottom: 4px;
  }

  .mp-map .leaflet-bottom {
    bottom: 132px;
  }

  .mp-coords {
    bottom: 146px;
  }

  .mp-toast {
    bottom: 148px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mp-pin.is-new {
    animation: none;
  }
}
