/* ============================================================
   chart.css – Volunteer & Impact Statistics Charts
   Used by: index.html
   ============================================================ */

/* Container that holds multiple charts side by side */
.chart-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-bottom: 40px;
}

/* ── Bar Chart ────────────────────────────────────────────── */
.bar-chart {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    flex: 1 1 220px;
    max-width: 280px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.bar-chart h3 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bar-chart .bar-track {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    height: 160px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    margin-bottom: 12px;
}

.bar {
    background: linear-gradient(180deg, #4ade80, #16a34a);
    width: 100%;
    height: 0%;
    border-radius: 6px 6px 0 0;
    transition: height 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.bar-chart span {
    color: #e2e8f0;
    font-size: 0.9rem;
}

/* ── Pie / Donut Chart ────────────────────────────────────── */
.pie-chart {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    flex: 1 1 220px;
    max-width: 280px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.pie-chart h3 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* CSS-only conic-gradient donut */
.pie {
    position: relative;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    margin: 0 auto 16px;
    background: conic-gradient(
        #3b82f6 0% calc(var(--primary-pct, 40) * 1%),
        #f97316 calc(var(--primary-pct, 40) * 1%) 100%
    );
    transition: background 0.6s ease;
}

/* Donut hole */
.pie::after {
    content: "";
    position: absolute;
    inset: 22%;
    background: #1e293b;
    border-radius: 50%;
}

/* Legend */
.legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.item {
    display: flex;
    align-items: center;
    font-size: 0.82rem;
    color: #cbd5e1;
    gap: 8px;
}

.item span.swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.item:nth-child(1) span.swatch { background-color: #3b82f6; }
.item:nth-child(2) span.swatch { background-color: #f97316; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .chart-container {
        flex-direction: column;
        align-items: center;
    }

    .bar-chart,
    .pie-chart {
        max-width: 90%;
        width: 90%;
    }
}
