﻿@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-dark: #3a2a0a; 
    --primary-light: #524020;
    --accent-gold: #dca315;
    --bg-white: #ffffff;
    --bg-light: #f5f6f8;
    --text-main: #333333;
    --text-muted: #666666;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
html, body { margin: 0; padding: 0; top: 0; }\nbody { background-color: var(--bg-light); color: var(--text-main); line-height: 1.6; overflow-x: hidden; }

/* Top Bar */
.top-bar { background-color: var(--primary-dark); color: white; display: flex; justify-content: space-between; align-items: center; padding: 8px 5%; font-size: 12px; }
.top-bar-left { display: flex; align-items: center; gap: 10px; }
.top-bar-left img { height: 20px; }
.top-bar-right { display: flex; align-items: center; gap: 15px; }
.social-icons span { display: inline-flex; width: 22px; height: 22px; background: white; color: var(--primary-dark); border-radius: 50%; align-items: center; justify-content: center; font-weight: bold; margin-left: 5px; cursor: pointer; }

/* Header */
.main-header { background: white; padding: 5px 5%; margin-top: 0; display: flex; justify-content: space-between; align-items: center; }
.brand-section { display: flex; align-items: center; gap: 15px; }
.brand-section img.logo-img { height: 70px; }
.brand-text { display: flex; flex-direction: column; }
.village-name { font-size: 24px; font-weight: 700; color: var(--text-main); margin: 0; line-height: 1.2; text-transform: uppercase; }
.lgd-code { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.header-controls { display: flex; align-items: center; gap: 20px; }
.lang-selector select { padding: 8px 15px; border: 1px solid #ddd; border-radius: 20px; outline: none; background: #f9f9f9; font-weight: 500; }
.seal-img { height: 50px; }

/* Navbar */
.navbar { background-color: var(--primary-dark); padding: 0 5%; }
.nav-links { display: flex; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav-links li { margin: 0; }
.nav-links a { color: white; text-decoration: none; padding: 15px 20px; display: inline-block; font-size: 14px; font-weight: 500; transition: 0.3s; }
.nav-links a:hover, .nav-links a.active { background-color: var(--accent-gold); color: white; }

/* Hero Section */
.hero-wrapper {
    position: relative;
    height: 450px;
    background: linear-gradient(110deg, var(--primary-dark) 55%, transparent 55.1%);
    display: flex;
    align-items: center;
    padding: 0 2%;
    overflow: hidden;
}
.hero-content { position: relative; z-index: 2; width: 40%;
    color: white;
}
.hero-content h1 { font-size: 38px; font-weight: 700; margin-bottom: 10px; line-height: 1.2; }
.hero-subtitle { font-size: 16px; margin-bottom: 30px; opacity: 0.9; }
.hero-actions { display: flex; gap: 15px; }
.btn-primary { background: var(--accent-gold); color: white; padding: 12px 25px; border-radius: 25px; text-decoration: none; font-weight: 600; border: none; cursor: pointer; transition: 0.3s; font-size: 14px; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: transparent; color: white; border: 2px solid white; padding: 10px 25px; border-radius: 25px; text-decoration: none; font-weight: 600; cursor: pointer; transition: 0.3s; font-size: 14px; }
.btn-secondary:hover { background: white; color: var(--primary-dark); }

/* Slider Background */
.hero-slider-bg {
    position: absolute;
    top: 0; right: 0;
    width: 60%; height: 100%;
    z-index: 0;
}
.h-slide {
    width: 100%; height: 100%; object-fit: cover;
    position: absolute; top:0; left:0;
    opacity: 0; transition: opacity 1s ease-in-out;
}
.h-slide.active { opacity: 1; }

/* Minister Marquee (Floating) */
.minister-marquee-wrapper { 
    position: relative; 
    z-index: 10; 
    margin-top: -60px; 
    padding: 0 2%;
    display: flex;
    justify-content: center;
}
.minister-track {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    background: transparent;
    max-width: 100%;
}
.minister-pill {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 160px;
    text-align: center;
}
.minister-img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 3px solid #f0f0f0;
}
.minister-info span { display: block; font-size: 12px; font-weight: 700; color: var(--text-main); }
.minister-info small { display: block; font-size: 10px; color: var(--text-muted); }

/* Main Content Area */
.main-container { padding: 40px 5%; max-width: 1400px; margin: 0 auto; }

/* Section Titles */
.section-heading-wrapper { text-align: center; margin: 40px 0 30px; position: relative; }
.section-heading-wrapper h3 { 
    display: inline-block; 
    background: var(--bg-light); 
    padding: 0 20px; 
    color: #4CAF50; 
    font-size: 16px; 
    font-weight: 600; 
    position: relative; 
    z-index: 2; 
    text-transform: uppercase; 
    letter-spacing: 1px;
}
.section-heading-wrapper::before { content: ''; position: absolute; top: 50%; left: 0; width: 100%; height: 1px; background: #ddd; z-index: 1; }

/* GP Members 5-Card Row */
.members-home-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}
.member-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px solid #eee;
    width: 18%;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.profile-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid #f4fdf4;
}
.member-name { font-size: 14px; font-weight: 700; color: var(--text-main); margin-bottom: 5px; }
.member-desg { font-size: 12px; color: var(--text-muted); }

/* Population Stats Row */
.pop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}
.pop-card {
    background: white;
    border-radius: 12px;
    padding: 25px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border: 1px solid #eee;
}
.pop-card i {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.pop-card:nth-child(1) i { background: #e8f5e9; color: #2e7d32; }
.pop-card:nth-child(2) i { background: #fff3e0; color: #e65100; }
.pop-card:nth-child(3) i { background: #e3f2fd; color: #1565c0; }
.pop-card:nth-child(4) i { background: #f3e5f5; color: #6a1b9a; }
.pop-info { text-align: left; }
.pop-info h4 { font-size: 12px; color: var(--text-muted); font-weight: 600; margin: 0 0 5px 0; }
.pop-info .pop-number { font-size: 28px; font-weight: 700; color: var(--text-main); margin: 0; line-height: 1; }

/* Detailed Census Block */
.census-block {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #eee;
    margin-bottom: 40px;
}
.census-block h3 { font-size: 18px; font-weight: 700; margin-bottom: 5px; }
.census-block p.sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.village-census-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #eee;
}
.v-details h4 { font-size: 15px; margin: 0 0 5px 0; font-weight: 700; }
.v-details span { font-size: 13px; color: var(--text-muted); margin-right: 15px; }
.st-percent { background: #e8f5e9; color: #2e7d32; padding: 6px 15px; border-radius: 20px; font-size: 12px; font-weight: 700; }

/* Schemes and News Split */
.split-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}
.schemes-list, .news-list {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #eee;
}
.schemes-list h3, .news-list h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.list-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}
.list-item i {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff3e0;
    color: #e65100;
    font-size: 18px;
    flex-shrink: 0;
}
.list-info h5 { margin: 0 0 5px 0; font-size: 14px; font-weight: 700; }
.list-info p { margin: 0; font-size: 12px; color: var(--text-muted); }
.view-all-btn {
    background: var(--primary-dark);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 13px;
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

/* Footer */
.main-footer { background: var(--primary-dark); color: white; padding: 50px 5% 0; font-size: 13px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-col h3 { color: var(--accent-gold); font-size: 15px; margin-bottom: 20px; text-transform: uppercase; font-weight: 700; }
.footer-col p { color: #ddd; margin-bottom: 12px; }
.footer-col strong { color: white; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; color: #ddd; }
.footer-links li strong { color: white; margin-right: 5px; }
.footer-bottom { background: var(--accent-gold); color: white; text-align: center; padding: 15px; font-size: 13px; margin: 0 -5.5%; font-weight: 600; }

/* Responsive adjustments */
@media (max-width: 992px) {
    .minister-track { gap: 10px; }
    .minister-pill { width: calc(33.33% - 10px); min-width: 0; padding: 10px; }
    .pop-grid { grid-template-columns: 1fr 1fr; }
    .hero-wrapper { background: linear-gradient(135deg, var(--primary-dark) 60%, transparent 60.1%); }
}

@media (max-width: 768px) {
    
    
    /* Population table scrollable wrapper */
    [style*="overflow-x: auto"] table {
        min-width: 700px;
    }
    .top-bar { flex-direction: row; justify-content: space-between; font-size: 0.75rem; flex-wrap: wrap; padding: 5px 10px; }
    .brand-text { flex-direction: column; text-align: left; gap: 2px; align-items: flex-start; }
    .village-name { font-size: 1.1rem; }
    .lgd-code { font-size: 0.7rem; }
    .main-header { flex-direction: row; justify-content: space-between; align-items: center; padding: 10px; gap: 5px; }
    .header-controls { width: auto; justify-content: flex-end; gap: 5px; }
    .navbar { padding: 10px; position: relative; }
    
    .hero-wrapper { height: auto; padding: 40px 5%; background: var(--primary-dark); flex-direction: column; }
    /* .hero-slider-bg { display: none; } */
    .hero-slider-bg { position: relative; width: 100%; height: 250px; }
    .hero-content { width: 100%; text-align: center; align-items: center; display: flex; flex-direction: column; }
    .minister-marquee-wrapper { margin-top: 20px; }
    .minister-pill { width: calc(50% - 10px); }
    .members-home-row { flex-direction: column; align-items: center; }
    .pop-grid, .split-sections, .footer-grid { grid-template-columns: 1fr; }
}

/* Animations */
.animate-fade-up { animation: fadeUp 0.6s ease-out both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Initials placeholder for missing images */
.initials-placeholder {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #3730a3;
    font-weight: bold;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

/* Table Layout for Services */
.services-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}
.services-table th, .services-table td {
    padding: 15px;
    border: 1px solid #e0e0e0;
    text-align: left;
}
.services-table th {
    background-color: #5d4037;
    color: #fff;
    font-weight: 600;
}
.services-table tr:nth-child(even) {
    background-color: #f9f9f9;
}
.services-table tr:hover {
    background-color: #f1f1f1;
}
.services-table i {
    color: #fbc02d;
    margin-right: 10px;
}

/* 4 Card Grid Layout for Inner Pages */
.four-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}
@media (max-width: 1024px) {
    .four-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    
    
    /* Population table scrollable wrapper */
    [style*="overflow-x: auto"] table {
        min-width: 700px;
    }
    .four-card-grid {
        grid-template-columns: 1fr;
    }
}

/* Fix Sticky Header Overlap */
html, body { margin: 0; padding: 0; top: 0; }\nbody {
    padding-top: 130px; /* Accounts for the fixed header */
}
.header-top {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.main-nav {
    position: fixed;
    top: 80px; /* Below the logo header */
    width: 100%;
    z-index: 999;
}

/* Mobile Header Inline Fix */
@media (max-width: 768px) {
    
    
    /* Population table scrollable wrapper */
    [style*="overflow-x: auto"] table {
        min-width: 700px;
    }
    html, body { margin: 0; padding: 0; top: 0; }\nbody {
        padding-top: 100px;
    }
    .header-top {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        padding: 5px 10px;
        height: 60px;
    }
    .main-nav {
        top: 60px;
    }
    .logo-container {
        display: flex;
        align-items: center;
        width: 100%;
    }
    .logo-container img {
        height: 40px;
        width: auto;
    }
    .logo-text h1 {
        font-size: 14px;
        white-space: nowrap; /* Prevent wrapping */
        overflow: hidden;
        text-overflow: ellipsis; /* Fallback if too small, but we reduce font */
    }
    .logo-text p {
        display: none; /* Hide subtitle on very small mobile for inline */
    }
    .header-right {
        display: none; /* Hide language selector on mobile header to save space, put it in menu if needed */
    }
}

/* === INNER PAGES: 4-COLUMN GRIDS === */
.members-ref-grid, .gallery-grid, 
.members-ref-grid, .gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }\n    background: white;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}
.member-ref-card .profile-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px auto;
    border: 3px solid #f0f0f0;
}
.member-ref-card h4 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 5px;
}
.member-ref-card p {
    font-size: 0.9rem;
    color: #666;
}

/* Mobile responsive styles */
@media (max-width: 900px) {
    .members-ref-grid, .gallery-grid, 
    .main-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 5px 2%;
    }
    .brand-section {
        flex-direction: row;
        align-items: center;
    }
    .brand-section img.logo-img {
        height: 50px;
    }
    .village-name {
        font-size: 16px;
    }
    .lgd-code {
        font-size: 10px;
    }
}

@media (max-width: 600px) {
    .members-ref-grid, .gallery-grid, 
}

select#language-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    padding-right: 15px; /* no arrow */
}

.ref-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95rem;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}
.ref-table th, .ref-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.ref-table th {
    background-color: var(--primary-dark);
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}
.ref-table tbody tr:hover {
    background-color: #f8fafc;
}

/* ---- CSS UPDATES ---- */
.home-bottom-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}
@media (max-width: 900px) {
    .home-bottom-grid { grid-template-columns: 1fr; }
}

