/* TEMPLATE 1: "SOFT HORIZON" THEME - PROFESSIONAL & ATTRACTIVE */

/* 1. ROOT VARIABLES & PALETTE */
:root {
    /* Primary Canvas Colors (Light, Faint, Smooth) */
    --bg-main: #F0F4F8;
    /* Very smooth light blue-grey */
    --bg-white: #FFFFFF;
    /* Crisp white for cards/sidebar */

    /* Text Colors */
    --text-dark: #1E293B;
    /* Slate 800 - High contrast */
    --text-medium: #475569;
    /* Slate 600 - Secondary text */
    --text-light: #94A3B8;
    /* Slate 400 - Muted */

    /* Brand / Accent Colors */
    --brand-primary: #0EA5E9;
    /* Sky Blue 500 - Fresh, professional */
    --brand-secondary: #0284C7;
    /* Sky Blue 600 - Hover states */
    --brand-gradient: linear-gradient(135deg, #0EA5E9 0%, #2563EB 100%);
    /* Blue to Royal Blue */
    --brand-subtle: #E0F2FE;
    /* Sky 100 - Active backgrounds */
    --bg-soft-blue: #E3F2FD;
    /* Soft Blue for Header/Footer */

    /* Functional Colors */
    --accent-warning: #F59E0B;
    --accent-success: #10B981;
    --accent-danger: #EF4444;

    /* Spacing & Layout */
    --sidebar-width: 280px;
    --header-height: 80px;
    --radius-card: 16px;
    --shadow-soft: 0 4px 20px rgba(148, 163, 184, 0.1);
    --shadow-hover: 0 10px 25px rgba(148, 163, 184, 0.2);
}

/* 2. GLOBAL RESET & BASE STYLES */
body {
    background-color: #F8FAFC;
    /* Very subtle slate white */
    color: var(--text-dark);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 3. APP CONTAINER & LAYOUT */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styling - "Professional Vertical" */
.vertical-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-soft-blue);
    /* Matching header/footer */
    height: 100vh;
    /* Full viewport height */
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.03);
    z-index: 50;
    padding: 24px 0;
    flex-shrink: 0;
    overflow-y: auto;
}

.vertical-nav-item {
    display: flex;
    align-items: center;
    padding: 16px 32px;
    color: var(--text-medium);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease-in-out;
    border-right: 3px solid transparent;
    cursor: pointer;
    margin-bottom: 4px;
}

.vertical-nav-item .icon {
    font-size: 1.25rem;
    margin-right: 16px;
    width: 24px;
    display: flex;
    justify-content: center;
    color: #94A3B8;
    transition: color 0.2s;
}

/* Hover & Active States */
.vertical-nav-item:hover {
    background: #F8FAFC;
    color: var(--brand-primary);
}

.vertical-nav-item:hover .icon {
    color: var(--brand-primary);
    transform: scale(1.1);
}

.vertical-nav-item.active,
.vertical-nav-item.selected {
    background: #FFFFFF;
    color: var(--brand-secondary);
    border-right-color: var(--brand-secondary);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    /* Slight lift */
}

.vertical-nav-item.active .icon,
.vertical-nav-item.selected .icon {
    color: var(--brand-secondary);
}

/* Main Content Wrapper */
.main-wrapper {
    flex-grow: 1;
    background: #F8FAFC;
    /* Match body */
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Prevents overflow in flex items */
}

/* 4. HEADER STYLING - "Clean & Modern" */
.header {
    background: var(--bg-soft-blue);
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Softer, broader shadow */
    position: relative;
    z-index: 40;
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}

.header-container {
    max-width: 100%;
    margin: 0;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 40px;
    gap: 24px;
}

/* Flex Order Overrides for Perfect Alignment */
.village-title-container {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1.5;
    /* Prioritize width */
}

.gp-logo {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background: white;
    padding: 4px;
    /* Frame */
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.village-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0F172A;
    /* Slate 900 */
    line-height: 1.2;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
    /* Crisp edge */
}

/* Central Identity Block (LGD ID) */
.id-center {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #FFFFFF;
    padding: 10px 28px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.8);
    min-width: 180px;
    transform: translateY(0);
    transition: transform 0.3s;
}

.id-center:hover {
    transform: translateY(-2px);
}

.id-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #64748B;
    font-weight: 800;
    margin-bottom: 4px;
}

.id-value {
    font-size: 2rem;
    font-weight: 800;
    color: #0284C7;
    /* Brand Blue */
    font-family: 'Poppins', sans-serif;
    line-height: 1;
}

/* Right Side - Seal & Language */
.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 24px;
}

