/* Map Wrapper */
.zemelapio-map-wrapper {
    position: relative;
    width: 100%;
}

.zemelapio-leaflet-map {
    height: 500px;
    width: 100%;
}

/* Custom Pin Marker */
.custom-category-marker {
    background: none !important;
    border: none !important;
    overflow: visible !important;
}

.marker-pin {
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    position: absolute;
    transform: rotate(-45deg);
    -webkit-transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -15px 0 0 -15px;
    display: block;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.marker-pin i {
    transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    color: white;
    font-size: 12px;
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 0;
    left: 0;
}

/* Big Bottom Legend */
.zemelapio-map-legend-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px; /* More space between items */
    padding: 30px 20px; /* Much bigger padding */
    background: #E8E8E8; /* Requested light gray */
    border-radius: 0 0 8px 8px;
    font-family: inherit;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Responsive Mobile Adjustments */
@media (max-width: 768px) {
    .zemelapio-leaflet-map {
        height: 300px;
    }

    .zemelapio-map-legend-bottom {
        gap: 12px 4%; 
        padding: 20px 10px;
        justify-content: flex-start;
    }

    .legend-item-bottom {
        flex: 0 0 48%; /* Strictly 2 columns */
        justify-content: flex-start;
        padding: 4px 0;
        min-width: 0;
    }

    .legend-icon {
        width: 24px;
        height: 24px;
        margin-right: 10px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    .legend-icon i, .legend-icon svg {
        font-size: 12px;
        width: 12px;
        height: 12px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        line-height: 1 !important;
        margin: 0 !important;
    }

    .legend-text {
        font-size: 11px;
        white-space: normal;
        line-height: 1.2;
        text-align: left;
    }

    .main-project-icon, .main-project-img {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 350px) {
    .legend-text {
        font-size: 9px;
    }
    .legend-item-bottom {
        min-width: 45%;
    }
}

.legend-item-bottom {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    padding: 5px 10px;
    border-radius: 30px;
}

.legend-item-bottom:hover {
    background: rgba(0,0,0,0.05);
}

.legend-item-bottom.active {
    background: rgba(0,0,0,0.1);
}

.legend-icon {
    width: 36px; /* Larger icons in legend */
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.legend-icon i {
    font-size: 15px; /* Bigger icons */
}

.legend-text {
    font-size: 16px; /* Bigger text */
    color: #1a332a; /* Dark green/black text */
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Main Project Marker */
.main-project-marker {
    background: none;
    border: none;
}

.main-project-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.main-project-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    z-index: 2;
}

.main-project-img {
    width: 40px;
    height: 40px;
    z-index: 2;
    position: relative;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 202, 44, 0.4);
    border-radius: 50%;
    z-index: 1;
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.marker-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    border: 1px solid #ccc;
    z-index: 3;
}

/* Fallback Marker Shadow */
.main-project-fallback {
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
}

.marker-label-fallback {
    background: white !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    font-weight: bold !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2) !important;
    padding: 2px 8px !important;
    font-size: 12px !important;
}

.popup-distance {
    font-size: 11px;
    color: #666;
    font-style: italic;
}