.list-style-scheme {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    text-decoration: none;
    color: var(--primary-dark);
    transition: all 0.2s;
}
.list-style-scheme:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
    transform: translateY(-2px);
}
.list-style-scheme h4 {
    margin: 0 0 0 15px;
    font-size: 1.05rem;
}


@media (max-width: 1024px) {
    
}
@media (max-width: 768px) {
    
    
    /* Population table scrollable wrapper */
    [style*="overflow-x: auto"] table {
        min-width: 700px;
    }
    
}
@media (max-width: 480px) {
    
}

/* Mobile Header Fix - Inline without ellipsis */
@media (max-width: 768px) {
    
    
    /* Population table scrollable wrapper */
    [style*="overflow-x: auto"] table {
        min-width: 700px;
    }
    .top-bar .max-w-container {
        display: flex;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center;
        flex-wrap: nowrap !important;
    }
    .top-bar-left, .top-bar-right {
        margin: 0 !important;
        font-size: 0.7rem;
        white-space: nowrap;
    }
    .main-header {
        padding: 5px 10px;
    }
    .logo-section h2 {
        font-size: 0.9rem !important;
        white-space: normal;
        line-height: 1.2;
    }
    .logo-img {
        width: 40px !important;
        height: 40px !important;
    }
    .header-controls {
        gap: 5px;
    }
    #language-select {
        padding: 2px 5px !important;
        font-size: 0.75rem !important;
    }
}

