/**
 * Leaflet Modern — Visual & UX Upgrades for AdForest OpenStreetMap
 */

/* ===================================================================
   Tile Enhancement — subtle contrast/saturation boost
   =================================================================== */

.leaflet-tile-pane {
    filter: contrast(1.04) saturate(1.03);
}

/* ===================================================================
   Label Overlay Pane — crisp rendering, no pointer interference
   =================================================================== */

.leaflet-labels-pane {
    pointer-events: none;
    opacity: 0.25;
    filter: saturate(0) contrast(5) brightness(1.4);
}

.leaflet-labels-pane img {
    image-rendering: auto;
}

/* ===================================================================
   Cluster Styling  (classes referenced in search-map.php)
   =================================================================== */

.pulsing-cluster {
    background: none !important;
    border: none !important;
}

.pulsing-cluster .custom-cluster {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    box-shadow: 0 2px 8px rgba(74, 144, 217, 0.45), 0 0 0 4px rgba(74, 144, 217, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.2s ease;
}

.pulsing-cluster .custom-cluster:hover {
    transform: scale(1.12);
}

.custom-cluster-icon {
    background: none !important;
    border: none !important;
}

/* ===================================================================
   Popup Styling — modern card look
   =================================================================== */

.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
    border: none;
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 14px 16px;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}

.leaflet-popup-tip-container {
    margin-top: -1px;
}

.leaflet-popup-tip {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
}

.leaflet-popup-close-button {
    font-size: 18px;
    color: #999;
    top: 8px !important;
    right: 10px !important;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.leaflet-popup-close-button:hover {
    color: #333;
    background-color: rgba(0, 0, 0, 0.05);
}

.price_container_map_popup {
    font-weight: 700;
    color: #e53935;
    margin: 4px 0;
}

/* ===================================================================
   Modern SVG Marker (detail pages — premium pin with gradient)
   =================================================================== */

.leaflet-modern-marker {
    background: none !important;
    border: none !important;
}

.leaflet-modern-marker::before {
    content: '';
    display: block;
    width: 32px;
    height: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 42'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='0%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23ef5350'/%3E%3Cstop offset='100%25' stop-color='%23c62828'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M16 0C7.16 0 0 7.16 0 16c0 12 16 26 16 26s16-14 16-26C32 7.16 24.84 0 16 0z' fill='url(%23g)'/%3E%3Ccircle cx='16' cy='15' r='6.5' fill='%23fff' opacity='0.95'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

/* Marker ground shadow (ellipse beneath the pin) */
.leaflet-modern-marker::after {
    content: '';
    display: block;
    width: 20px;
    height: 6px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.25) 0%, transparent 70%);
    margin: 0 auto;
    margin-top: -2px;
}

/* ===================================================================
   Controls — Zoom, Locate, Fullscreen
   =================================================================== */

.leaflet-bar {
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    overflow: hidden;
}

.leaflet-bar a {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    transition: background-color 0.15s ease, color 0.15s ease;
    color: #555;
}

.leaflet-bar a:last-child {
    border-bottom: none !important;
}

.leaflet-bar a:hover {
    background-color: #f5f5f5;
    color: #333;
}

.leaflet-control-zoom a {
    font-size: 18px;
    font-weight: 400;
    color: #555;
    width: 34px;
    height: 34px;
    line-height: 34px;
}

.leaflet-control-zoom a:hover {
    color: #222;
}

/* Locate button */
.leaflet-control-locate a {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #555;
    width: 34px;
    height: 34px;
}

.leaflet-control-locate a:hover {
    color: #4a90d9;
    background-color: #f5f5f5;
}

/* Fullscreen control */
.leaflet-control-fullscreen a {
    width: 34px;
    height: 34px;
    line-height: 34px;
    font-size: 16px;
}

/* Attribution — keep minimal */
.leaflet-control-attribution {
    font-size: 10px;
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.7) !important;
    padding: 2px 6px;
}

/* ===================================================================
   Search Control polish (L.Control.Search)
   =================================================================== */

.leaflet-control-search {
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    border: none !important;
}

.leaflet-control-search .search-input {
    border-radius: 8px;
    border: none;
    outline: none;
    font-size: 13px;
    padding: 6px 10px;
}

/* ===================================================================
   Responsive — Mobile touch targets
   =================================================================== */

@media (max-width: 767px) {
    .leaflet-control-zoom a,
    .leaflet-control-locate a,
    .leaflet-control-fullscreen a {
        width: 38px;
        height: 38px;
        line-height: 38px;
        font-size: 18px;
    }

    .leaflet-popup-content-wrapper {
        border-radius: 8px;
    }

    .leaflet-popup-content {
        margin: 10px 12px;
        font-size: 12px;
    }
}
