/* Chart Styles - Pure CSS Charts */

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #2c3e50;
}

/* Bar Chart Styles */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 10px;
    padding: 10px 0;
    position: relative;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bar-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.bar-fill {
    width: 60%;
    min-height: 5px;
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: barGrow 0.8s ease-out forwards;
    transform-origin: bottom;
}

@keyframes barGrow {
    from {
        transform: scaleY(0);
    }
    to {
        transform: scaleY(1);
    }
}

.bar-fill:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
}

.bar-label {
    font-size: 13px;
    color: #666;
    text-align: center;
    font-weight: 500;
}

.bar-value {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

/* Pie Chart Styles */
.pie-chart-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.pie-chart {
    flex-shrink: 0;
}

.pie-slice {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.pie-slice:hover {
    opacity: 0.8;
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 200px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-label {
    flex: 1;
    color: #333;
}

.legend-value {
    font-weight: 600;
    color: #2c3e50;
}

/* Line Chart Styles */
.line-chart {
    width: 100%;
    overflow: hidden;
}

.line-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: lineDraw 1.5s ease-out forwards;
}

@keyframes lineDraw {
    to {
        stroke-dashoffset: 0;
    }
}

.line-area {
    opacity: 0;
    animation: areaFade 1s ease-out 0.5s forwards;
}

@keyframes areaFade {
    to {
        opacity: 0.1;
    }
}

.line-point {
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    animation: pointPop 0.5s ease-out 1s forwards;
}

@keyframes pointPop {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.line-point:hover {
    r: 7;
}

/* Progress Bar Styles */
.progress-bar-wrapper {
    width: 100%;
}

.progress-bar {
    width: 100%;
    background: #e0e0e0;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill.animate {
    animation: progressGrow 1.5s ease-out forwards;
    width: 0 !important;
}

@keyframes progressGrow {
    to {
        width: var(--target-width, 0%) !important;
    }
}

.progress-label {
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.progress-text {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* Chart Tooltip */
.chart-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
    transform: translate(-50%, -100%);
    margin-top: -10px;
}

.chart-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 0, 0, 0.85);
}

.pie-tooltip {
    position: fixed;
    transform: translate(-50%, -120%);
}

/* Dark Mode Styles for Charts */
body.dark-mode .chart-container {
    background: #2d2d2d;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.dark-mode .chart-title {
    color: #e0e0e0;
}

body.dark-mode .bar-label,
body.dark-mode .progress-text,
body.dark-mode .legend-label {
    color: #b0b0b0;
}

body.dark-mode .bar-value,
body.dark-mode .legend-value {
    color: #e0e0e0;
}

body.dark-mode .progress-bar {
    background: #404040;
}

body.dark-mode .line-chart text {
    fill: #999 !important;
}

body.dark-mode .line-chart line {
    stroke: #404040 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chart-container {
        padding: 15px;
    }

    .chart-title {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .pie-chart-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .bar-chart {
        gap: 5px;
    }

    .bar-fill {
        width: 80%;
    }

    .bar-label {
        font-size: 11px;
    }

    .bar-value {
        font-size: 12px;
    }

    .legend-item {
        font-size: 13px;
    }

    .pie-legend {
        min-width: auto;
        width: 100%;
    }
}

/* Chart Grid Layout */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Special styles for small charts */
.chart-container.small {
    padding: 15px;
}

.chart-container.small .chart-title {
    font-size: 16px;
    margin-bottom: 15px;
}

.chart-container.small .bar-chart {
    height: 150px !important;
}

