#map {
    height: 100%;
    min-height: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
    position: relative;
}

/* Ensure map container takes full height */
.mh #map {
    height: 100% !important;
    min-height: 500px !important;
}

/* Fix the attribution box styling */
.mapboxgl-ctrl-attrib {
    background: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    font-size: 10px !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    margin: 8px !important;
    backdrop-filter: blur(10px);
    border: none !important;
}

.mapboxgl-ctrl-attrib a {
    color: #ffffff !important;
    text-decoration: none !important;
}

.mapboxgl-ctrl-attrib a:hover {
    color: #3498db !important;
}

.mapboxgl-ctrl-attrib-button {
    background: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    backdrop-filter: blur(10px);
}

.mapboxgl-ctrl-attrib-button:hover {
    background: rgba(0, 0, 0, 0.8) !important;
}

/* Enhanced navigation controls */
.mapboxgl-ctrl-group {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 8px !important;
    box-shadow: 0 3px 12px rgba(0,0,0,0.12) !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    backdrop-filter: blur(15px);
}

.mapboxgl-ctrl-group button {
    background: transparent !important;
    border: none !important;
    color: #333 !important;
    font-size: 16px !important;
    width: 36px !important;
    height: 36px !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.mapboxgl-ctrl-group button:hover {
    background: rgba(52, 152, 219, 0.1) !important;
    color: #3498db !important;
    transform: scale(1.05) !important;
}

/* Improved popup styling */
.mapboxgl-popup {
    max-width: 320px;
}

.mapboxgl-popup-content {
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12) !important;
    padding: 0 !important;
    border: none !important;
    background: white !important;
    overflow: hidden !important;
}

.mapboxgl-popup-close-button {
    font-size: 20px !important;
    padding: 8px !important;
    color: #666 !important;
    right: 12px !important;
    top: 12px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

.mapboxgl-popup-close-button:hover {
    background: rgba(231, 76, 60, 0.1) !important;
    color: #e74c3c !important;
    transform: scale(1.1) !important;
}

.mapboxgl-popup-tip {
    border-top-color: white !important;
    border-bottom-color: white !important;
}

.custom-marker:hover {
    transform: scale(1.15) !important;
    transition: transform 0.3s ease !important;
}

/* Responsive design */
@media (max-width: 992px) {
    #map {
        min-height: 400px !important;
    }
    
    .mh #map {
        min-height: 400px !important;
    }
}

@media (max-width: 768px) {
    #map {
        height: 350px !important;
        min-height: 350px !important;
        border-radius: 6px;
    }
    
    .mh #map {
        height: 350px !important;
        min-height: 350px !important;
    }
    
    .mapboxgl-ctrl-attrib {
        font-size: 9px !important;
        padding: 2px 6px !important;
        margin: 4px !important;
    }
    
    .mapboxgl-ctrl-group {
        margin: 8px !important;
    }
    
    .mapboxgl-ctrl-group button {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
    }
}

/* Make sure map fills the container properly */
.col-md-6.mh {
    display: flex;
    flex-direction: column;
}

.col-md-6.mh #map {
    flex: 1;
}