.seal-lang-container {
    display: flex;
    align-items: center;
    gap: 16px;
    /* Optional: Contain them visually if desired, 
       but user liked "faint smooth colours", so open might be better. 
       Let's keep them open but distinct. */
}

.rajya-mudra-logo {
    width: 52px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.lang-select {
    background: #ffffff;
    border: 1px solid #CBD5E1;
    color: #0F172A;
    padding: 8px 18px;
    border-radius: 50px;
    /* Pill shape */
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
    outline: none;
    appearance: none;
    /* Custom dropdown arrow handling usually needs background image */
}

.lang-select:hover {
    border-color: #0EA5E9;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
    transform: translateY(-1px);
}

/* Hide old Leadership row to reduce clutter/height */
.leadership-row,
.header-bottom {
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    padding: 8px 0;
    display: none !important;
    /* User wants new unique look, maybe hide legacy strip */
}

/* If user definitely wants the strip, remove 'display: none'. Assuming keeping it for functionality but styling it: */
.leadership-row {
    display: block !important;
    background: #fff;
    border-top: 1px solid #f1f5f9;
}

.leadership-inline {
    justify-content: center !important;
    gap: 24px !important;
}

.leadership-inline .leader-item:hover {
    transform: translateY(-2px);
}

/* 5. CONTENT AREA STYLES */
.content-area {
    padding: 32px 40px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Hero Section */
.hero-section {
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    margin-bottom: 32px;
    position: relative;
    border: 4px solid var(--bg-white);
    /* Frame effect */
    background: white;
}

.hero-overlay h2 {
    font-family: 'Poppins', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Split Layout */
.content-split {
    display: grid;
    grid-template-columns: 1fr 360px;
    /* Fixed width sidebar */
    gap: 32px;
    align-items: start;
    margin-bottom: 32px;
}

/* Cards - "Professional White" */
.cream-card,
.white-card {
    background: var(--bg-white);
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cream-card:hover {
    /* Slight lift on hover */
    box-shadow: var(--shadow-hover);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #F1F5F9;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--brand-primary);
}

/* Members Grid */
.gp-members-home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    /* Force nice grid */
    gap: 20px !important;
}

/* Member Card Styling */
.gp-members-home-grid .member-card {
    background: #F8FAFC;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid #E2E8F0;
    transition: all 0.2s;
}

.gp-members-home-grid .member-card:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--brand-secondary);
    transform: translateY(-2px);
}

.gp-members-home-grid .member-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 12px;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Population Sidebar */
.population-card {
    border-top: 5px solid var(--brand-primary);
    border-left: none;
    /* remove old style */
}

.pop-sidebar-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pop-sidebar-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #F8FAFC;
    border-radius: 8px;
}

.pop-sidebar-value {
    font-weight: 700;
    color: var(--brand-secondary);
}

/* Schemes Row */
.schemes-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.scheme-card-box {
    background: var(--bg-white);
    padding: 32px 20px;
    border-radius: var(--radius-card);
    text-align: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: all 0.3s;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.scheme-card-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-primary);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.scheme-card-box:hover::before {
    transform: scaleX(1);
}

.scheme-card-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.scheme-card-box h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Alerts Section */
.alerts-section {
    background: var(--bg-white);
    padding: 32px;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    margin-bottom: 40px;
}

/* 6. FOOTER - SOFT BLUE THEME */
.footer {
    background: var(--bg-soft-blue);
    color: var(--text-dark);
    padding: 60px 0 30px;
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* ensure min width for text */
    gap: 40px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
}

.footer h3 {
    color: var(--brand-secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-left: 3px solid var(--brand-primary);
    padding-left: 12px;
}

/* Fix for Cropped Text */
.helpline-list li,
.footer p {
    white-space: normal;
    /* Allow wrapping */
    overflow: visible;
    text-overflow: clip;
}

/* Emergency Components (Contact Page / Generic) */
.emergency-helpline-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.emergency-helpline-card {
    background: #FEF2F2;
    /* Soft red bg */
    border: 1px solid #FECACA;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}

.emergency-helpline-card:hover {
    border-color: var(--accent-danger);
    transform: translateY(-2px);
}

.emergency-icon {
    font-size: 2rem;
}

.emergency-service {
    margin: 0;
    font-size: 1rem;
    color: #991B1B;
    font-weight: 700;
}

.emergency-number {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #EF4444;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .content-split {
        grid-template-columns: 1fr;
    }

    .vertical-sidebar {
        display: none;
    }

    .app-container {
        flex-direction: column;
    }

    .content-area,
    .header-top {
        padding: 16px;
    }

    .id-center {
        display: none;
        /* Hide on mobile to save space if needed */
    }
}