/* PIE CHART */
.stats-section {
    background-color: var(--white);
    padding: 4rem 0;
    position: relative;
    border-top: 1px solid rgba(175, 33, 104, 0.08);
    border-bottom: 1px solid rgba(175, 33, 104, 0.08);
}

.stats-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Chart container */
.chart-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    background: var(--white);
    max-width: 900px;
    margin: 0 auto;
    box-shadow: var(--shadow);
    border: 1px solid rgba(175, 33, 104, 0.253);
}

/* pie chart */
.pie-chart-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
}

.pie-chart {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    transform: rotate(-90deg);
    background: conic-gradient(var(--primary-dark) 0% 7.3%,
            var(--primary-medium) 7.3% 11.6%,
            var(--primary-light) 11.6% 16.8%,
            var(--accent-color) 16.8% 56.8%,
            #e67e22 56.8% 70.8%,
            #e74c3c 70.8% 74.8%,
            #f8f9fa 74.8% 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.pie-chart-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.center-text {
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
    margin: 0;
}

.center-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1;
    margin-bottom: 0.2rem;
}

/* LEGEND */
.legend-container {
    display: flex;
    flex-direction: column;
    /* gap: 1.2rem; */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    border: 1px solid rgba(175, 33, 104, 0.08);
    transition: all 0.2s ease;
    cursor: pointer;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-content {
    flex: 1;
}

.legend-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.legend-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    font-family: 'Segoe UI', sans-serif;
}

.legend-description {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
    margin: 0;
}

/* CORlors of legend */
.legend-suicide {
    background-color: var(--primary-dark);
}

.legend-plan {
    background-color: var(--primary-medium);
}

.legend-attempt {
    background-color: var(--primary-light);
}

.legend-overweight {
    background-color: var(--accent-color);
}

.legend-obesity {
    background-color: #e67e22;
}

.legend-diabetes {
    background-color: #e74c3c;
}

.legend-other {
    background-color: #f8f9fa;
}

/* TEXTO Explanatuon */
.stats-explanation {
    max-width: 900px;
    margin: 2.5rem auto 0;
    padding: 2rem;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.stats-explanation p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1.2rem;
    font-size: 1rem;
}

.stats-explanation p:last-child {
    margin-bottom: 0;
}

/* ANIMATIONS */
@keyframes sliceAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.pie-chart {
    animation: sliceAppear 1s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .chart-container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        padding: 2rem;
    }

    .pie-chart-wrapper {
        width: 250px;
        height: 250px;
    }

    .pie-chart-center {
        width: 90px;
        height: 90px;
    }
}

@media (max-width: 768px) {
    .stats-section {
        padding: 3rem 0;
    }

    .stats-container {
        padding: 0 1.5rem;
    }

    .stats-title {
        font-size: 1.6rem;
    }

    .pie-chart-wrapper {
        width: 220px;
        height: 220px;
    }

    .pie-chart-center {
        width: 80px;
        height: 80px;
    }

    .center-number {
        font-size: 1.2rem;
    }

    .center-text {
        font-size: 0.75rem;
    }

    .stats-explanation {
        padding: 1.5rem;
        margin-top: 2rem;
    }
}

@media (max-width: 480px) {
    .stats-container {
        padding: 0 1rem;
    }

    .chart-container {
        padding: 1.5rem;
    }

    .pie-chart-wrapper {
        width: 200px;
        height: 200px;
    }

    .pie-chart-center {
        width: 70px;
        height: 70px;
    }

    .center-number {
        font-size: 1rem;
    }

    .center-text {
        font-size: 0.7rem;
    }

    .legend-item {
        padding: 0.8rem 1rem;
    }

    .stats-explanation {
        padding: 1.2rem;
    }
}