/* Menu Toggle Fixes */
.nav-links {
    transition: max-height 0.3s ease-in-out;
}
@media (max-width: 768px) {
    
    
    /* Population table scrollable wrapper */
    [style*="overflow-x: auto"] table {
        min-width: 700px;
    }
    .nav-links.active {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        background: var(--primary-dark);
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 999;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    .nav-links a {
        padding: 12px 20px !important;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        width: 100%;
    }
}

/* INNER PAGE WRAPPERS & CARDS */
.inner-page-wrapper {
    background: #fdfaf6;
    border: 2px solid #e2cfb6;
    border-radius: 12px;
    padding: 40px;
    margin: 20px auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
@media (max-width: 768px) {
    
    
    /* Population table scrollable wrapper */
    [style*="overflow-x: auto"] table {
        min-width: 700px;
    }
    .inner-page-wrapper {
        padding: 20px;
    }
}
.inner-card-style {
    background: #fff;
    border: 1px solid #e2cfb6;
    border-radius: 8px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.inner-card-style:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.05);
}
.document-card.inner-card-style h4 {
    margin-bottom: 20px;
    font-size: 1.05rem;
    color: var(--primary-light);
    font-weight: 600;
}
.document-card.inner-card-style .card-btn {
    margin-top: auto;
    width: 80%;
    background: #795548;
    color: white;
    padding: 10px;
    border-radius: 20px;
    border: none;
    font-weight: 600;
}
.document-card.inner-card-style .card-btn:hover {
    background: #5d4037;
}
/* Ensure Top Bar flex doesn't get messed up */
@media (max-width: 768px) {
    
    
    /* Population table scrollable wrapper */
    [style*="overflow-x: auto"] table {
        min-width: 700px;
    }
    .top-bar-left, .top-bar-right {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    .top-bar-right select {
        padding: 0 5px;
        font-size: 0.75rem;
    }
}

/* ---- STRICT 4-COLUMN GRID OVERRIDES ---- */
.documents-grid, .members-4-grid, .gallery-4-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 25px !important;
    margin-top: 20px !important;
}

@media (max-width: 1200px) {
    .documents-grid, .members-4-grid, .gallery-4-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 900px) {
    .documents-grid, .members-4-grid, .gallery-4-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 600px) {
    .documents-grid, .members-4-grid, .gallery-4-grid { grid-template-columns: 1fr !important; }
}

/* Ensure mobile header stays absolutely inline */
@media (max-width: 768px) {
    
    
    /* Population table scrollable wrapper */
    [style*="overflow-x: auto"] table {
        min-width: 700px;
    }
    .top-bar .max-w-container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
    }
    .top-bar-left, .top-bar-right {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        white-space: nowrap !important;
        margin: 0 !important;
        gap: 10px !important;
    }
    .main-header {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
    }
    .logo-section {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        white-space: nowrap !important;
    }
    .logo-section h2 {
        white-space: nowrap !important;
        font-size: 1rem !important;
    }
}

