/* ===================== PLOT MAP PLUGIN - FRONTEND STYLES ===================== */

.map-wrapper {
    max-width: 1099px;
    margin: 20px auto;
    position: relative;
   /* background: #f4f6f9;
    overflow: hidden;*/
}

/* ---- SVG ---- */
#svgMap {
    width: 100%;
    height: auto;
    transform-origin: 0 0;
    cursor: grab;
    cursor: -webkit-grab;
    transition: transform 0.25s ease;
    touch-action: none !important;
    -webkit-tap-highlight-color: transparent;
    display: block;
}
#svgMap:active { cursor: grabbing; cursor: -webkit-grabbing; }

/* ---- Controls ---- */
.plot-map-admin + * .controls,
.controls {
    position: fixed;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 999;
}
.controls button {
    display: block;
    padding: 8px 14px;
    border: none;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    font-size: 16px;
    font-weight: 700;
    transition: background .15s;
}
.controls button:hover { background: #f0f0f0; }

/* ---- Legend ---- */
.legend {
    position: fixed;
    bottom: 15px;
    left: 15px;
    background: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 3px 10px rgba(0,0,0,.18);
    z-index: 999;
}
.legend-item {
    display: flex;
    align-items: center;
    margin: 4px 0;
    cursor: pointer;
    user-select: none;
}
.legend-item .box {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ---- Plot polygons ---- */
.plot {
    stroke: rgba(0,0,0,.2);
    stroke-width: 1;
    cursor: pointer;
    transition: filter .15s;
}
.plot:hover       { filter: brightness(1.15); }
.selected         { stroke: #000; stroke-width: 2; filter: drop-shadow(0 0 6px rgba(0,0,0,.5)); }

/* ---- Blink ---- */
@keyframes blinkEffect {
    0%   { opacity: 1;  stroke-width: 2; }
    50%  { opacity: .3; stroke-width: 5; }
    100% { opacity: 1;  stroke-width: 2; }
}
.blink { animation: blinkEffect .5s ease infinite; stroke: yellow !important; }

/* ---- Tooltip ---- */
.tooltip {
    position: absolute;
    background: #333;
    color: #fff;
    padding: 10px 12px;
    font-size: 12px;
    border-radius: 8px;
    pointer-events: none;
    display: none;
    z-index: 10000;
    box-shadow: 0 6px 20px rgba(0,0,0,.2);
    line-height: 1.5;
    min-width: 120px;
}

/* ---- Popup overlay ---- */
.popup {
    display: none;
    position: fixed;
    z-index: 100001;
    inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}
.popup-content {
    background: #fff;
    width: 90%;
    max-width: 380px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
    overflow: hidden;
    animation: popupScale .3s ease-out;
}
@keyframes popupScale {
    from { transform: scale(.7); opacity: 0; }
    to   { transform: scale(1);  opacity: 1; }
}
.popup-header {
    padding: 20px 24px;
    background: #fdfdfd;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.popup-header h3 { margin: 0; font-size: 20px; color: #1a1a1a; font-weight: 800; }
.close { font-size: 24px; color: #999; cursor: pointer; line-height: 1; transition: color .2s; }
.close:hover { color: #ff4757; }
.popup-body { padding: 24px; }
#plotMapDetails p {
    display: flex;
    justify-content: space-between;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f7f7f7;
    font-size: 15px;
    color: #444;
}
#plotMapDetails p b   { color: #888; font-weight: 500; }
#plotMapDetails p span { font-weight: 600; color: #111; }

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 18px;
}
.status-Available { background: #e3f9e5; color: #1f9d55; }
.status-Booked    { background: #e1f5fe; color: #0288d1; }
.status-Sold      { background: #ffebee; color: #d32f2f; }
.status-Resale    { background: #fff4e5; color: #ff9800; }

/* Footer & enquiry button */
.popup-footer { padding: 0 24px 24px; }
.btn-enquiry {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg,#0984e3,#0056b3);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(9,132,227,.2);
    transition: all .3s ease;
}
.btn-enquiry:hover  { transform: translateY(-2px); box-shadow: 0 15px 25px rgba(9,132,227,.3); filter: brightness(1.1); }
.btn-enquiry:active { transform: translateY(0); }

/* Mobile */
@media (max-width: 768px) {
    .controls button.rest { font-size: 12px; }
    .popup { align-items: flex-end; }
    .popup-content {
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        animation: slideUp .4s cubic-bezier(.16,1,.3,1);
        max-height: 88vh;
        overflow-y: auto;
    }
    @keyframes slideUp {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .map-wrapper {
        max-width: 100% !important;
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        position: fixed !important;
        inset: 0 !important;
        overflow: hidden !important;
    }
    #svgMap { width: 100% !important; height: 100% !important; transition: none !important; }
}
