/* General body styles */
body {
    background-color: #f4f7fc;
    font-family: "Poppins", Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.7;
    color: #333;
    overflow-x: hidden; /* Prevent horizontal overflow */
}

/* Main Content Container */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.8s ease-in-out;
}

.sub-row {
    background-color: #f1f1f1;
}
.sub-table th, .sub-table td {
    font-size: 0.85em;
}
.main-row {
    cursor: pointer;
}

/* Page Title */
h1 {
    color: #007bff;
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 20px;
}

/* Subtitle */
p {
    color: #555;
    font-size: 1.1rem;
    text-align: center;
}

/* Dropdown Selection */
.select-container {
    text-align: center;
    margin-bottom: 20px;
}

select.form-select {
    width: 220px;
    padding: 10px;
    border: 2px solid #007bff;
    border-radius: 5px;
    background-color: #ffffff;
    font-size: 1rem;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

select.form-select:focus {
    border-color: #0056b3;
    outline: none;
    box-shadow: 0 0 8px rgba(0, 91, 187, 0.5);
    transform: scale(1.02);
}

/* Default Table Styling (For All Districts) */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    font-size: 1rem;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #0d6efd;
    color: #ffffff;
    font-weight: bold;
}

.table tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Hover effect on table */
.table tr:hover td {
    background-color: #e3f0ff;
    cursor: pointer;
}

/* District-Specific Table View (When User Selects a District) */
.district-view {
    border-radius: 0;
    border: 2px solid black;
    box-shadow: none; /* Remove default shadow */
}

.district-view th,
.district-view td {
    border: 2px solid black;
    text-align: center;
    font-size: 1rem;
}

/* Charts Section */
/* Adjust chart container to use full width */
.chart-container {
    width: 100%;
    max-width: 300px; /* Reducing max width to make charts smaller */
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1); /* Optional shadow for better UI */
    text-align: center;
}

.small-chart {
    max-width: 250px !important; /* Ensures pie chart is smaller */
    height: 250px !important; /* Forces smaller height */
}

.chart-title {
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 5px;
}

@media (max-width: 992px) { /* Medium Screens (Tablet) */
    .chart-container {
        max-width: 250px;
    }
    .small-chart {
        max-width: 220px !important;
        height: 220px !important;
    }
}

@media (max-width: 768px) { /* Small Screens (Mobile) */
    .chart-container {
        max-width: 100%;
    }
    .small-chart {
        max-width: 200px !important;
        height: 200px !important;
    }
}


/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

    p {
        font-size: 1rem;
    }

    select.form-select {
        width: 100%;
    }

    .chart-container {
        flex-direction: column;
        align-items: center;
    }

    canvas {
        width: 100% !important;
        height: auto !important;
    }
}


