* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f9fafb;
    padding: 20px;
}

.sentiment-widget {
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    margin: 2rem 0;
}

/* Header Style to match first design */
.widget-header {
    background: #fbbf24; /* changed to match first image */
    padding: 12px 16px;
}

.widget-title {
    font-size: 18px;
    font-weight: 700;
    padding: 0;
}

.widget-subtitle {
    padding-top: 10px;
    font-size: 11px;
}

.widget-content {
    display: flex;
}

.sentiment-section {
    flex: 1;
    padding: 16px;
    border-right: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
}

.section-title {
    font-weight: 500;
    color: #1f2937;
    font-size: 14px;
    margin-bottom: 4px;
}

.pie-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    flex: 1;
}

.pie-chart {
    width: 120px;
    height: 120px;
}

.legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-left: 16px;
}

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

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

.legend-text {
    color: #374151;
}

.legend-value {
    margin-left: auto;
    font-weight: 500;
    color: #1f2937;
}

.category-section {
    flex: 1.5;
    padding: 16px;
}

.category-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 12px;
}

.category-legend-item {
    display: flex;
    align-items: center;
}

.category-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 4px;
}

.category-legend-text {
    color: #4b5563;
}

/* Bar chart height slightly increased */
.bar-chart {
    height: 180px;
}

/* Attribution section improved */
.attribution {
    margin-top: 20px;
    background-color: #f9fafb;
    padding: 10px 16px;
    border-top: 1px solid #f3f4f6;
    font-size: 12px;
    color: #6b7280;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.attribution a {
    color: #2563eb;
    font-weight: 500;
    text-decoration: none;
    margin-top: 20px;
}

.attribution a:hover {
    text-decoration: underline;
}

.tooltip {
    position: absolute;
    background: rgba(31, 41, 55, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    display: none;
}
div#section-description {
    margin-top: 25px;
}
/* Responsive layout */
@media (max-width: 640px) {
    .widget-content {
        flex-direction: column;
    }

    .sentiment-section {
        border-right: none;
        border-bottom: 1px solid #f3f4f6;
    }

    .pie-container {
        justify-content: center;
        flex-direction: column;
        gap: 16px;
    }

    .legend {
        margin-left: 0;
        flex-direction: row;
        justify-content: center;
        gap: 16px;
    }

    .attribution {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-top : 20px;
    }
}
