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

body {
    font-family: 'Roboto', sans-serif;
    background: #f7fcfc;
    color: #2C2C2C; /* Dark grey text */
    padding: 20px;
    min-width: 900px; /* Minimum width - forces horizontal scroll on small screens */
}

.container {
    max-width: 1400px;
    min-width: 900px; /* Match body min-width */
    margin: 0 auto;
    width: 100%;
}

h1 {
    color: #2C2C2C; /* Dark grey */
    margin-bottom: 10px;
    font-size: 2rem;
}

.subtitle {
    color: #555; /* Medium grey */
    margin-bottom: 30px;
    font-size: 0.9rem;
}

#chart {
    background: #FFFFFF; /* White */
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    width: 100%;
    min-width: 860px; /* Ensure chart area has minimum width */
    overflow-x: auto; /* Allow horizontal scroll if needed */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.axis {
    color: #666;
}

.axis-label {
    fill: #555; /* Dark grey */
    font-size: 12px;
}

.axis-title {
    fill: #2C2C2C; /* Dark grey */
    font-size: 14px;
    font-weight: 500;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    padding: 15px;
    background: #FFFFFF; /* White */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.2s;
}

.legend-item.hidden {
    opacity: 0.3;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
}

.legend-label {
    font-size: 0.9rem;
    color: #2C2C2C; /* Dark grey */
}

.tooltip {
    position: absolute;
    background: rgba(255, 255, 255, 0.98); /* White with slight transparency */
    border: 1px solid #CCC;
    border-radius: 5px;
    padding: 10px;
    pointer-events: none;
    font-size: 12px;
    color: #2C2C2C; /* Dark grey text */
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tooltip.visible {
    opacity: 1;
}

.tooltip-date {
    font-weight: bold;
    color: #2C2C2C; /* Dark grey */
    margin-bottom: 5px;
}

.tooltip-item {
    margin: 3px 0;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    color: #2C2C2C;
}

.tooltip-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
    margin-right: 5px;
}

.loading {
    text-align: center;
    padding: 50px;
    color: #555; /* Medium grey */
}

.info-box {
    background: #FFFFFF; /* White */
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    font-size: 0.85rem;
    color: #2C2C2C; /* Dark grey */
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.area {
    opacity: 0.8;
    transition: opacity 0.2s;
}

.area:hover {
    opacity: 1;
}

.grid-line {
    stroke: #DDD; /* Light grey grid lines */
    stroke-width: 1;
}

/* Responsive adjustments */
@media (max-width: 920px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    #chart {
        padding: 15px;
    }
    
    .legend {
        font-size: 0.85rem;
        gap: 15px;
    }
}

/* Ensure SVG scales properly */
#chart svg {
    max-width: 100%;
    height: auto;
}
