/**
 * WP Content Map - Frontend Map Styles
 * Generic, customizable map styling.
 */

/* ── Map Container ── */
.wcm-map {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.wcm-map-container {
    margin-bottom: 30px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

/* ── Error State ── */
.wcm-map-error {
    color: #d63638;
    padding: 10px;
    border: 1px solid #d63638;
    border-radius: 3px;
    background-color: rgba(214, 54, 56, 0.1);
}

/* ── Leaflet Popup Overrides ── */
.leaflet-popup {
    max-width: none !important;
}

.leaflet-popup-content-wrapper {
    width: 280px !important;
    max-width: none !important;
    padding: 0 !important;
    border-radius: 6px;
}

.leaflet-popup-content {
    width: 280px !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.leaflet-popup-tip-container {
    left: 50% !important;
    margin-left: -10px !important;
}

.leaflet-container a.leaflet-popup-close-button {
    right: 10px;
    top: 10px;
    color: #999;
    font-size: 20px;
}

/* ── Leaflet Container Background ── */
.leaflet-container {
    background: #D4DADC !important;
}

.wcm-map-container {
    overflow: hidden !important;
    background: #ffffff !important;
}

/* ── Cluster Styles ── */
.wcm-cluster {
    background: transparent !important;
    border: none !important;
}

.wcm-cluster-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-align: center;
}

.wcm-cluster-small .wcm-cluster-inner {
    background-color: rgba(110, 204, 57, 0.85);
}

.wcm-cluster-medium .wcm-cluster-inner {
    background-color: rgba(240, 194, 12, 0.85);
}

.wcm-cluster-large .wcm-cluster-inner {
    background-color: rgba(241, 128, 23, 0.85);
}

.wcm-cluster .wcm-cluster-inner span {
    line-height: 1;
}

/* ── Mobile Info Panel ── */
.wcm-mobile-info {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    max-height: 300px;
    overflow-y: auto;
}

.wcm-mobile-info-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f6f6f6;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 18px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    color: #666;
}

/* ── Popup Background Fix ── */
.leaflet-popup-content-wrapper {
    background: white !important;
}

.leaflet-popup {
    opacity: 1 !important;
}

/* ── Mobile Styles ── */
@media screen and (max-width: 767px) {
    .leaflet-container {
        background: #D4DADC !important;
    }

    .wcm-map-container {
        overflow: hidden !important;
        background: #D4DADC !important;
    }

    .leaflet-control-zoom {
        margin-top: 60px !important;
    }

    .leaflet-control-attribution {
        display: none !important;
    }

    .leaflet-popup {
        display: block !important;
    }

    .leaflet-popup-content-wrapper {
        width: 240px !important;
        padding: 12px !important;
        overflow: hidden !important;
    }

    .leaflet-popup-content {
        width: 100% !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    .leaflet-container a.leaflet-popup-close-button {
        right: 5px !important;
        top: 5px !important;
    }
}

/* Hide layer control */
.leaflet-control-layers {
    display: none !important;
}
