/* ========================================
   CLEAN MODERN GOVERNMENT PORTAL - FIXED LAYOUT
   Theme: Professional, Grid-Based, Structured
   Colors: Maroon, Gold, White, Dark Grey
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@300;400;500;600;700&family=Merriweather:wght@400;700&display=swap');

:root {
    /* --- COLOR PALETTE --- */
    --primary-maroon: #800000;
    /* Authority */
    --accent-gold: #D4AF37;
    /* Prestige */
    --bg-light: #F9FAFB;
    /* Light Grey Background */
    --bg-white: #FFFFFF;
    /* Pure White */
    --text-dark: #1F2937;
    /* High Contrast Text */
    --text-muted: #4B5563;
    /* Secondary Text */
    --border-color: #E5E7EB;
    /* Subtle Borders */

    /* --- SPACING & SIZING --- */
    --container-width: 1280px;
    --header-height: 90px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* --- SHADOWS --- */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ==================== 1. GLOBAL RESET ==================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Public Sans', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

html {
    scroll-padding-top: 180px;
    /* Prevents fixed header/nav from covering section titles on anchor scroll */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Merriweather', serif;
    color: var(--primary-maroon);
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

button {
    cursor: pointer;
}

/* ==================== 2. STRUCTURED HEADER (FIXED INLINE) ==================== */
.header {
    background: var(--bg-white);
    border-bottom: 4px solid var(--accent-gold);
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2rem;
    gap: 1rem;
    white-space: nowrap;
    min-height: 90px;
}

/* Left: Logo + Title */
.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 auto;
}

.gp-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.title-block {
    display: flex;
    flex-direction: column;
}

.village-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-maroon);
    line-height: 1.1;
    margin: 0;
}

.sub-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Center: ID Codes */
.header-center {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    border-left: 2px solid #E5E7EB;
    padding-left: 1.5rem;
    flex: 0 0 auto;
    margin-right: auto;
    /* Push Right Section to far right */
    padding-right: 2rem;
}

.id-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
}

.id-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    min-width: 80px;
}

.id-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-maroon);
    background: #FFFBF0;
    padding: 2px 8px;
    border: 1px solid var(--accent-gold);
    min-width: 70px;
    text-align: center;
}

/* Right: Rajmudra & Language (STRICT INLINE & RIGHT ALIGNED) */
.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
    /* Space between Lang and Logo */
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.lang-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    font-size: 0.85rem;
    /* Move slightly left as requested (handled by gap above) */
}

.rajmudra-logo {
    height: 65px;
    /* Fixed Height */
    width: auto;
    object-fit: contain;
    display: block;
    /* Flex item behavior */
    margin: 0;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--primary-maroon);
    padding: 0.5rem;
    cursor: pointer;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--primary-maroon);
    color: white;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: white;
}

.sidebar-header .mobile-menu-btn {
    display: block;
    color: white;
}

/* Sidebar Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.sidebar-nav a {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text-dark);
    font-weight: 600;
    transition: background 0.2s;
    text-decoration: none;
    display: block;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: #FFFBF0;
    color: var(--primary-maroon);
    border-left: 4px solid var(--accent-gold);
}

/* SIDEBAR (Ensure it is hidden off-screen or display:none) */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background: white;
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    display: block;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    display: none;
}

.sidebar-overlay.visible {
    display: block;
}

/* ==================== 3. STICKY NAVIGATION ==================== */
.top-nav {
    background: var(--primary-maroon);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 0;
}

.nav-link {
    color: white;
    padding: 1rem 1.8rem;
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 4px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.9;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(0, 0, 0, 0.2);
    border-bottom-color: var(--accent-gold);
    opacity: 1;
}

.nav-link span {
    font-size: 1.1rem;
}

/* ==================== 4. HORIZONTAL LEADERSHIP STRIP (STRICT SINGLE LINE) ==================== */
.leadership-strip {
    background: linear-gradient(to bottom, #FFFFFF, #FFFBF0);
    border-bottom: 1px solid #E5E7EB;
    padding: 1rem 0;
}

.leadership-inline {
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-wrap: nowrap;
    /* FORCE SINGLE LINE */
    gap: 1.5rem;
    /* Clean spacing */
    justify-content: flex-start;
    /* LEFT ALIGNED */
    align-items: flex-start;
    padding: 0 2rem;
    overflow-x: auto;
    /* Enable scroll if screen is too small */
    scrollbar-width: none;
}

.leadership-inline::-webkit-scrollbar {
    display: none;
}

.leader-item {
    flex: 0 0 auto;
    /* Never shrink */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 110px;
}

.leader-item:hover {
    transform: translateY(-3px);
}

.leader-img {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-gold);
    margin-bottom: 0.5rem;
    background: white;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}

.leader-info span {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--primary-maroon);
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
    white-space: normal;
}

.leader-info p {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1F2937;
    line-height: 1.2;
    white-space: normal;
}

/* ==================== 5. MAIN CONTENT CONTAINER ==================== */
.main-wrapper {
    max-width: var(--container-width);
    margin: 2rem auto;
    padding: 0 2rem;
}

