/**
 * Contact Map Styles
 * Styles for the Google Maps integration in the contact form
 */

.address-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.address-suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.address-suggestion-item:hover {
    background-color: #f8f9fa;
}

.address-suggestion-item:last-child {
    border-bottom: none;
}

.address-suggestion-item .main-text {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    font-size: 14px;
}

.address-suggestion-item .secondary-text {
    font-size: 12px;
    color: #666;
    line-height: 1.3;
}

#contact-map {
    min-height: 400px;
    max-height: 400px;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    position: relative !important;
    z-index: 1 !important;
}

#contact-map .leaflet-container {
    height: 400px !important;
    width: 100% !important;
    position: relative !important;
}

.leaflet-container {
    position: relative !important;
}

.leaflet-pane,
.leaflet-map-pane {
    position: absolute !important;
}

/* Map container styles */
.map-container {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Address input wrapper */
.address-input-wrapper {
    position: relative;
}

/* Loading state for map */
.map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.map-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #e3e3e3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Map info window custom styles */
.gm-style .gm-style-iw-c {
    padding: 0 !important;
    border-radius: 8px !important;
}

.gm-style .gm-style-iw-d {
    overflow: hidden !important;
}

.gm-style .gm-style-iw-t::after {
    background: linear-gradient(45deg, rgba(255,255,255,1) 50%, rgba(255,255,255,0) 51%, rgba(255,255,255,0) 100%) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #contact-map {
        min-height: 300px;
    }

    .map-container {
        height: 300px;
    }

    .address-suggestions {
        max-height: 150px;
    }

    .address-suggestion-item {
        padding: 8px 12px;
    }

    .address-suggestion-item .main-text {
        font-size: 13px;
    }

    .address-suggestion-item .secondary-text {
        font-size: 11px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .address-suggestions {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .address-suggestion-item {
        border-bottom-color: #4a5568;
    }

    .address-suggestion-item:hover {
        background-color: #4a5568;
    }

    .address-suggestion-item .main-text {
        color: #e2e8f0;
    }

    .address-suggestion-item .secondary-text {
        color: #a0aec0;
    }

    .map-loading {
        background-color: #2d3748;
    }
}