@media (max-width: 900px) {
    .home-bottom-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 900px) {
    .main-header {
        padding: 5px 0 !important;
    }
    .main-header .max-w-container {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 5px !important;
        gap: 5px !important;
    }
    
    .logo-container img {
        width: 35px !important;
        height: 35px !important;
    }
    
    .village-title-container {
        flex: 1 !important;
        text-align: left !important;
        padding: 0 !important;
        min-width: 0 !important; /* allows truncation if needed */
    }
    
    .village-title-container h1 {
        font-size: 0.9rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin: 0 !important;
    }
    
    .village-title-container p {
        font-size: 0.6rem !important;
        white-space: nowrap !important;
        margin: 0 !important;
    }
    
    .id-center {
        display: none !important; /* Hide emblem on very small screens to fit 1 row */
    }
    
    .header-right {
        gap: 5px !important;
        flex-direction: row !important;
    }
    
    .language-selector {
        padding: 2px 5px !important;
        font-size: 0.7rem !important;
        width: auto !important;
    }
    
    .menu-toggle {
        font-size: 1.2rem !important;
        margin-left: 0 !important;
        padding: 5px !important;
    }
}

.members-4-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 900px) {
    .members-4-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 500px) {
    .members-4-grid {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 900px) {
    .header-content, .top-header-container {
        flex-direction: row !important;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
    }
    .header-titles h1 {
        font-size: 1.2rem !important;
    }
    .header-titles p {
        font-size: 0.8rem !important;
    }
    .logo img {
        width: 50px !important;
        height: 50px !important;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--header-bg, #4a1414);
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 100;
    }
    .nav-links.active {
        display: flex;
    }
    .hamburger-menu {
        display: flex;
    }
}

@media (max-width: 768px) {
    
    
    /* Population table scrollable wrapper */
    [style*="overflow-x: auto"] table {
        min-width: 700px;
    }
    .header-content {
        padding: 5px 10px !important;
    }
    .logo-container img {
        height: 50px !important;
        margin-right: 10px !important;
    }
    .header-text h1 {
        font-size: 1rem !important;
    }
    .header-text h2 {
        font-size: 0.8rem !important;
    }
    .menu-toggle {
        font-size: 1.5rem !important;
        right: 10px !important;
    }
    .hero-wrapper {
        min-height: 400px !important;
    }
}
.members-4-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
@media (min-width: 1024px) {
    .members-4-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    .gallery-4-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 15px !important;
    }
}
.gallery-4-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
}
.gallery-4-grid img:hover {
    transform: scale(1.05);
}

