/* 1. MASTER LAYOUT & CONTAINERS */
.dashboard-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center; /* The "Godzilla" centering rule */
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding-bottom: 60px;
}

.chart-container-master {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; 
    padding: 30px 0;
    font-family: 'Inter', sans-serif;
}

/* 2. STATS RIBBON (Executive Status Bar) */
.stats-ribbon {
    display: flex;
    background: #ffffff;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    margin-top: -20px;
    z-index: 10;
    overflow: hidden;
}

.stat-group {
    padding: 25px 50px;
    text-align: center;
}

.stat-group + .stat-group {
    border-left: 1px solid #eee;
}

.stat-label {
    display: block;
    font-size: 18px;
    color:#0389C1;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
    font-weight: 700;
}

.stat-value {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 0;
    color: #2c3e50;
    line-height: 1;
    font-family: 'Mukta', sans-serif;
}

#workingCount { color: #10af2f; }

/* 3. THE CHART WRAPPER (Clean & Flat) */
.chart-wrapper {
    position: relative;
    width: 450px;
    height: 450px;
    margin: 40px auto;
    /* Removed the drop-shadow filter for a cleaner look */
}

/* Inner Glow Effect Removed - We deleted the ::after block entirely */

.chart-inner-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 2;
}

#centerCount {
    font-size: 3.5rem;
    font-weight: 800;
    color: #2c3e50;
    line-height: 1;
    display: block;
    transition: all 0.3s ease;
    /* Removed the text-shadow for a flatter look */
}

.center-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 2px;
    font-weight: 700;
    margin-top: 5px;
}
/* 4. REGION GRID & TABLES */

.region-grid {
    display: flex;
    flex-wrap: wrap; /* Allows cards to wrap on mobile */
    justify-content: center;
    gap: 20px;
    align-items: stretch; /* This is the secret: it forces all items to the same height */
    max-width: 1300px;
    margin: 0 auto;
}

/* The Card itself */
.region-card {
    flex: 1;
    min-width: 280px; /* Prevents cards from getting too skinny */
    max-width: 320px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column; /* Stack header and list vertically */
    height: 550px; /* Set a standard height so they all look like a row of pillars */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.region-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(44, 62, 80, 0.12);
    border-color: #cbd5e1;
}

/* The Header (Stays at the top) */
.region-header {
    padding: 15px;
    font-weight: 700;
    text-align: center;
    color: white;
    border-radius: 11px 11px 0 0; /* Match card corners */
}

* The List (The part that scrolls) */
.region-list {
    flex: 1; /* Tells the list to take up all remaining vertical space */
    overflow-y: auto; /* Adds a scrollbar ONLY if the districts exceed 550px */
    padding: 5px 0;
}

