.interactive-map-container {
    position: relative;
    width: 100%;
    background-color: $dark-gray;
    border-radius: $border-radius-lg;
    box-shadow: $box-shadow-lg;
    margin-bottom: $spacing-xl;
    overflow: hidden;
}

.map-wrapper {
    position: relative;
    width: 100%;
    height: 700px;
    overflow: hidden;
    
    @media (max-width: $breakpoint-md) {
        height: 500px;
    }
    
    @media (max-width: $breakpoint-sm) {
        height: 400px;
    }
}

.map-container {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-origin: 0 0;
    cursor: move;
    transition: transform 0.1s ease-out;
}

#map-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#map-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; // Allow clicks to pass through to markers
}

.map-controls {
    position: absolute;
    bottom: $spacing-md;
    right: $spacing-md;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: $spacing-xs;
}

.map-control-btn {
    width: 40px;
    height: 40px;
    background-color: rgba($dark-gray-lighter, 0.8);
    color: $white;
    border: none;
    border-radius: $border-radius-md;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: $transition-base;
    
    &:hover {
        background-color: $primary-color;
    }
}

.map-legend {
    position: absolute;
    top: $spacing-md;
    right: $spacing-md;
    background-color: rgba($dark-gray-lighter, 0.9);
    border-radius: $border-radius-md;
    padding: $spacing-md;
    z-index: 5;
    max-width: 200px;
    
    h4 {
        color: $white;
        margin-top: 0;
        margin-bottom: $spacing-sm;
        font-size: 14px;
    }
    
    .legend-item {
        display: flex;
        align-items: center;
        margin-bottom: $spacing-xs;
        
        span {
            color: $light-gray;
            font-size: 12px;
        }
        
        .marker {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            margin-right: $spacing-sm;
        }
        
        .government {
            background-color: $primary-color;
        }
        
        .commercial {
            background-color: $success;
        }
        
        .residential {
            background-color: $info;
        }
        
        .illegal {
            background-color: $danger;
        }
        
        .public {
            background-color: $warning;
        }
    }
}

.map-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: $transition-base;
    box-shadow: 0 0 0 2px $dark-gray;
    z-index: 2;
    pointer-events: auto; // Make markers clickable
    
    &:hover {
        transform: translate(-50%, -50%) scale(1.2);
        z-index: 3;
    }
    
    &.government {
        background-color: $primary-color;
    }
    
    &.commercial {
        background-color: $success;
    }
    
    &.residential {
        background-color: $info;
    }
    
    &.illegal {
        background-color: $danger;
    }
    
    &.public {
        background-color: $warning;
    }
    
    &.active {
        transform: translate(-50%, -50%) scale(1.3);
        z-index: 4;
        
        &::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 30px;
            height: 30px;
            border-radius: 50%;
            border: 2px solid currentColor;
            animation: pulse 1.5s infinite;
        }
    }
}

.marker-label {
    position: absolute;
    transform: translate(-50%, 10px);
    font-size: 12px;
    color: $white;
    background-color: rgba($dark-gray, 0.7);
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.7);
    
    .map-marker:hover + & {
        opacity: 1;
    }
}

.map-info-panel {
    position: absolute;
    left: $spacing-md;
    top: $spacing-md;
    width: 300px;
    background-color: rgba($dark-gray-lighter, 0.95);
    border-radius: $border-radius-md;
    box-shadow: $box-shadow-md;
    z-index: 10;
    transform: translateX(-110%);
    transition: transform 0.3s ease;
    
    &.active {
        transform: translateX(0);
    }
    
    .info-header {
        padding: $spacing-sm $spacing-md;
        border-bottom: 1px solid $dark-gray-lightest;
        display: flex;
        justify-content: space-between;
        align-items: center;
        
        h3 {
            margin: 0;
            color: $white;
            font-size: 18px;
        }
        
        .close-btn {
            background: none;
            border: none;
            color: $light-gray;
            font-size: 20px;
            cursor: pointer;
            
            &:hover {
                color: $white;
            }
        }
    }
    
    .info-content {
        padding: $spacing-md;
        
        p {
            color: $light-gray;
            margin-top: 0;
            margin-bottom: $spacing-md;
        }
    }
    
    #location-details {
        .detail-section {
            margin-bottom: $spacing-md;
            
            h4 {
                color: $white;
                margin-top: 0;
                margin-bottom: $spacing-xs;
                font-size: 14px;
            }
            
            ul {
                margin: 0;
                padding-left: $spacing-md;
                
                li {
                    color: $light-gray;
                    font-size: 14px;
                }
            }
        }
    }
}

// Coordinate display for debugging
.coordinates-display {
    position: absolute;
    bottom: $spacing-md;
    left: $spacing-md;
    background-color: rgba($dark-gray-lighter, 0.8);
    color: $white;
    padding: $spacing-xs $spacing-sm;
    border-radius: $border-radius-sm;
    font-size: 0.8rem;
    z-index: 5;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

@media (max-width: $breakpoint-md) {
    .map-info-panel {
        width: calc(100% - #{$spacing-md * 2});
        max-width: 300px;
    }
}