/* Shared map overlay styles (admin editor + public viewer) */

/* Elements with their own display value must still respect the hidden attribute. */
[hidden] { display: none !important; }

:root {
    --pm-brand: #0E8A6A;
    --pm-ink: #172436;
    --pm-muted: #64748B;
    --pm-line: #E4E8EE;
    --pm-available: #0E8A6A;
    --pm-fewLeft: #D99A1E;
    --pm-reserved: #D99A1E;
    --pm-soldOut: #98A3B2;
    --pm-sold: #98A3B2;
    --pm-comingSoon: #6D5BD0;
}

.pm-masterplan {
    position: absolute;
    transform-origin: center center;
    pointer-events: none;
    user-select: none;
    max-width: none !important;
    image-rendering: auto;
}

/* Editing frame drawn above the map, rotated together with the plan */
.pm-plan-frame { position: absolute; transform-origin: center center; display: none; }
.pm-plan-hit { position: absolute; inset: 0; cursor: move; outline: 2px dashed var(--pm-brand); outline-offset: 0; }
.pm-plan-corner {
    position: absolute; width: 14px; height: 14px; background: #fff; border: 3px solid var(--pm-brand);
    border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); cursor: nwse-resize; touch-action: none;
}
.pm-plan-corner.tl { left: -7px; top: -7px; }
.pm-plan-corner.tr { right: -7px; top: -7px; cursor: nesw-resize; }
.pm-plan-corner.br { right: -7px; bottom: -7px; }
.pm-plan-corner.bl { left: -7px; bottom: -7px; cursor: nesw-resize; }
/* Side handles: stretch the plan in one direction (the opposite side stays fixed) */
.pm-plan-edge {
    position: absolute; background: #fff; border: 3px solid var(--pm-brand); border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .35); touch-action: none; z-index: 1;
}
.pm-plan-edge.t, .pm-plan-edge.b { left: 50%; width: 30px; height: 12px; margin-left: -15px; cursor: ns-resize; }
.pm-plan-edge.t { top: -6px; }
.pm-plan-edge.b { bottom: -6px; }
.pm-plan-edge.l, .pm-plan-edge.r { top: 50%; width: 12px; height: 30px; margin-top: -15px; cursor: ew-resize; }
.pm-plan-edge.l { left: -6px; }
.pm-plan-edge.r { right: -6px; }

/* Free-corners fit: outline and pins positioned on map pixels */
.pm-corner-frame { position: absolute; left: 0; top: 0; width: 0; height: 0; display: none; pointer-events: none; }
.pm-corner-outline { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.pm-corner-outline polygon { fill: none; stroke: var(--pm-brand); stroke-width: 2; stroke-dasharray: 8 5; }
.pm-corner-frame.is-invalid .pm-corner-outline polygon { stroke: #DC2626; stroke-dasharray: none; stroke-width: 3; }
.pm-corner-pin {
    position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; display: grid; place-items: center;
    background: rgba(255, 255, 255, .35); border: 3px solid var(--pm-brand); box-shadow: 0 1px 5px rgba(0, 0, 0, .45);
    cursor: move; touch-action: none; pointer-events: auto; color: var(--pm-brand); font: 800 12px/1 sans-serif;
}
.pm-corner-pin::after { content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #DC2626; }
.pm-corner-pin span { position: absolute; top: -18px; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.pm-corner-frame.is-invalid .pm-corner-pin { border-color: #DC2626; color: #DC2626; }
.pm-corner-frame .pm-plan-center { pointer-events: auto; }
.pm-plan-stem { position: absolute; left: 50%; top: -44px; width: 2px; height: 44px; background: var(--pm-brand); transform: translateX(-50%); pointer-events: none; }
.pm-plan-rotate {
    position: absolute; left: 50%; top: -60px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%;
    background: var(--pm-brand); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); cursor: grab; touch-action: none;
}
.pm-plan-center {
    position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%;
    border: 2px solid var(--pm-brand); background: color-mix(in srgb, var(--pm-brand) 18%, transparent); cursor: move; touch-action: none;
}
.pm-plan-center::before, .pm-plan-center::after { content: ""; position: absolute; background: var(--pm-brand); }
.pm-plan-center::before { left: 50%; top: -8px; bottom: -8px; width: 2px; margin-left: -1px; }
.pm-plan-center::after { top: 50%; left: -8px; right: -8px; height: 2px; margin-top: -1px; }
body.pm-dragging, body.pm-dragging * { cursor: grabbing !important; user-select: none; }

/* Building code labels */
.pm-labels { position: absolute; left: 0; top: 0; }
.pm-labels-hidden { display: none; }
.pm-label {
    position: absolute; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 999px; border: 1px solid rgba(15, 23, 42, .15); background: #fff; color: var(--pm-ink);
    font: 800 12px/18px Inter, "Segoe UI", system-ui, sans-serif; white-space: nowrap; cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.pm-label:hover { border-color: var(--pm-brand); }
.pm-label.is-selected { background: var(--pm-brand); color: #fff; border-color: var(--pm-brand); }
.pm-label.is-dimmed { opacity: .55; }
.is-drawing .pm-labels { pointer-events: none; }

.pm-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pm-st-available { background: var(--pm-available); }
.pm-st-fewLeft { background: var(--pm-fewLeft); }
.pm-st-reserved { background: var(--pm-reserved); }
.pm-st-soldOut, .pm-st-sold { background: var(--pm-sold); }
.pm-st-comingSoon { background: var(--pm-comingSoon); }

.pm-map-direction-labels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; color: #0B1F3A; }
.pm-map-direction-labels > span { display: grid; gap: 1px; text-align: center; }
.pm-map-direction-labels b { font: 600 13px/1.4 "IBM Plex Sans Arabic", sans-serif; }
.pm-map-direction-labels small { color: #45586D; font-size: 10px; line-height: 1.3; direction: ltr; }
.pm-editor-compass { position: absolute; z-index: 3; top: 76px; inset-inline-end: 12px; width: 152px; padding: 10px; border: 1px solid var(--pm-line); border-radius: 8px; background: #fff; box-shadow: 0 3px 12px rgba(11,31,58,.12); pointer-events: none; }
.pm-label.pm-editor-building-label { padding: 1px 6px; font-size: 10px; line-height: 16px; gap: 3px; }
.pm-label.pm-editor-building-label .pm-dot { width: 6px; height: 6px; }
