/* Maps Component - Styles basés sur wp-transport-booking */

.maps-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
}

.map-container {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #e5e7eb;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 250, 252, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #f59e0b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-message {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 12px 16px;
    color: #dc2626;
    font-size: 14px;
    display: none;
    align-items: center;
    gap: 8px;
    z-index: 5;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.error-message.show {
    display: flex;
    animation: slideDown 0.3s ease-out;
}

.error-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.error-text {
    flex: 1;
    line-height: 1.4;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.route-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 8px 8px;
    padding: 12px 16px;
    display: none;
    z-index: 5;
}

.route-info.show {
    display: block;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item .icon {
    font-size: 16px;
    width: 20px;
    flex-shrink: 0;
}

.distance-info,
.duration-info {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.custom-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

.marker-start {
    background: #10b981;
}

.marker-end {
    background: #ef4444;
}

.marker-waypoint {
    background: #f59e0b;
    color: #1f2937;
}

.custom-info-window {
    max-width: 250px;
    padding: 8px;
}

.custom-info-window .title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
    font-size: 14px;
}

.custom-info-window .address {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.4;
}

.maps-container.calculating .map-container {
    filter: brightness(0.9);
}

.maps-container.error .map-container {
    filter: grayscale(0.5);
}

.gm-style .gm-style-iw-c {
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.gm-style .gm-style-iw-t::after {
    background: white;
}

.gm-style-cc {
    display: none !important;
}

.gm-bundled-control {
    margin: 8px !important;
}

.gm-bundled-control div {
    border-radius: 4px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

@keyframes markerDrop {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.marker-animation {
    animation: markerDrop 0.5s ease-out;
}

@media (max-width: 768px) {
    .map-container {
        height: 300px;
    }
    
    .route-info {
        bottom: 8px;
        left: 8px;
        right: 8px;
        padding: 8px 12px;
    }
    
    .error-message {
        top: 8px;
        left: 8px;
        right: 8px;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .info-item {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .map-container {
        height: 250px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .info-item .icon {
        align-self: flex-start;
    }
}

@media (prefers-color-scheme: dark) {
    .maps-container {
        background: #1f2937;
    }
    
    .map-container {
        background: #374151;
    }
    
    .loading-overlay {
        background: rgba(31, 41, 55, 0.9);
    }
    
    .route-info {
        background: #1f2937;
        border-color: #374151;
        color: #f3f4f6;
    }
    
    .error-message {
        background: #7f1d1d;
        border-color: #dc2626;
        color: #fca5a5;
    }
    
    .info-item {
        color: #e5e7eb;
    }
}

.maps-container:focus-within {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

.map-container,
.route-info,
.error-message,
.loading-overlay {
    transition: all 0.3s ease;
}

.maps-container * {
    box-sizing: border-box;
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .custom-marker {
        border-width: 1px;
    }
}