:root {
    --primary: #6366f1;
    /* Indigo */
    --accent: #22d3ee;
    /* Cyan */
    --bg: #0b0f1a;
    /* Deep Midnight */
    --card-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --selection: #8b5cf6;
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    --glow: rgba(99, 102, 241, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Glass Background Effect */
.glass-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 0% 0%, #1e1b4b 0%, #0b0f1a 100%);
    z-index: -1;
}

.glass-background::before,
.glass-background::after {
    content: '';
    position: absolute;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    z-index: -1;
}

.glass-background::before {
    background: var(--primary);
    top: -10%;
    right: -10%;
    animation: pulse 15s infinite alternate;
}

.glass-background::after {
    background: var(--selection);
    bottom: -10%;
    left: -10%;
    animation: pulse 12s infinite alternate-reverse;
}

@keyframes pulse {
    from {
        transform: scale(1);
        opacity: 0.1;
    }

    to {
        transform: scale(1.2);
        opacity: 0.2;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header Styling */
.main-header {
    text-align: center;
    padding: 4rem 0 3rem;
    position: relative;
}

.logo-malayalam {
    font-family: 'Chilanka', cursive;
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--text-main), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.1rem;
}

.logo-sub-malayalam {
    font-family: 'Chilanka', cursive;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}


/* Stats Ribbon */
.stats-ribbon {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(10px);
}

.stat-card i {
    width: 2.2rem;
    height: 2.2rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 0.75rem;
    color: var(--accent);
}

.stat-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

/* Controls */
.controls {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.search-wrapper {
    flex: 1;
    position: relative;
    min-width: 300px;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 1.2rem;
}

#search-bar {
    width: 100%;
    padding: 1.25rem 1.25rem 1.25rem 3.5rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

#search-bar:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 25px var(--glow);
}

.filter-group {
    display: flex;
    gap: 1rem;
}

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

.filter-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    width: 1rem;
    pointer-events: none;
}

select {
    padding: 1.25rem 2.5rem 1.25rem 2.5rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    color: white;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

select:focus {
    border-color: var(--primary);
}

select option {
    background: #1e1b4b;
    /* Solid Navy */
    color: white;
}

/* Loader */
.loader {
    text-align: center;
    padding: 5rem;
    color: var(--text-muted);
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

/* Village Card (Bento Style) */
.village-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    padding: 2rem;
    backdrop-filter: blur(15px);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: reveal 0.6s cubic-bezier(0.23, 1, 0.32, 1) backwards;
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.village-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--glow);
}

.village-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: 700;
}

.card-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.field.full-width {
    grid-column: 1 / -1;
}

.field-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    color: var(--text-muted);
    font-weight: 600;
}

.field-value {
    font-size: 0.95rem;
    color: var(--text-main);
}

.email-text {
    color: white;
    font-weight: 500;
    word-break: break-all;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 5rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .logo-malayalam {
        font-size: 2.25rem;
    }

    .stats-ribbon {
        grid-template-columns: 1fr;
    }

    .controls {
        flex-direction: column;
    }

    .search-wrapper {
        min-width: 100%;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
}