/* ==================== GOOGLE MAPS LOCATION PICKER STYLES ==================== */

/* Main container for the map picker */
.google-maps-picker-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    background-color: #ffffff;
    min-height: 300px;
    flex: 1;
}

/* Coordinates display header */
.map-coordinates-header {
    padding: 12px 16px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.map-coordinates-label {
    font-weight: 600;
    font-size: 14px;
    color: #424242;
    white-space: nowrap;
}

.map-coordinates-value {
    font-size: 14px;
    color: #616161;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 0.5px;
}

/* Map container - Always set explicit height for Google Maps */
#google-map-picker-container {
    width: 100%;
    height: 200px;
    background-color: #e0e0e0;
    position: relative;
}

/* Responsive map container */
.map-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Loading state for map */
.map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: #f5f5f5;
    color: #757575;
    font-size: 14px;
}

.map-loading::before {
    content: '';
    width: 24px;
    height: 24px;
    margin-right: 8px;
    border: 3px solid #e0e0e0;
    border-top-color: #1976d2;
    border-radius: 50%;
    animation: map-spinner 0.8s linear infinite;
}

@keyframes map-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Map error state */
.map-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: #ffebee;
    color: #c62828;
    font-size: 14px;
    padding: 16px;
    text-align: center;
}

/* Custom map controls */
.map-custom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-control-button {
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    padding: 8px 12px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    color: #333;
    transition: all 0.2s ease;
}

.map-control-button:hover {
    background-color: #f5f5f5;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.map-control-button:active {
    background-color: #e0e0e0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Info text below map */
.map-info-text {
    padding: 12px 16px;
    background-color: #e3f2fd;
    border-top: 1px solid #90caf9;
    font-size: 13px;
    color: #1565c0;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.map-info-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    #google-map-picker-container {
        height: 300px;
    }

    .map-coordinates-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 12px;
    }

    .map-coordinates-label,
    .map-coordinates-value {
        font-size: 13px;
    }

    .map-info-text {
        font-size: 12px;
        padding: 10px 12px;
    }
}

@media screen and (max-width: 480px) {
    #google-map-picker-container {
        height: 250px;
    }

    .google-maps-picker-container {
        border-radius: 0;
    }

    .map-coordinates-header {
        padding: 8px 12px;
    }

    .map-coordinates-label,
    .map-coordinates-value {
        font-size: 12px;
    }
}

/* Custom marker pulse animation (optional) */
@keyframes marker-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(25, 118, 210, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(25, 118, 210, 0);
    }
}

/* Map container in dialog */
.dialog-edit .google-maps-picker-container {
    margin-bottom: 16px;
}

/* Ensure map renders properly */
.google-maps-picker-container * {
    box-sizing: border-box;
}

/* Hide default Google Maps UI elements if needed */
.gm-style .gm-style-cc {
    display: none !important;
}

.gm-style a[href^="https://maps.google.com/maps"] {
    display: none !important;
}

/* Custom fullscreen button styling */
.gm-fullscreen-control {
    right: 10px !important;
    top: 10px !important;
}

/* Coordinate display variants */
.map-coordinates-compact {
    display: flex;
    gap: 16px;
    align-items: center;
}

.map-coordinates-compact .coordinate-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.map-coordinates-compact .coordinate-label {
    font-size: 11px;
    color: #757575;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.map-coordinates-compact .coordinate-value {
    font-size: 14px;
    color: #212121;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 500;
}

/* Location search box (if you add search functionality later) */
.map-search-container {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    width: 90%;
    max-width: 400px;
}

.map-search-input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    background-color: #ffffff;
}

.map-search-input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

/* Current location button */
.map-current-location-btn {
    position: absolute;
    bottom: 120px;
    right: 10px;
    z-index: 1;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.map-current-location-btn:hover {
    background-color: #f5f5f5;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.map-current-location-btn svg {
    width: 20px;
    height: 20px;
    fill: #1976d2;
}

/* Accessibility improvements */
.map-control-button:focus,
.map-search-input:focus,
.map-current-location-btn:focus {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .google-maps-picker-container {
        page-break-inside: avoid;
    }

    .map-custom-controls,
    .map-current-location-btn {
        display: none;
    }
}