/* Optional: Make the scrollbar look "Premium" and thin */
.region-list::-webkit-scrollbar {
    width: 6px;
}
.region-list::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}
/* Region Header Colors */
.col-bengaluru { background: #B33939; }
.col-mysuru { background: #EAB543; color: #2c3e50; }
.col-kalaburagi { background: #1289A7; }
.col-belagavi { background: #0e8720; }

.region-table {
    width: 100%;
    border-collapse: collapse;
}

.region-table tr:hover {
    background-color: #f8fafc; /* Very light grey */
    cursor: default;
}

.region-table td {
    padding: 10px 15px;
    font-size: 0.85rem;
    border-bottom: 1px solid #f8fafc;
}

.count-cell {
    font-variant-numeric: tabular-nums; /* Perfect number alignment */
    font-weight: 700;
    color: #2c3e50;
    text-align: right;
}

.total-row {
    background-color: #f1f5f9;
    font-weight: 700;
}
/* --- 5. MISSION IMPACT SECTION (REFINED & MERGED) --- */
.mission-impact-section {
    padding: 120px 20px;
    background: 
        radial-gradient(circle at top right, rgba(209, 101, 7, 0.05) 0%, transparent 40%),
        radial-gradient(circle at bottom left, rgba(44, 62, 80, 0.05) 0%, transparent 40%),
        linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    background-image: 
        linear-gradient(rgba(44, 62, 80, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(44, 62, 80, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    position: relative;
    overflow: hidden;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

/* Missing Stats Bar Styling */
.mission-stats-bar {
    display: inline-flex;
    align-items: center;
    gap: 40px;
    background: #ffffff;
    padding: 25px 50px;
    border-radius: 100px; /* Pill shape */
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
    margin-bottom: 60px;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.mission-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mission-stat-item i {
    font-size: 1.5rem;
    color: #D16507; /* Match your brand orange */
}


/* --- Mission Title & Description Typography --- */

.mission-title {
    font-size: 2.5rem; /* Large, impactful size */
    font-weight: 800;
    color: #1a4a8e; /* Souharda Blue */
    line-height: 1.1;
    margin-bottom: 25px;
    letter-spacing: -1px;
}

/* Ensure the Totals look like the screenshot */
.district-item:last-child {
    background-color: #f0f7ff; 
    font-weight: 800;
    border-top: 1px solid #d1d9e6;
}
.mission-title span {
    color: #D16507; /* The brand orange/gold */
    position: relative;
    display: inline-block;
}

/* Optional: A subtle underline under "Empowering Karnataka" */
.mission-title span::after {
    content: '';
    position: absolute;
    bottom: 5px; /* Adjust based on your font size */
    left: 0;
    width: 100%;
    height: 8px;
    background: rgba(209, 101, 7, 0.15); /* Very light version of your orange */
    z-index: -1; /* Puts it behind the text like a highlighter */
    border-radius: 2px;
}

.mission-description {
    font-size: 1.25rem;
    line-height: 1.8;
    color: #475569; /* Slate grey for better readability */
    max-width: 850px;
    margin: 0 auto 50px;
    font-weight: 400;
}

/* Styling the <strong> tags within the description */
.mission-description strong {
    color: #1a4a8e;
    font-weight: 700;
}

/* Mobile adjustments for the title */
@media (max-width: 768px) {
    .mission-title {
        font-size: 2.4rem;
    }
    .mission-description {
        font-size: 1.1rem;
        padding: 0 10px;
    }
}
.stat-text-group { text-align: left; }

.stat-number {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a4a8e;
    line-height: 1;
}

.stat-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 1px;
}

.mission-stat-divider {
    width: 1px;
    height: 30px;
    background: #e2e8f0;
}

/* Download Grid Adjustments */
.mission-download-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
}

.download-card {
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 30px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
    text-align: left; /* Keep text left-aligned inside cards */
}

/* New: Language Badge positioning */
.download-icon-box {
    position: relative;
    margin-right: 25px;
    flex-shrink: 0;
}

.lang-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #1a4a8e;
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Your Existing Animations */
@keyframes pdfPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0px rgba(220,53,69,0)); }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 12px rgba(220,53,69,0.4)); }
}

.download-icon-box i {
    font-size: 3.5rem;
    color: #dc3545;
    animation: pdfPulse 2s infinite ease-in-out;
}

@keyframes textGlow {
    0%, 100% { color: #D16507; }
    50% { color: #ee652e; text-shadow: 0 0 8px rgba(238,101,46,0.3); }
}

.download-btn-text {
    animation: textGlow 1.5s infinite ease-in-out;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

/* --- RESPONSIVENESS (MERGED) --- */
@media (max-width: 992px) {
    .mission-download-grid { grid-template-columns: 1fr; }
    .mission-stats-bar { 
        flex-direction: column; 
        border-radius: 20px; 
        padding: 20px;
        gap: 15px;
    }
    .mission-stat-divider { display: none; }
}
/* 6. RESPONSIVENESS */
@media (max-width: 1100px) {
    .region-grid { grid-template-columns: repeat(2, 1fr); }
    .mission-download-grid { grid-template-columns: 1fr; }
}


/* 1. REGIONAL GRID LAYOUT */
.region-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1300px;
    margin: 40px auto;
    padding: 0 20px;
    align-items: stretch; /* Forces all cards in a row to equal height */
}

/* 2. THE CARD STRUCTURE */
.region-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column; /* Stacks Header -> List -> Total */
    height: 520px; /* Fixed height for perfect alignment */
    overflow: hidden; /* Clips the Total bar to the rounded corners */
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    transition: transform 0.3s ease;
}

.region-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(26, 74, 142, 0.08);
}

/* 3. THE HEADER */
.region-header {
    padding: 18px;
    color: white;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-align: center;
}

/* Region Specific Colors */
.bg-bengaluru { background: #b33939; }
.bg-mysuru    { background: #f39c12; }
.bg-kalaburagi { background: #2980b9; }
.bg-belagavi   { background: #27ae60; }

/* 4. THE SCROLLABLE LIST */
.region-list {
    flex: 1; /* Fills the middle space */
    overflow-y: auto; /* Scrolls if content is long */
    padding: 10px 0;
}

/* Custom Thin Scrollbar */
.region-list::-webkit-scrollbar { width: 4px; }
.region-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }

/* 5. DISTRICT ITEMS & MINI GRAPHS */
.district-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f8fafc;
}

.district-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 70%;
}

.district-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
}

.mini-graph-bg {
    width: 100%;
    height: 4px;
    background: #f1f5f9;
    border-radius: 2px;
}

.sparkline {
    height: 100%;
    background: #D16507; /* Brand Orange */
    border-radius: 2px;
    opacity: 0.5;
}

.district-count {
    font-weight: 700;
    color: #1a4a8e;
    font-size: 0.9rem;
}

/* 6. THE STICKY TOTAL (No space at bottom) */
.district-total {
    background: #f0f7ff; /* Light blue highlight */
    padding: 15px 20px;
    font-weight: 800;
    color: #1a4a8e;
    border-top: 1px solid #d1d9e6;
    display: flex;
    justify-content: space-between;
    margin-top: auto; /* Pins to bottom */
}
@media (max-width: 600px) {
    .stats-ribbon { flex-direction: column; }
    .stat-group + .stat-group { border-left: none; border-top: 1px solid #eee; }
    .region-grid { grid-template-columns: 1fr; }
    .chart-wrapper { width: 320px; height: 320px; }
    .mission-title { font-size: 2.2rem; }
}

.search-container {
    max-width: 600px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#districtSearch {
    width: 100%;
    padding: 15px 20px 15px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

#districtSearch:focus {
    outline: none;
    border-color: #D16507; /* Brand Orange */
    box-shadow: 0 10px 15px rgba(209, 101, 7, 0.1);
}

.search-icon {
    position: absolute;
    left: 18px;
    color: #94a3b8;
}


// search option in the member section //
.search-wrapper {
    display: flex;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.search-wrapper:focus-within {
    border-color: #D16507;
}

#districtSearch {
    border: none !important; /* Remove individual border */
    flex: 1;
}

.search-btn {
    background: #1a4a8e; /* Trustworthy Blue */
    color: white;
    border: none;
    padding: 0 25px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #D16507; /* Turns Orange on hover */
}