/* Main layout */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header section */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.title {
    color: #DE2934;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 16px;
}

.subtitle {
    font-size: 18px;
    margin-bottom: 8px;
}

/* View buttons */
.view-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}

.view-buttons button {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    background-color: #f0f0f0;
    color: #333;
}

.view-buttons button.active {
    background-color: #011E41;
    color: white;
}

/* Table styles */
.table-container, .summary-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border: 1px solid #ccc;
    font-size: 14px;
}

th, td {
    padding: 8px 12px;
    border: 1px solid #ccc;
}

th {
    color: #011E41;
    font-weight: bold;
}

td {
    text-align: right;
}

td:first-child {
    text-align: left;
    font-weight: 500;
}

.total-row {
    color: #DE2934;
    font-weight: bold;
}

/* Region-specific text colors */
.mandalay-text {
    color: #2C496D;
}

.naypyitaw-text {
    color: #6C86A7;
}

.sagaing-text {
    color: #910008;
}

/* Chart styles */
.chart-container {
    height: 400px;
    margin: 24px 0;
}

.pie-charts-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 40px; /* Increased spacing between charts and table */
}

.pie-chart-box {
    flex: 1 0 45%;
    min-width: 250px;
}

.chart-title {
    text-align: center;
    font-size: 16px;
    color: #011E41;
    margin-bottom: 10px;
    font-weight: 600;
}

.pie-chart-container {
    height: 300px; /* Increased height to provide more room for labels */
    margin: 0 auto;
}

/* View sections */
.view-section {
    display: block;
}

.hidden {
    display: none;
}

/* Summary view layout */
.summary-container {
    display: flex;
    flex-direction: row;
    gap: 30px;
    width: 100%;
    align-items: flex-start;
}

.summary-charts-column {
    flex: 0 0 65%;
    margin-bottom: 20px;
}

.observations-column {
    flex: 0 0 30%;
    margin-top: 50px;
    max-width: 350px;
}

.summary-table-container {
    max-width: 800px; /* Increased width to accommodate more columns */
    margin: 0 auto;
    overflow-x: auto; /* Add horizontal scroll for small screens */
}

.observations {
    text-align: left;
    position: sticky;
    top: 20px;
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
}

.observations h3 {
    color: #011E41;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.observations ul {
    list-style-type: disc;
    padding-left: 20px;
}

.observations li {
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Loading animation */
.loading {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.loading:after {
    content: " ";
    display: block;
    border-radius: 50%;
    width: 0;
    height: 0;
    margin: 8px;
    box-sizing: border-box;
    border: 32px solid #DE2934;
    border-color: #DE2934 transparent #DE2934 transparent;
    animation: loading 1.2s infinite;
}

@keyframes loading {
    0% {
        transform: rotate(0);
        animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    }
    50% {
        transform: rotate(180deg);
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .summary-container {
        flex-direction: column;
    }
    
    .observations-column {
        width: 100%;
    }
    
    .view-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    th, td {
        padding: 6px 10px;
        font-size: 14px;
    }
}