/* Chart Enhancement Styles */

/* Make chart containers more prominent */
.fi-wi-chart {
    position: relative;
    overflow: hidden;
    height: 100% !important;
    max-height: 320px !important;
}

/* Fix pie chart sizing - Aggressive constraints */
.fi-wi-chart canvas {
    max-width: 100% !important;
    max-height: 200px !important;
    width: auto !important;
    height: auto !important;
}

/* Specific fix for pie charts - Much smaller size */
.fi-wi-chart[data-chart-type="doughnut"] canvas,
.fi-wi-chart[data-chart-type="pie"] canvas {
    max-width: 200px !important;
    max-height: 200px !important;
    margin: 0 auto !important;
}

/* Container height constraint for chart sections */
.h-80 {
    max-height: 320px !important;
    overflow: hidden !important;
}

/* Hide grid lines and scales for pie charts */
.fi-wi-chart[data-chart-type="doughnut"] .chartjs-axis,
.fi-wi-chart[data-chart-type="pie"] .chartjs-axis {
    display: none !important;
}

/* Style for chart legends to be more prominent */
.fi-wi-chart canvas + div {
    margin-top: 1rem;
    font-weight: 600;
}

/* Custom tooltip styles */
.chartjs-tooltip {
    background: rgba(0, 0, 0, 0.9) !important;
    border-radius: 8px !important;
    padding: 12px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Chart title enhancements */
.fi-wi-chart .fi-wi-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: rgb(55, 65, 81);
}

/* Dark mode adjustments */
.dark .fi-wi-chart .fi-wi-header h3 {
    color: rgb(229, 231, 235);
}

/* Hover effects for interactive elements */
.fi-wi-chart:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease-in-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Chart container padding */
.fi-wi-chart .fi-wi-content {
    padding: 1.5rem;
}

/* Legend styling improvements */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(249, 250, 251, 0.5);
    border-radius: 0.5rem;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(55, 65, 81);
}

.chart-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Dark mode legend */
.dark .chart-legend {
    background: rgba(31, 41, 55, 0.5);
}

.dark .chart-legend-item {
    color: rgb(229, 231, 235);
}

/* Responsive chart sizing */
@media (max-width: 768px) {
    .fi-wi-chart .fi-wi-content {
        padding: 1rem;
    }

    .chart-legend {
        flex-direction: column;
        align-items: center;
    }
}

/* Additional aggressive chart size overrides */
.fi-wi-chart {
    max-height: 280px !important;
}

.fi-wi-chart canvas {
    max-width: 200px !important;
    max-height: 180px !important;
}

/* Force smaller legend text */
.fi-wi-chart .chartjs-legend {
    font-size: 8px !important;
}

.fi-wi-chart .chartjs-legend-item {
    font-size: 8px !important;
    margin: 2px !important;
}

/* Override any conflicting chart.js styles */
.chartjs-render-monitor {
    max-height: 180px !important;
}
