/* Chart title styling now handled by universal h3 in reset.css */

/* Horizontal Legend Styles */
.horizontal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
    padding: 16px 0;
}

.legend-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem;
    padding-right: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-sizing: border-box;
    user-select: none;
}

.legend-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.legend-chip.enabled {
    background-color: var(--chip-color);
    color: var(--primary-bg);
    border: none;
}

.legend-chip.disabled {
    background-color: transparent;
    color: var(--secondary-font-color);
    border: 1px solid var(--chip-color);
}

.legend-chip-icon {
    width: 1.2vh;
    height: 1.2vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
}

.legend-chip-label {
    font-weight: normal;
    line-height: 1;
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .horizontal-legend {
        gap: 8px;
        padding: 12px 0;
    }
    
    .legend-chip {
        font-size: 9px;
        padding: 6px 5px;
    }
    
    .legend-chip-icon {
        width: 7px;
        height: 7px;
        font-size: 7px;
    }
    
    .legend-chip-label {
        font-size: 9px;
    }
}

/* Accessibility */
.legend-chip:focus {
    outline: 2px solid var(--label-color);
    outline-offset: 2px;
}

.legend-chip:active {
    transform: translateY(0);
}

/* Hide existing legend container when horizontal legend is active */
.chart-container.horizontal-legend-active #legend {
    display: none;
}