.traffic-visualization-container {
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.chart-header {
    background-color: var(--card-background);
    padding: 1rem;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.traffic-road {
    position: relative;
    height: 300px;
    background-color: #555;
    width: 100%;
    overflow: hidden;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Mittlinje som delar vägen i två huvuddelar */
.center-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: white;
    transform: translateY(-50%);
    z-index: 1;
}

/* Dashed styling för mittlinjen */
.center-line {
    background: repeating-linear-gradient(
        to right,
        white,
        white 15px,
        transparent 15px,
        transparent 30px
    );
}

/* Osynliga körfältsgränser (för utvecklingsreferens, kan göras synliga under utveckling) */
.lane-divider {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.2);
    z-index: 1;
}

/* 5 körfält för norrgående trafik (nedre halvan) */
.lane-divider.north-1 { top: 60%; }
.lane-divider.north-2 { top: 70%; }
.lane-divider.north-3 { top: 80%; }
.lane-divider.north-4 { top: 90%; }

/* 5 körfält för södergående trafik (övre halvan) */
.lane-divider.south-1 { top: 10%; }
.lane-divider.south-2 { top: 20%; }
.lane-divider.south-3 { top: 30%; }
.lane-divider.south-4 { top: 40%; }

.road-marker {
    position: absolute;
    top: 50%;
    width: 30px;
    height: 4px;
    background-color: white;
    transform: translateY(-50%);
    z-index: 1;
}

.traffic-vehicle {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    z-index: 2;
    transition: left 0.1s linear;
}

.traffic-vehicle .vehicle-speed {
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    margin-top: 2px;
}

/* Fordonstyp styling */
.traffic-vehicle.pedestrian {
    color: #f5f5f5;
}

.traffic-vehicle.bicycle {
    color: #3498db;
}

.traffic-vehicle.motorcycle {
    color: #9b59b6;
}

.traffic-vehicle.car {
    color: #2ecc71;
}

.traffic-vehicle.bus {
    color: #f1c40f;
}

/* Hastighetsstyling */
.traffic-vehicle.high-speed {
    color: #e74c3c;
}

.traffic-vehicle.high-speed .vehicle-speed {
    background-color: #e74c3c;
}

.traffic-vehicle.low-speed .vehicle-speed {
    background-color: #7f8c8d;
}

.traffic-vehicle.normal-speed .vehicle-speed {
    background-color: #2ecc71;
}

/* Realtidsindikator */
.realtime-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 5px 10px;
    background-color: rgba(26, 188, 156, 0.7);
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.7;
    }
}

@media (max-width: 768px) {
    .traffic-road {
        height: 200px;
    }
    
    .traffic-vehicle {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    
    .traffic-vehicle .vehicle-speed {
        font-size: 0.6rem;
    }
}