/* ========================================
   DEMOGRAPHY MODULE - VILLAGE PROFILE
   ======================================== */

/* Demography card */
.demography-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.demography-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6f42c1, #5a32a3);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.demography-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #6f42c1;
}

.demography-card h5 {
    color: #6f42c1;
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: relative;
    padding-bottom: 0.5rem;
}

.demography-card h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: #6f42c1;
    border-radius: 1px;
}

/* Population stats */
.population-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .population-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.stat-box.total::before { background: #007bff; }
.stat-box.male::before { background: #28a745; }
.stat-box.female::before { background: #dc3545; }
.stat-box.families::before { background: #ffc107; }

.stat-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-box.total .stat-icon { color: #007bff; }
.stat-box.male .stat-icon { color: #28a745; }
.stat-box.female .stat-icon { color: #dc3545; }
.stat-box.families .stat-icon { color: #ffc107; }

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-box.total .stat-number { color: #007bff; }
.stat-box.male .stat-number { color: #28a745; }
.stat-box.female .stat-number { color: #dc3545; }
.stat-box.families .stat-number { color: #ffc107; }

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Age distribution */
.age-distribution {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.age-groups {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .age-groups {
        grid-template-columns: repeat(3, 1fr);
    }
}

.age-group {
    text-align: center;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.age-number {
    font-size: 1.25rem;
    font-weight: 600;
    color: #6f42c1;
    margin-bottom: 0.25rem;
}

.age-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Education chart */
.education-section {
    margin-bottom: 1.5rem;
}

.education-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.education-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.education-label {
    min-width: 120px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.education-progress {
    flex: 1;
    height: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.education-fill {
    height: 100%;
    background: linear-gradient(90deg, #6f42c1, #5a32a3);
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

.education-value {
    min-width: 60px;
    text-align: right;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Gender ratio */
.gender-ratio {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.gender-box {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.gender-box.male {
    border-top: 3px solid #28a745;
}

.gender-box.female {
    border-top: 3px solid #dc3545;
}

.gender-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.gender-box.male .gender-icon { color: #28a745; }
.gender-box.female .gender-icon { color: #dc3545; }

.gender-percentage {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.gender-box.male .gender-percentage { color: #28a745; }
.gender-box.female .gender-percentage { color: #dc3545; }

/* Chart container */
.chart-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: 300px;
}

/* Data year indicator */
.data-year {
    display: inline-block;
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Mobile responsive */
@media (max-width: 767px) {
    .demography-card {
        padding: 1rem;
    }
    
    .population-stats {
        grid-template-columns: 1fr;
    }
    
    .age-groups {
        grid-template-columns: 1fr;
    }
    
    .stat-box {
        padding: 1rem 0.75rem;
    }
    
    .stat-icon {
        font-size: 1.5rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .education-label {
        min-width: 80px;
        font-size: 0.75rem;
    }
    
    .education-progress {
        height: 20px;
    }
    
    .education-fill {
        font-size: 0.7rem;
    }
    
    .gender-ratio {
        flex-direction: column;
    }
    
    .gender-icon {
        font-size: 2rem;
    }
    
    .gender-percentage {
        font-size: 1.5rem;
    }
}


