/* reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base layout */
body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    color: #333;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header section - ancorato in alto */
.header {
    flex-shrink: 0;
    padding: 10px;
    background-color: #f0f0f0;
    z-index: 10;
    text-align: left; /* Align text to the left */
    position: absolute; /* Position in the top-left corner */
    top: 0;
    left: 0;
    width: auto;
}

h1 {
    margin: 0;
    font-size: 24px;
    color: #444;
}

p {
    margin-top: 5px;
    font-size: 14px;
    color: #666;
}

#svg-container {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0;
    margin-top: 90px;
}

/* SVG styles */
svg {
    display: block;
}

/* Tooltip styles */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    z-index: 1000;
    transition: opacity 0.2s ease;
}

/* Tooltip content styles */
.tooltip-driver {
    font-weight: bold;
    margin-bottom: 4px;
}

.tooltip-metric {
    font-weight: bold;
    margin-bottom: 2px;
}

.tooltip-value {
    font-size: 16px;
    font-weight: bold;
}

/* MOBILE RESPONSIVE STYLES - SOLO DA TELEFONO */
@media (max-width: 768px) {
    body {
        overflow-x: auto;
        overflow-y: hidden;
    }

    .header {
        padding: 15px 10px;
    }

    h1 {
        font-size: 24px;
    }

    p {
        font-size: 14px;
    }

    #svg-container {
        overflow-x: auto;
        overflow-y: hidden;
        padding: 5px;
        align-items: center;
        justify-content: flex-start;
    }

    svg {
        min-width: 600px; /* Forza una larghezza minima per evitare compressione */
    }

    .tooltip {
        font-size: 12px;
        padding: 8px 12px;
        max-width: 180px;
    }

    .tooltip-driver {
        font-size: 13px;
    }

    .tooltip-value {
        font-size: 14px;
    }
}

/* PICCOLI SCHERMI */
@media (max-width: 480px) {
    .header {
        padding: 10px 5px;
    }

    h1 {
        font-size: 20px;
    }

    p {
        font-size: 12px;
    }

    svg {
        min-width: 500px;
    }

    .tooltip {
        font-size: 11px;
        padding: 6px 10px;
        max-width: 150px;
    }

    .tooltip-driver {
        font-size: 12px;
    }

    .tooltip-value {
        font-size: 13px;
    }
}