 
/* Map Styles for Enhanced MDS Sparkesykkel Aggregator */

/* Map Container */
.map-section {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    height: 600px;
}

.map-container {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    position: relative;
}

/* Map Controls */
.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
}

.map-control-btn {
    background: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 120px;
    font-size: 0.9rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.map-control-btn:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.map-control-btn:active {
    transform: translateY(0);
}

.map-control-btn.active {
    background: #667eea;
    color: white;
}

/* Custom Google Maps Controls */
.custom-map-control-button {
    background: white;
    border: none;
    padding: 0.8rem 1rem;
    margin: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.custom-map-control-button:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

/* Vehicle Info Popup */
.vehicle-info-popup {
    max-width: 320px;
    padding: 1.2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.vehicle-info-popup h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vehicle-info-popup .provider-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.vehicle-info-popup p {
    margin-bottom: 0.8rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vehicle-info-popup .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.vehicle-info-popup .info-row:last-child {
    border-bottom: none;
}

.vehicle-info-popup .info-label {
    color: #666;
    font-weight: 500;
}

.vehicle-info-popup .info-value {
    color: #333;
    font-weight: 600;
}

.vehicle-info-popup .battery-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vehicle-info-popup .battery-bar {
    width: 60px;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.vehicle-info-popup .battery-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444 0%, #ffaa00 50%, #44ff44 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.vehicle-info-popup .pricing-summary {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.vehicle-info-popup .pricing-summary h4 {
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 1rem;
}

.vehicle-info-popup .price-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.vehicle-info-popup .total-estimate {
    border-top: 1px solid #ddd;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    font-weight: bold;
    color: #4CAF50;
}

.vehicle-info-popup .btn-compare,
.vehicle-info-popup .btn-reserve,
.vehicle-info-popup .btn-route {
    display: inline-block;
    padding: 0.7rem 1.2rem;
    margin: 0.3rem 0.3rem 0 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.vehicle-info-popup .btn-compare {
    background: #2196F3;
    color: white;
}

.vehicle-info-popup .btn-compare:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

.vehicle-info-popup .btn-reserve {
    background: #4CAF50;
    color: white;
}

.vehicle-info-popup .btn-reserve:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.vehicle-info-popup .btn-route {
    background: #ff9800;
    color: white;
}

.vehicle-info-popup .btn-route:hover {
    background: #f57c00;
    transform: translateY(-1px);
}

.vehicle-info-popup .favorite-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.2rem;
    border-radius: 50%;
}

.vehicle-info-popup .favorite-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.1);
}

.vehicle-info-popup .favorite-btn.favorited {
    color: #ffd700;
}

/* Vehicle Markers */
.vehicle-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid white;
    position: relative;
}

.vehicle-marker:hover {
    transform: scale(1.2);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.vehicle-marker.tier {
    background: #00D4AA;
}

.vehicle-marker.bird {
    background: #000000;
}

.vehicle-marker.lime {
    background: #00FF00;
    color: black;
}

.vehicle-marker.voi {
    background: #E60012;
}

.vehicle-marker.ryde {
    background: #FF6B35;
}

/* Battery Indicator on Markers */
.vehicle-marker::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    border: 1px solid white;
}

.vehicle-marker.high-battery::after {
    background: #4CAF50;
}

.vehicle-marker.medium-battery::after {
    background: #FF9800;
}

.vehicle-marker.low-battery::after {
    background: #f44336;
}

/* Cluster Markers */
.cluster-marker {
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid white;
}

.cluster-marker:hover {
    transform: scale(1.1);
    background: #5a67d8;
}

.cluster-marker.small {
    width: 35px;
    height: 35px;
    font-size: 12px;
}

.cluster-marker.medium {
    width: 45px;
    height: 45px;
    font-size: 14px;
}

.cluster-marker.large {
    width: 55px;
    height: 55px;
    font-size: 16px;
}

/* User Location Marker */
.user-location-marker {
    width: 20px;
    height: 20px;
    background: #2196F3;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(33, 150, 243, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
    }
}

/* Heatmap Toggle */
.heatmap-active {
    background: #ff6b6b !important;
    color: white !important;
}

/* Map Loading State */
.map-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    border-radius: 12px;
}

.map-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.map-loading .loading-text {
    color: #666;
    font-weight: 600;
}

