/**
 * La Jonquera Traffic Map - Styles
 */

.lajonquera-traffic-map-container {
    position: relative;
    margin: 2rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#lajonquera-map {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* Légende */
.lajonquera-map-legend {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 200px;
}

.lajonquera-map-legend h4 {
    margin: 0 0 0.75rem 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 13px;
}

.legend-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 0.5rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

/* Info box */
.lajonquera-map-info {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lajonquera-map-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

#last-update {
    font-weight: 600;
    color: #333;
}

#refresh-traffic {
    background: #0073aa;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

#refresh-traffic:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

#refresh-traffic:active {
    transform: translateY(0);
}

/* Popups personnalisés */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 1rem;
    font-size: 14px;
}

.popup-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 0.5rem;
    color: #0073aa;
}

.popup-info {
    margin: 0.25rem 0;
    color: #666;
}

.popup-info strong {
    color: #333;
}

.traffic-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.traffic-status.good {
    background: #d4edda;
    color: #155724;
}

.traffic-status.moderate {
    background: #fff3cd;
    color: #856404;
}

.traffic-status.heavy {
    background: #f8d7da;
    color: #721c24;
}

/* Markers personnalisés */
.custom-marker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
}

.marker-border {
    background: #0073aa;
}

.marker-gas {
    background: #28a745;
}

.marker-parking {
    background: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
    .lajonquera-traffic-map-container {
        padding: 0.5rem;
    }

    .lajonquera-map-legend {
        position: static;
        margin-bottom: 1rem;
        width: 100%;
    }

    .lajonquera-map-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    #refresh-traffic {
        width: 100%;
    }

    #lajonquera-map {
        min-height: 300px;
    }
}

/* Animation de chargement */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.map-loading::after {
    content: "";
    display: block;
    width: 40px;
    height: 40px;
    margin: 1rem auto 0;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Contrôles de la carte */
.leaflet-control-zoom a {
    background-color: #0073aa !important;
    color: white !important;
}

.leaflet-control-zoom a:hover {
    background-color: #005a87 !important;
}

/* Route overlay */
.route-line {
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.8;
}

.route-line:hover {
    stroke-width: 6;
    opacity: 1;
}
