/* ========================================
   World Population Stats Box
   Compact overlay design on Hero
   ======================================== */

.world-stats-section {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    max-width: 650px;
    z-index: 15;
    padding: 0;
}

.world-stats-container {
    margin: 0;
    padding: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.stat-card {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card.population::before {
    color: var(--color-primary-500);
}

.stat-card.births::before {
    color: #10b981;
}

.stat-card.deaths::before {
    color: var(--color-accent-500);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(15, 23, 42, 0.85);
}

.stat-card:hover::before {
    opacity: 1;
}

/* Icons using SVG or Unicode */
.stat-icon {
    width: 24px;
    height: 24px;
    margin: 0 auto 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.stat-card.population .stat-icon {
    color: var(--color-primary-400);
    filter: drop-shadow(0 0 8px var(--color-primary-500));
    opacity: 1;
}

.stat-card.births .stat-icon {
    color: #10b981;
    filter: drop-shadow(0 0 8px #10b981);
    opacity: 1;
}

.stat-card.deaths .stat-icon {
    color: var(--color-accent-400);
    filter: drop-shadow(0 0 8px var(--color-accent-500));
    opacity: 1;
}

.stat-label {
    font-family: var(--font-sans);
    font-size: 0.5625rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stat-number {
    font-family: var(--font-display);
    font-size: clamp(1rem, 2vw, 1.375rem);
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.stat-change {
    font-family: var(--font-sans);
    font-size: 0.5625rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.25rem;
    font-weight: 400;
}

.stat-change.positive {
    color: #10b981;
}

.stat-change.negative {
    color: #f87171;
}

/* Animation for numbers */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-number.animate {
    animation: countUp 0.6s ease-out forwards;
}

/* Loading state */
.stat-card.loading .stat-number {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 25%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    color: transparent;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive Design */
@media (max-width: 968px) {
    .world-stats-section {
        bottom: 2rem;
        width: 95%;
        max-width: 700px;
    }
    
    .stats-grid {
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 0.875rem 1rem;
    }
}

@media (max-width: 640px) {
    .world-stats-section {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        width: 100%;
        max-width: none;
        padding: 2rem 1rem;
        margin-top: -3rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 28px;
        height: 28px;
        font-size: 1.25rem;
    }
}

/* RTL Support */
[dir="rtl"] .stat-label {
    letter-spacing: 0;
}

