/* ============================================================
   Statistics Pie Widget — statistics-pie.css
   ============================================================ */

/* Wrapper */
.spw-wrapper {
    display: block;
    box-sizing: border-box;
}

/* Inner flex container */
.spw-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 32px;
}

/* Layouts */
.spw-layout-horizontal         { flex-direction: row; }
.spw-layout-horizontal-reverse { flex-direction: row-reverse; }
.spw-layout-vertical           { flex-direction: column; align-items: center; }
.spw-layout-vertical-reverse   { flex-direction: column-reverse; align-items: center; }

/* Canvas wrap */
.spw-canvas-wrap {
    position: relative;
    flex-shrink: 0;
    width: 260px;
    height: 260px;
}

.spw-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Legend */
.spw-legend-wrap {
    flex: 1;
    min-width: 160px;
}

.spw-legend-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.spw-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.spw-legend-item:hover {
    opacity: 0.8;
}

/* Dot shapes */
.spw-legend-dot {
    display: inline-block;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.spw-legend-item:hover .spw-legend-dot {
    transform: scale(1.2);
}

/* Square */
.spw-dot-square {
    border-radius: 2px !important;
}

/* Rounded rectangle */
.spw-dot-rounded {
    border-radius: 4px !important;
    width: 24px !important;
    height: 10px !important;
}

/* Line */
.spw-dot-line {
    border-radius: 2px !important;
    width: 28px !important;
    height: 4px !important;
    margin-top: 5px;
}

/* Label */
.spw-legend-label {
    font-size: 14px;
    color: #2D2D2D;
    line-height: 1.3;
}

.spw-legend-value {
    font-weight: 700;
    margin-left: 4px;
    color: #1E5BB8;
}

/* Total */
.spw-total-wrap {
    margin-top: 16px;
    padding-top: 8px;
}

.spw-total-divider {
    border: none;
    border-top: 1px solid #cccccc;
    margin: 0 0 10px 0;
}

.spw-total-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #1E5BB8;
    line-height: 1.2;
}

.spw-total-label {
    display: block;
    font-size: 13px;
    color: #2D2D2D;
    margin-top: 2px;
}

.spw-total-suffix {
    margin-left: 4px;
    opacity: 0.7;
}

/* Hover highlight class toggled via JS */
.spw-legend-item.spw-active .spw-legend-dot {
    transform: scale(1.35);
}

/* Entrance animation for legend items */
.spw-legend-item {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.spw-legend-item.spw-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive */
@media (max-width: 768px) {
    .spw-layout-horizontal,
    .spw-layout-horizontal-reverse {
        flex-direction: column;
        align-items: center;
    }

    .spw-canvas-wrap {
        width: 200px;
        height: 200px;
    }

    .spw-legend-wrap {
        width: 100%;
    }
}