/* Excluded Services */
.excluded-services-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
    background: #fff5f5;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #ffcccc;
}
.excluded-service-card {
    background: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-left: 4px solid #ff4d4d;
}
.excluded-service-card ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}
.excluded-service-card ul li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
    position: relative;
    padding-left: 20px;
}
.excluded-service-card ul li:last-child {
    border-bottom: none;
}
.excluded-service-card ul li::before {
    content: "❌";
    position: absolute;
    left: 0;
    font-size: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
}
@media (max-width: 768px) {
    
    
    /* Population table scrollable wrapper */
    [style*="overflow-x: auto"] table {
        min-width: 700px;
    }
    .excluded-services-box {
        grid-template-columns: 1fr;
    }
}

/* Fix schemes inner pages alignment */
#scheme-details .inner-page-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
    padding: 30px;
}
.scheme-icon {
    width: 20px !important;
    height: 20px !important;
    margin-left: 10px;
}
.logo-img {
    height: 50px !important; /* Reduce logo size globally as well if they meant the main header logo */
}

.gallery-card { background: #fff; border: 1px solid #e2cfb6; padding: 10px; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }

/* Desktop defaults */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-dark);
    cursor: pointer;
}

/* Ensure mobile header stays absolutely inline */
@media (max-width: 900px) {
    .mobile-menu-btn {
        display: block !important;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--primary-dark);
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 9999;
        padding: 0;
        margin: 0;
    }
    
    .nav-links.active {
        display: flex !important;
    }

    .nav-links li {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-links li a {
        display: block;
        padding: 15px 20px;
        width: 100%;
    }

    /* Keep header one row, no wrap */
    .main-header {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 5px !important;
        min-height: 50px !important;
    }
    
    .logo-img {
        width: 35px !important;
        height: 35px !important;
    }
    
    .lang-selector select {
        padding: 2px 4px !important;
        font-size: 0.75rem !important;
    }
    
    .mobile-menu-btn {
        font-size: 1.2rem !important;
        padding: 2px !important;
    }
    
    .brand-section {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 0; /* allows truncation */
    }
    
    .logo-img {
        width: 45px !important;
        height: 45px !important;
        flex-shrink: 0;
    }
    
    .brand-text {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0; /* allows truncation */
    }
    
    .village-name {
        font-size: 0.85rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
        line-height: 1.2;
    }
    .lgd-code {
        font-size: 0.6rem !important;
    }
    
    .lgd-code {
        font-size: 0.7rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        line-height: 1.2;
    }

    .header-controls {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        flex-shrink: 0;
    }
    
    .seal-img {
        display: none !important; /* Hide seal on mobile to save space */
    }
    
    .lang-selector select {
        padding: 4px 8px !important;
        font-size: 0.8rem !important;
    }
    
    /* Ensure no body padding issues */
    body {
        padding-top: 60px !important;
    }
    
    .top-bar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 5px !important;
        font-size: 0.75rem !important;
        gap: 5px !important;
        text-align: center !important;
    }
    
    .top-bar-left, .top-bar-right {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
    }
    
    .navbar {
        padding: 0 !important;
    }
}

