/* Displacement Demographics Styling */

.demographics-section {
    font-family: Arial, sans-serif;
}

.demo-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.demo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.demo-icon {
    font-size: 1rem;
}

.demo-icon i {
    font-size: 1.2rem;
}

.demo-value {
    font-weight: 700;
    color: #28a745;
}

/* Age and Gender Chart Container */
#age_gender_chart {
    width: 100%;
    height: 250px;
    margin: 1rem 0;
}

/* Countries of Origin Styling */
.origin-countries {
    max-height: 400px;
    overflow-y: auto;
}

.origin-item {
    padding: 0;
}

.origin-item:not(:last-child) {
    border-bottom: 1px solid #e9ecef;
}

.origin-item .progress-wrapper {
    position: relative;
}

.origin-item .progress {
    background-color: #e9ecef;
    border-radius: 4px;
    position: relative;
}

.origin-item .progress-bar {
    background-color: #28a745 !important;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    transition: width 0.6s ease;
}

.origin-item .progress-bar span {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    font-weight: bold;
}

.origin-item .origin-value-outside-left {
    position: absolute;
    left: calc(var(--bar-width) + 5px);
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .demographics-section .row {
        margin-bottom: 0.5rem;
    }
    
    .demo-card {
        padding: 1rem !important;
    }
    
    #age_gender_chart {
        height: 200px;
    }
}

/* Scrollbar styling for origin countries */
.origin-countries::-webkit-scrollbar {
    width: 6px;
}

.origin-countries::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.origin-countries::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.origin-countries::-webkit-scrollbar-thumb:hover {
    background: #555;
}