/* parcel-markers.css — shared styles for createMarkerTool() (parcel-markers.js).
   All selectors are .pm-* so nothing here collides with anchor-props.css
   (.anchor-*) or the inline app styles. The .pm-pin--sm modifier is the
   "Critical Lots" variant: the same teardrop photo-pin, much smaller. */

/* ── Teardrop pin (rendered as an ol.Overlay element) ───────────────────── */
.pm-pin {
  /* Zero-size ANCHOR POINT. ol.Overlay writes transform:translate(...) to this
     element every frame to glue it to the parcel coordinate. Making it 0x0 means
     the placement is correct whether ol applies 'bottom-center' (-50%/-100% of 0
     = 0) or falls back to 'top-left' — either way a 0x0 box lands exactly on the
     point. The visible pin is the absolutely-positioned child below, whose TIP
     sits on this point. .pm-pin must NOT carry its own transform/transition. */
  position: absolute;
  width: 0;
  height: 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.pm-pin__body {
  position: absolute;
  left: 0;
  bottom: 0;
  margin-left: -23px;                 /* -(head width / 2): centre the tip on the anchor point */
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(var(--pm-scale, 1));
  transform-origin: center bottom;    /* the tip apex — stays on the point at any zoom scale */
  transition: transform .12s ease;
}

.pm-pin__head {
  width: 46px;
  height: 46px;
  box-sizing: border-box;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #fff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .45);
  overflow: hidden;
  transform-origin: center bottom;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.pm-pin:hover .pm-pin__head { transform: scale(1.08); }
.pm-pin.is-active .pm-pin__head {
  transform: scale(1.1);
  border-color: #ffd23f;
  box-shadow: 0 0 0 3px rgba(255, 210, 63, .35), 0 2px 8px rgba(0, 0, 0, .5);
}
.pm-pin__img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #13202e;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.pm-pin__img.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6fb6e6;
  font-size: 20px;
  font-weight: 700;
}
.pm-pin__tip {
  width: 0;
  height: 0;
  margin-top: -2px;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 13px solid #fff;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4));
}
.pm-pin.is-active .pm-pin__tip { border-top-color: #ffd23f; }

.pm-pin__label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 4px;
  max-width: 130px;
  padding: 1px 7px;
  font: 600 11px/1.3 var(--font, Charter, Georgia, serif);
  color: #eaf3fb;
  background: rgba(11, 22, 34, .82);
  border: 1px solid rgba(120, 180, 220, .35);
  border-radius: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ── Small variant: "Critical Lots" (same teardrop, much smaller) ────────── */
.pm-pin--sm .pm-pin__body { margin-left: -13px; }   /* -(small head width / 2) */
.pm-pin--sm .pm-pin__head {
  width: 26px;
  height: 26px;
  border-width: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
.pm-pin--sm .pm-pin__tip {
  margin-top: -1px;
  border-left-width: 6px;
  border-right-width: 6px;
  border-top-width: 9px;
}
.pm-pin--sm .pm-pin__img.is-empty { font-size: 12px; }
.pm-pin--sm .pm-pin__img.is-empty svg { width: 12px; height: 12px; }
.pm-pin--sm .pm-pin__label {
  font-size: 10px;
  max-width: 110px;
  margin-bottom: 3px;
}
/* Coral active ring so a critical-lot pin is distinguishable from an anchor
   pin when both sit on the same parcel. */
.pm-pin--sm.is-active .pm-pin__head {
  border-color: #ff9f43;
  box-shadow: 0 0 0 3px rgba(255, 159, 67, .4), 0 1px 5px rgba(0, 0, 0, .5);
}
.pm-pin--sm.is-active .pm-pin__tip { border-top-color: #ff9f43; }

/* ── Floating marker-tool control cluster (left edge of the map) ─────────────
   The Anchor + Critical Lots toggles (and Richmond's legacy anchor button) live
   here as icon-only buttons instead of crowding the top toolbar. Sits just left
   of where the editor panel opens. */
.pmt-cluster {
  position: fixed;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 8400;                 /* under the editor panel (8500), over the map */
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;          /* let gaps pass clicks through to the map */
}
.pmt-btn {
  pointer-events: auto;
  position: relative;            /* anchor for the slide-out .pmt-btn__label */
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 10px;
  color: #cfe0ef;
  background: rgba(13, 24, 36, .92);
  border: 1px solid rgba(120, 180, 220, .32);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.pmt-btn:hover { background: rgba(47, 182, 230, .22); border-color: rgba(47, 182, 230, .6); color: #eaf6fd; }
.pmt-btn.is-on { background: rgba(47, 182, 230, .28); border-color: rgba(47, 182, 230, .75); color: #eaf6fd; }
.pmt-btn svg { width: 20px; height: 20px; }
.pmt-btn--sm svg { width: 17px; height: 17px; }     /* critical-lots: slightly smaller glyph */
.pmt-btn[hidden] { display: none; }                  /* gated-off: actually hide (beats .pmt-btn display) */

/* Slide-out text label beside each icon. Collapsed (scaleX 0 from the icon's
   right edge) by default; the cluster's .is-revealing class expands it for the
   one-time onboarding reveal, then it retracts back into the icon. */
.pmt-btn__label {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left center;
  white-space: nowrap;
  padding: 7px 11px;
  border-radius: 9px;
  background: rgba(13, 24, 36, .95);
  border: 1px solid rgba(120, 180, 220, .35);
  color: #eaf3fb;
  font: 700 11.5px/1 var(--font, Charter, Georgia, serif);
  letter-spacing: .06em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: transform .32s cubic-bezier(.22,.61,.36,1), opacity .22s ease;
}
.pmt-cluster.is-revealing .pmt-btn__label {
  transform: translateY(-50%) scaleX(1);
  opacity: 1;
}
/* Stagger button labels for a marquee-like cascade (up to 4 buttons). */
.pmt-cluster.is-revealing .pmt-btn:nth-child(2) .pmt-btn__label { transition-delay: .08s; }
.pmt-cluster.is-revealing .pmt-btn:nth-child(3) .pmt-btn__label { transition-delay: .16s; }
.pmt-cluster.is-revealing .pmt-btn:nth-child(4) .pmt-btn__label { transition-delay: .24s; }

/* ── Admin-tools flyout panel ────────────────────────────────────────────────
   Triggered by the Admin Tools or Edit cluster buttons. Positioned fixed just
   right of the .pmt-cluster column (left:60px), dark-glass look matching the
   .pm-panel family. z-index 8600 floats above both the cluster (8400) and the
   editor panel (8500). Hidden by default; shown via .is-open on the element. */
.pmt-admin-flyout {
  position: fixed;
  top: 50%;
  left: 60px;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left center;
  z-index: 8600;
  min-width: 176px;
  max-width: calc(100vw - 80px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 6px;
  background: rgba(13, 24, 36, .96);
  border: 1px solid rgba(120, 180, 220, .3);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: transform .22s cubic-bezier(.22,.61,.36,1), opacity .18s ease;
}
.pmt-admin-flyout.is-open {
  transform: translateY(-50%) scaleX(1);
  opacity: 1;
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .pmt-admin-flyout,
  .pmt-admin-flyout.is-open {
    transition: opacity .18s ease;
    transform: translateY(-50%) scaleX(1);  /* skip the scale animation */
  }
  .pmt-admin-flyout { opacity: 0; pointer-events: none; }
  .pmt-admin-flyout.is-open { opacity: 1; pointer-events: auto; }
}

.pmt-admin-flyout__item {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 9px 11px;
  font: 600 12.5px/1 var(--font, Charter, Georgia, serif);
  color: #cfe0ef;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  letter-spacing: .02em;
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.pmt-admin-flyout__item svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  opacity: .8;
}
.pmt-admin-flyout__item:hover,
.pmt-admin-flyout__item:focus-visible {
  background: rgba(47, 182, 230, .18);
  border-color: rgba(47, 182, 230, .5);
  color: #eaf6fd;
  outline: none;
}
.pmt-admin-flyout__item:hover svg,
.pmt-admin-flyout__item:focus-visible svg { opacity: 1; }

/* Danger-tinted variant for destructive admin actions */
.pmt-admin-flyout__item--danger { color: #ffc9c9; }
.pmt-admin-flyout__item--danger:hover,
.pmt-admin-flyout__item--danger:focus-visible {
  background: rgba(214, 69, 69, .18);
  border-color: rgba(214, 69, 69, .5);
  color: #ffc9c9;
}

/* Small muted caption line below a flyout item's label */
.pmt-admin-flyout__sub {
  display: block;
  margin-top: 2px;
  font: 400 10.5px/1.3 var(--font, Charter, Georgia, serif);
  color: #7a9ab4;
  letter-spacing: 0;
}

/* Thin separator between flyout item groups */
.pmt-admin-flyout__sep {
  height: 1px;
  background: rgba(120, 180, 220, .18);
  margin: 3px 4px;
  border: 0;
}

/* ── Editor panel ─────────────────────────────────────────────────────────── */
/* Docked to the LEFT edge, vertically centred. The right edge is occupied by the
   parcel-detail drawer/dock + the layers control on every viewer, so a top-right
   panel collided with the dock; the centre-left band is reliably clear (top-left
   has zoom + the selection chip, bottom-left has search). */
.pm-panel {
  position: fixed;
  top: 50%;
  left: 60px;                 /* just right of the .pmt-cluster icon buttons */
  transform: translateY(-50%);
  z-index: 8500;
  width: 312px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  color: #e7eff7;
  font: 13px/1.45 var(--font, Charter, Georgia, serif);
  background: rgba(13, 24, 36, .94);
  border: 1px solid rgba(120, 180, 220, .28);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}
.pm-panel[hidden] { display: none; }
/* If both an Anchor panel and a Critical Lots panel are open, sit the critical
   one just right of the anchor panel so they don't perfectly overlap. */
.pm-panel--critical_lot { left: 60px; margin-top: 30px; }   /* same column as anchor; nudged down so both-open headers stay visible */

.pm-panel__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  border-bottom: 1px solid rgba(120, 180, 220, .2);
  background: rgba(20, 34, 50, .7);
}
.pm-panel__title {
  flex: 1;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
}
.pm-panel__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #9fb6cc;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 6px;
}
.pm-panel__close:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.pm-panel__body {
  padding: 12px 13px;
  overflow-y: auto;
}

.pm-panel__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.pm-panel__row label { color: #cfe0ef; }

.pm-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
}
.pm-toggle-label input { accent-color: #2fb6e6; width: 15px; height: 15px; }

.pm-panel__hr {
  border: 0;
  border-top: 1px solid rgba(120, 180, 220, .18);
  margin: 12px 0;
}

.pm-panel__hint {
  color: #8ba2b8;
  font-size: 12px;
  margin: 0 0 4px;
}
.pm-panel__parcel {
  font-weight: 700;
  color: #7fd0f5;
  font-variant-numeric: tabular-nums;
}

.pm-field { margin-bottom: 11px; }
.pm-field > span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #8ba2b8;
  margin-bottom: 4px;
}
.pm-field input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 9px;
  color: #eaf3fb;
  background: rgba(8, 16, 26, .8);
  border: 1px solid rgba(120, 180, 220, .3);
  border-radius: 7px;
  font: inherit;
}
.pm-field input[type="text"]:focus {
  outline: none;
  border-color: #2fb6e6;
  box-shadow: 0 0 0 2px rgba(47, 182, 230, .25);
}

.pm-image-pick {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}
.pm-preview {
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  background: rgba(8, 16, 26, .8) center/cover no-repeat;
  border: 1px solid rgba(120, 180, 220, .3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5d748a;
  font-size: 11px;
  text-align: center;
  overflow: hidden;
}
.pm-image-pick__col { flex: 1; min-width: 0; }
.pm-image-pick__col p { margin: 0 0 7px; color: #8ba2b8; font-size: 11.5px; }

.pm-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  font: 600 12.5px/1 var(--font, Charter, Georgia, serif);
  color: #eaf3fb;
  background: rgba(47, 182, 230, .18);
  border: 1px solid rgba(47, 182, 230, .55);
  border-radius: 8px;
  cursor: pointer;
}
.pm-btn:hover { background: rgba(47, 182, 230, .3); }
.pm-btn:disabled { opacity: .5; cursor: not-allowed; }
.pm-btn--primary {
  width: 100%;
  background: #1f9fd1;
  border-color: #1f9fd1;
  color: #06131d;
  margin-top: 4px;
}
.pm-btn--primary:hover { background: #2fb6e6; }
.pm-btn--danger {
  background: rgba(214, 69, 69, .16);
  border-color: rgba(214, 69, 69, .55);
  color: #ffc9c9;
}
.pm-btn--danger:hover { background: rgba(214, 69, 69, .3); }
.pm-btn--ghost {
  background: transparent;
  border-color: rgba(120, 180, 220, .35);
  color: #cfe0ef;
}
.pm-btn--ghost:hover { background: rgba(255, 255, 255, .06); }

.pm-actions { display: flex; gap: 8px; margin-top: 4px; }
.pm-actions .pm-btn { flex: 1; }

.pm-existing {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 9px;
  border-radius: 9px;
  background: rgba(8, 16, 26, .55);
  border: 1px solid rgba(120, 180, 220, .18);
  margin-bottom: 11px;
}
.pm-existing__thumb {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #13202e center/cover no-repeat;
  border: 2px solid #fff;
}
.pm-existing__meta { min-width: 0; }
.pm-existing__meta b { display: block; color: #eaf3fb; }
.pm-existing__meta small { color: #8ba2b8; }

.pm-count {
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px solid rgba(120, 180, 220, .15);
  color: #8ba2b8;
  font-size: 11.5px;
}

input.pm-file-hidden { display: none; }

/* ── Landscape-phone guard ────────────────────────────────────────────────────
   On short landscape phones (height ≤ 500 px) the vertical column of cluster
   buttons overflows off screen. Reposition to the bottom edge and switch to a
   horizontal row so all buttons stay reachable. The pm-panel mobile block is NOT
   touched here (it handles its own breakpoints). */
@media (max-height: 500px) and (orientation: landscape) {
  .pmt-cluster {
    top: auto;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
  }
  /* Flyout opens upward in landscape to avoid falling off the bottom edge */
  .pmt-admin-flyout {
    top: auto;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%) scaleY(0);
    transform-origin: bottom center;
  }
  .pmt-admin-flyout.is-open {
    transform: translateX(-50%) scaleY(1);
  }
  @media (prefers-reduced-motion: reduce) {
    .pmt-admin-flyout,
    .pmt-admin-flyout.is-open {
      transform: translateX(-50%) scaleY(1);
    }
    .pmt-admin-flyout { opacity: 0; pointer-events: none; }
    .pmt-admin-flyout.is-open { opacity: 1; pointer-events: auto; }
  }
}