.section-title {
    font-size: 1.75rem;
    border-left: 5px solid var(--primary-maroon);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
    /* Reduced from 2rem */
    display: flex;
    align-items: center;
}

/* ==================== 6. HERO SECTION (2-COL GRID) ==================== */
.hero-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 4rem;
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.slideshow {
    width: 100%;
    height: 400px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
}

.slideshow img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    /* Now static text on the left */
    position: static;
    background: none;
    padding: 0;
    color: var(--text-dark);
    text-align: left;
    display: block;
}

.hero-overlay h2 {
    font-size: 3rem;
    color: var(--primary-maroon);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-btn {
    background: var(--primary-maroon);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 1rem;
}

.hero-btn:hover {
    background: #600000;
    transform: translateY(-2px);
}

/* Full Screen Hero Styles Removed - Reverted to Grid */

/* ==================== 7. DETAILED CENSUS CARDS ==================== */
.census-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.census-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--accent-gold);
    overflow: hidden;
    transition: transform 0.2s;
}

.census-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.census-header {
    background: #FFFBF0;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--accent-gold);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.census-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary-maroon);
}

.census-body {
    padding: 1.5rem;
}

.census-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.census-row:last-child {
    border-bottom: none;
}

.c-label {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.c-val {
    font-weight: 700;
    color: var(--primary-maroon);
    font-size: 1.1rem;
}

.census-row.highlight .c-val {
    color: #b91c1c;
    /* Brighter red */
}

.total-card {
    border: 2px solid var(--primary-maroon);
}

.total-card .census-header {
    background: var(--primary-maroon);
}

.total-card .census-header h3 {
    color: white;
}

.total-card .census-icon {
    filter: grayscale(1) brightness(200%);
}

/* ==================== 8. MEMBERS GRID ==================== */
.gp-members-home-grid,
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.member-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-align: center;
    padding-bottom: 1.5rem;
    transition: transform 0.2s;
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.member-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    object-position: top;
    border-bottom: 3px solid var(--accent-gold);
}

.member-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-maroon);
    margin: 1rem 0 0.25rem 0;
    padding: 0 1rem;
}