/* ================================================================
   INNER PAGE LAYOUT FIXES
   Back button at top, title centered with proper top margin & spacing
================================================================ */

/* Back button bar for inner pages */
.inner-page-back-bar {
    padding: 20px 5% 0 5%;
    box-sizing: border-box;
    width: 100%;
}

/* Inner page section headings - centered, proper top margin */
.section-heading {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 20px 5% 10px 5%;
    text-align: left;
    box-sizing: border-box;
}

.section-heading.center-text {
    text-align: center;
    margin: 20px auto 15px auto;
    max-width: 1000px;
    padding: 0 2%;
}

/* Inner page wrapper - ensure equal left/right spacing */
.main-content-grid {
    padding: 0 2%;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Max width container - consistent centering */
.max-w-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2%;
    box-sizing: border-box;
}

/* ================================================================
   MOBILE WHITE SPACE & RESPONSIVE FIXES
================================================================ */

/* Remove any extra white space above the top bar on mobile */
html {
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure body starts at top */
body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
}

/* ================================================================
   TABLE HORIZONTAL SCROLLING
================================================================ */



/* Population table scrollable wrapper */
[style*="overflow-x: auto"] table {
    min-width: 700px;
}

@media (max-width: 768px) {
    
    
    /* Population table scrollable wrapper */
    [style*="overflow-x: auto"] table {
        min-width: 700px;
    }
    /* Inner page title adjustments */
    .section-heading.center-text {
        font-size: 1.2rem;
        padding: 0 3%;
        margin: 15px auto 10px auto;
    }

    /* Inner page wrapper mobile padding */
    .inner-page-wrapper {
        padding: 15px !important;
        margin: 10px 3% !important;
    }

    /* Back button bar mobile */
    .inner-page-back-bar {
        padding: 10px 3% 0 3%;
    }

    /* Main content grid mobile */
    .main-content-grid {
        padding: 0 3%;
    }

    /* Max width container mobile */
    .max-w-container {
        padding: 0 3%;
    }

    /* Table cells no wrap for horizontal scroll */
    .ref-table td, .ref-table th,
    .services-table td, .services-table th {
        white-space: nowrap;
    }

    /* Member cards on mobile */
    .members-home-row {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 12px !important;
    }

    .member-card {
        width: calc(50% - 16px) !important;
        min-width: 140px;
    }

    /* Scheme list on mobile */
    .list-style-scheme h4 {
        font-size: 0.95rem;
    }

    /* Home bottom grid columns */
    .home-bottom-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .member-card {
        width: calc(50% - 10px) !important;
        min-width: 130px;
        padding: 10px !important;
    }

    .section-heading.center-text {
        font-size: 1.1rem;
    }

    /* Scheme cards stacked on very small screens */
    .list-style-scheme {
        padding: 12px 15px;
    }
}

@media (max-width: 768px) {
    /* All tables should be horizontally scrollable on mobile */
    .ref-table, .services-table, table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
        width: 100% !important;
    }
}
/* Additional Layouts */
.modern-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.glass-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    border: 1px solid #eee;
}
.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}
.glass-card .card-icon-circle {
    background: #f0e6d2;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    margin-bottom: 15px;
    color: #8c6b43;
}
@media (max-width: 768px) {
    .inner-page-wrapper ul, .inner-page-wrapper ol {
        padding-left: 20px;
    }
}
/* Ensure Schemes and Alerts have matching medium height */

/* Ensure Schemes and Alerts have matching medium height without scrollbar */
.schemes-list, .news-list {
    height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.schemes-list {
    gap: 10px !important;
}
.schemes-list .list-style-scheme {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 10px 15px !important;
    margin: 0 !important;
    min-height: 0;
}
.schemes-list .list-style-scheme h4 {
    font-size: 14px !important;
    margin: 0 !important;
}
.schemes-list .list-style-scheme .card-icon-circle {
    width: 35px !important;
    height: 35px !important;
    font-size: 1rem !important;
    margin-right: 10px !important;
    margin-bottom: 0 !important;
}