/* Route Display */
.route-info {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: white;
    padding: 1.2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 320px;
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.route-info h4 {
    margin-bottom: 0.8rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.route-info p {
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.route-info .route-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.route-info .route-stat {
    text-align: center;
}

.route-info .route-stat-value {
    display: block;
    font-weight: bold;
    color: #2196F3;
    font-size: 1.1rem;
}

.route-info .route-stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.2rem;
}

.route-info .close-route {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    padding: 0.2rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.route-info .close-route:hover {
    background: #f0f0f0;
    color: #333;
}

/* Traffic Layer Indicator */
.traffic-active {
    background: #ff9800 !important;
    color: white !important;
}

/* Map Error State */
.map-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
    z-index: 2000;
}

.map-error .error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.map-error h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.map-error p {
    margin-bottom: 1rem;
}

.map-error .retry-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.map-error .retry-btn:hover {
    background: #5a67d8;
}

/* Responsive Map Design */
@media (max-width: 768px) {
    .map-section {
        height: 400px;
    }
    
    .map-controls {
        top: 5px;
        right: 5px;
        flex-direction: row;
        flex-wrap: wrap;
        max-width: calc(100% - 10px);
    }
    
    .map-control-btn {
        padding: 0.6rem;
        min-width: auto;
        font-size: 0.8rem;
        flex: 1;
        min-width: 80px;
    }
    
    .vehicle-info-popup {
        max-width: 280px;
        padding: 1rem;
    }
    
    .vehicle-info-popup h3 {
        font-size: 1.1rem;
    }
    
    .route-info {
        bottom: 5px;
        left: 5px;
        padding: 1rem;
        max-width: calc(100% - 10px);
    }
    
    .route-info .route-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vehicle-marker {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
    
    .cluster-marker.small {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }
    
    .cluster-marker.medium {
        width: 38px;
        height: 38px;
        font-size: 13px;
    }
    
    .cluster-marker.large {
        width: 46px;
        height: 46px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .map-section {
        height: 300px;
        border-radius: 8px;
    }
    
    .map-controls {
        gap: 0.3rem;
    }
    
    .map-control-btn {
        padding: 0.5rem;
        font-size: 0.7rem;
        min-width: 70px;
    }
    
    .vehicle-info-popup {
        max-width: 250px;
        padding: 0.8rem;
    }
    
    .vehicle-info-popup .btn-compare,
    .vehicle-info-popup .btn-reserve,
    .vehicle-info-popup .btn-route {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        margin: 0.2rem 0.2rem 0 0;
    }
    
    .route-info {
        padding: 0.8rem;
    }
    
    .route-info .route-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .vehicle-marker {
        width: 24px;
        height: 24px;
        font-size: 9px;
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .vehicle-marker,
    .cluster-marker {
        border-width: 1px;
    }
    
    .vehicle-marker::after {
        height: 3px;
        width: 20px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .map-control-btn,
    .custom-map-control-button {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .map-control-btn:hover,
    .custom-map-control-button:hover {
        background: #4a5568;
    }
    
    .vehicle-info-popup {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .vehicle-info-popup h3 {
        color: #e2e8f0;
    }
    
    .vehicle-info-popup .info-label {
        color: #a0aec0;
    }
    
    .vehicle-info-popup .info-value {
        color: #e2e8f0;
    }
    
    .vehicle-info-popup .pricing-summary {
        background: #4a5568;
    }
    
    .route-info {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .route-info h4 {
        color: #e2e8f0;
    }
    
    .route-info p {
        color: #a0aec0;
    }
    
    .map-loading {
        background: rgba(45, 55, 72, 0.95);
    }
    
    .map-loading .loading-text {
        color: #a0aec0;
    }
}

/* Print Styles */
@media print {
    .map-controls,
    .route-info {
        display: none;
    }
    
    .map-section {
        height: 400px;
        break-inside: avoid;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .vehicle-marker,
    .cluster-marker,
    .user-location-marker {
        animation: none;
        transition: none;
    }
    
    .vehicle-marker:hover,
    .cluster-marker:hover {
        transform: none;
    }
}

/* Focus styles for keyboard navigation */
.map-control-btn:focus,
.vehicle-info-popup button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Map Themes */
.map-container.satellite-view {
    /* Satellite view specific styles */
}

.map-container.terrain-view {
    /* Terrain view specific styles */
}

/* Custom Map Styles for Google Maps */
.gm-style .gm-style-iw-c {
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.gm-style .gm-style-iw-t::after {
    display: none;
}

.gm-style .gm-style-iw-d {
    overflow: hidden !important;
}

/* Custom scrollbar for info windows */
.gm-style .gm-style-iw-d::-webkit-scrollbar {
    width: 6px;
}

.gm-style .gm-style-iw-d::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.gm-style .gm-style-iw-d::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}