.member-designation {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==================== 9. SCHEMES & ALERTS ==================== */
.schemes-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.scheme-card-box {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-maroon);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

/* Fix Scheme Icon Size */
.scheme-logo,
.scheme-icon {
    width: 60px;
    /* Reduced specific size */
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.scheme-card-box:hover {
    background: #FFFBF0;
    transform: translateX(5px);
}

.info-item {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
}

/* ==================== 10. FOOTER ==================== */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer h3 {
    color: var(--accent-gold);
    margin-bottom: 1rem;
}

.footer a {
    color: #D1D5DB;
}

.footer a:hover {
    color: white;
    text-decoration: underline;
}

/* ==================== 11. RESPONSIVE DESIGN (MOBILE FIRST FIXES) ==================== */

/* Tablet & Mobile (max-width: 1024px) */
@media (max-width: 1024px) {
    .header-top {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .hero-section {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .slideshow {
        height: 300px;
        order: -1; /* Image on top */
    }

    .hero-overlay {
        text-align: center;
        padding-top: 1rem;
    }

    .hero-overlay h2 {
        font-size: 2rem;
    }
}

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
    
    /* --- HEADER & NAV --- */
    .header {
        position: sticky; /* Sticky Header */
        top: 0;
        z-index: 1000;
        flex-direction: column;
        align-items: center;
        padding: 0.5rem 1rem;
        height: auto;
        min-height: auto;
        border-bottom: 2px solid var(--accent-gold);
    }

    .header-left {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
        text-align: center;
    }

    .gp-logo {
        width: 60px;
        height: 60px;
    }

    .village-title {
        font-size: 1.4rem;
        text-align: center;
    }

    .sub-title {
        font-size: 0.8rem;
        text-align: center;
        display: block;
    }

    /* Hide ID codes on mobile to clean up */
    .header-center {
        display: none; 
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
        padding-top: 0.5rem;
        border-top: 1px solid #eee;
        gap: 0.5rem;
    }

    .rajmudra-logo {
        height: 45px;
    }

    .lang-select {
        padding: 8px;
        font-size: 0.9rem;
    }

    .mobile-menu-btn {
        display: block;
        padding: 10px; /* Larger touch target */
    }

    /* Hide Desktop Nav Bar */
    .top-nav {
        display: none;
    }

    /* --- LAYOUT STACKING --- */
    .main-wrapper {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    .section-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    /* Leadership Strip - Horizontal Scroll with Snapping */
    .leadership-strip {
        padding: 0.5rem 0;
    }

    .leadership-inline {
        gap: 1rem;
        padding: 0 1rem;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        animation: none; /* Disable marquee for better UX */
    }

    .leader-item {
        scroll-snap-align: start;
        min-width: 100px;
    }

    .leader-img {
        width: 65px;
        height: 65px;
    }

    /* Home Grid Stacking */
    .census-cards-container,
    .gp-members-home-grid,
    .schemes-row,
    .footer-container,
    .contact-grid,
    .gallery-grid,
    .self-declaration-grid,
    .emergency-helpline-container {
        grid-template-columns: 1fr; /* Stack vertically */
        gap: 1.5rem;
    }

    /* Cards */
    .census-card, 
    .member-card, 
    .scheme-card-box, 
    .contact-card, 
    .gallery-card {
        width: 100%;
        margin: 0 auto;
    }

    /* Scheme Box */
    .scheme-card-box {
        flex-direction: row; /* Keep icon and text side-by-side */
        align-items: center;
        padding: 1rem;
        min-height: 80px; /* Touch target */
    }

    /* --- BUTTONS & TOUCH --- */
    button, 
    .hero-btn, 
    .nav-link, 
    .declaration-download-btn,
    .scheme-link-external,
    .back-btn {
        min-height: 44px; /* Touch friendly */
        font-size: 1rem;
    }

    /* --- FOOTER --- */
    .footer {
        padding: 2rem 1rem;
        text-align: center;
    }

    .footer-container {
        gap: 2rem;
    }

    .helpline-list {
        text-align: left;
        display: inline-block;
    }

    /* --- TABLES --- */
    .revenue-table-container {
        overflow-x: auto;
        display: block;
    }
    
    .revenue-services-table th,
    .revenue-services-table td {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
}

/* Small Mobile (max-width: 380px) */
@media (max-width: 380px) {
    .village-title {
        font-size: 1.2rem;
    }
    
    .gp-logo {
        width: 50px;
        height: 50px;
    }
    
    .hero-overlay h2 {
        font-size: 1.6rem;
    }
}

/* ==================== 12. ANIMATIONS & UI UPDATES ==================== */
/* Enhanced Leadership Marquee */
.leadership-strip {
    overflow: hidden;
    position: relative;
    padding: 1rem 0;
    white-space: nowrap;
}

.leadership-inline {
    display: inline-flex;
    /* changed from flex to inline-flex for marquee width */
    gap: 3rem;
    /* Increased gap for better separation */
    animation: marquee 35s linear infinite;
    width: max-content;
    /* Ensure it takes full width of content */
    padding-left: 100%;
    /* Start from right side */
}

.leadership-inline:hover {
    animation-play-state: paused;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Circular Member Images */
.member-card {
    text-align: center;
    padding: 1.5rem;
}

.member-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem auto;
    border: 4px solid var(--accent-gold);
    box-shadow: var(--shadow-md);
}

.member-name {
    margin-top: 0.5rem;
}

/* ==================== 13. GALLERY STYLES ==================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.gallery-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    height: 200px;
    /* Fixed height for uniformity */
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-gold);
}

.gallery-card:hover img {
    transform: scale(1.05);
}

/* Lightbox */
.gallery-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    border: 4px solid var(--accent-gold);
    border-radius: var(--radius-md);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    font-weight: bold;
}

/* ==================== 14. TABLE STYLES (Government) ==================== */
.revenue-table-container {
    width: 100%;
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.revenue-services-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.95rem;
}

.revenue-services-table thead {
    background: var(--primary-maroon);
    color: white;
}

.revenue-services-table thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    border-bottom: 4px solid var(--accent-gold);
    white-space: nowrap;
}

.revenue-services-table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.revenue-services-table tbody td {
    padding: 1rem;
    color: var(--text-dark);
    vertical-align: top;
    border-right: 1px solid #eee;
}

.revenue-services-table tbody tr:nth-child(even) {
    background-color: #FFFBF0;
    /* Light Gold Tint */
}

.revenue-services-table tbody tr:hover {
    background-color: #f0f0f0;
}

/* ==================== 15. CONTACT & MISC ==================== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.contact-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary-maroon);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.emergency-helpline-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.emergency-helpline-card {
    background: linear-gradient(135deg, #FFF 0%, #FFFBF0 100%);
    border: 1px solid var(--accent-gold);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.emergency-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-maroon);
}

/* ==================== 16. SCHEME DETAILS & CONTENT PAGES ==================== */
.self-declaration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.self-declaration-card {
    background: white;
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary-maroon);
    border-radius: var(--radius-md);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
    height: 100%;
}

.self-declaration-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-gold);
}

.declaration-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-maroon);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.declaration-download-btn {
    background: var(--bg-light);
    color: var(--primary-maroon);
    border: 2px solid var(--primary-maroon);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    width: 100%;
    margin-top: auto;
    /* Push to bottom */
}

.declaration-download-btn:hover {
    background: var(--primary-maroon);
    color: white;
}

.scheme-detail-box {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.scheme-detail-box h3 {
    color: var(--primary-maroon);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 0.5rem;
}

.detail-subtitle {
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.detail-list {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-list li {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.scheme-link-external,
.back-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-maroon);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    margin-top: 1.5rem;
    text-align: center;
}

.scheme-link-external:hover,
.back-btn:hover {
    background: #600000;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.back-btn {
    background: var(--text-muted);
    /* Different color for back button */
    margin-bottom: 1rem;
    margin-top: 0;
}

.back-btn:hover {
    background: var(--text-dark);
}