/**
 * PlotMaps — Public Map Styles
 * Leaflet popup overrides, lot markers, legend, watermark
 */

/* ── Leaflet Popup Overrides ── */

.leaflet-popup-content-wrapper {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.5;
    font-size: 14px;
    color: #334155;
}

.leaflet-popup-tip {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.leaflet-popup-close-button {
    top: 8px !important;
    right: 8px !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 18px !important;
    color: #94a3b8 !important;
    background: #f1f5f9 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    line-height: 28px !important;
    padding: 0 !important;
    text-align: center;
    transition: all 0.15s ease;
}

.leaflet-popup-close-button:hover {
    color: #1e293b !important;
    background: #e2e8f0 !important;
}


/* ── Lot Markers ── */

.lot-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.lot-marker:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(255, 255, 255, 0.9);
    z-index: 1000 !important;
}


/* ── Popup Internal Styles ── */

.pm-popup {
    min-width: 240px;
    max-width: 300px;
}

.pm-popup-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.pm-popup-lot {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 2px;
}

.pm-popup-address {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.pm-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 8px;
}

.pm-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pm-popup-details {
    padding: 12px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}

.pm-popup-detail-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 1px;
}

.pm-popup-detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.pm-popup-detail-value.pm-price {
    font-size: 16px;
    font-weight: 800;
    color: #10b981;
}

.pm-popup-links {
    padding: 12px 20px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid #f1f5f9;
}

.pm-popup-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #ecfdf5;
    color: #047857;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid #a7f3d0;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.pm-popup-link:hover {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.pm-popup-link:hover svg {
    color: #fff;
}

.pm-popup-link svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}


/* ── Legend ── */

.pm-legend {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 8px 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
}

.pm-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.pm-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8), 0 1px 3px rgba(0, 0, 0, 0.15);
}

.pm-legend-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    border-radius: 12px;
    padding: 8px 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}


/* ── Watermark ── */

.pm-watermark {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 8px;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}


/* ── Mobile Responsive ── */

@media (max-width: 767px) {
    .pm-popup {
        min-width: 200px;
        max-width: 260px;
    }

    .pm-popup-header {
        padding: 12px 14px 10px;
    }

    .pm-popup-address {
        font-size: 14px;
    }

    .pm-popup-details {
        padding: 10px 14px;
        gap: 8px 12px;
    }

    .pm-popup-detail-value {
        font-size: 13px;
    }

    .pm-popup-detail-value.pm-price {
        font-size: 14px;
    }

    .pm-popup-links {
        padding: 10px 14px 14px;
    }

    .pm-popup-link {
        padding: 5px 12px;
        font-size: 11px;
    }

    /* Collapsible legend on mobile */
    .pm-legend {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        position: absolute;
        bottom: 40px;
        left: 0;
    }

    .pm-legend.pm-legend-open {
        display: flex;
    }

    .pm-legend-toggle {
        display: block;
    }

    .lot-marker {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}
