/* ===================================
   SECTION STATS - Statistiques principales
   =================================== */

.stats {
    padding: var(--space-20) 0;
    background: linear-gradient(
        135deg,
        var(--bg-primary) 0%,
        var(--bg-secondary) 50%,
        var(--bg-primary) 100%
    );
    position: relative;
}

.stats::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(249, 115, 22, 0.05) 50%,
        transparent 100%
    );
}

.stats__container {
    position: relative;
    z-index: 10;
}

.stats__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-8);
}

/* ===== ITEM STATISTIQUE ===== */
.stats__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-6);
    border-radius: var(--radius-2xl);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stats__item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.stats__item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(249, 115, 22, 0.3);
}

.stats__item:hover::before {
    opacity: 0.1;
}

.stats__icon {
    position: relative;
    z-index: 10;
    width: 4rem;
    height: 4rem;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: var(--space-4);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-lg);
}

.stats__item:hover .stats__icon {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.6);
}

.stats__icon .icon {
    width: 1.5rem;
    height: 1.5rem;
}

.stats__number {
    position: relative;
    z-index: 10;
    font-size: var(--font-4xl);
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--space-2);
    transition: color var(--transition-normal);
}

.stats__item:hover .stats__number {
    color: var(--primary-orange);
}

.stats__label {
    position: relative;
    z-index: 10;
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--text-muted);
    transition: color var(--transition-normal);
}

.stats__item:hover .stats__label {
    color: var(--text-secondary);
}

/* ===== ANIMATIONS ===== */
@keyframes statsCounter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats__item {
    animation: statsCounter 0.8s ease-out forwards;
}

.stats__item:nth-child(1) {
    animation-delay: 0.1s;
}

.stats__item:nth-child(2) {
    animation-delay: 0.2s;
}

.stats__item:nth-child(3) {
    animation-delay: 0.3s;
}

.stats__item:nth-child(4) {
    animation-delay: 0.4s;
}

/* Animation du compteur */
@keyframes countUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.stats__number[data-animate] {
    overflow: hidden;
    display: inline-block;
}

.stats__number[data-animate] span {
    display: inline-block;
    animation: countUp 0.6s ease-out forwards;
}

/* ===== EFFET DE PULSATION ===== */
@keyframes statsPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(249, 115, 22, 0);
    }
}

.stats__icon::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid var(--primary-orange);
    border-radius: var(--radius-full);
    opacity: 0;
    animation: statsPulse 2s infinite;
}

.stats__item:hover .stats__icon::after {
    animation-play-state: paused;
    opacity: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .stats__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
    
    .stats__icon {
        width: 3.5rem;
        height: 3.5rem;
    }
    
    .stats__number {
        font-size: var(--font-3xl);
    }
}

@media (max-width: 768px) {
    .stats {
        padding: var(--space-16) 0;
    }
    
    .stats__grid {
        gap: var(--space-4);
    }
    
    .stats__item {
        padding: var(--space-4);
    }
    
    .stats__icon {
        width: 3rem;
        height: 3rem;
        margin-bottom: var(--space-3);
    }
    
    .stats__icon .icon {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .stats__number {
        font-size: var(--font-2xl);
    }
    
    .stats__label {
        font-size: var(--font-sm);
    }
}

@media (max-width: 480px) {
    .stats__grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
        max-width: 300px;
        margin: 0 auto;
    }
    
    .stats__item {
        padding: var(--space-3);
    }
    
    .stats__icon {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .stats__number {
        font-size: var(--font-xl);
    }
}

/* ===== VARIANTES ===== */
.stats--dark {
    background: var(--bg-black);
}

.stats--transparent {
    background: transparent;
}

.stats--gradient {
    background: linear-gradient(
        135deg,
        var(--bg-primary) 0%,
        var(--bg-secondary) 100%
    );
}

/* ===== ÉTATS SPÉCIAUX ===== */
.stats__item--featured {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.3);
}

.stats__item--featured .stats__icon {
    background: var(--gradient-primary);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.4);
}

.stats__item--featured .stats__number {
    color: var(--primary-orange);
}

/* ===== ACCESSIBILITÉ ===== */
@media (prefers-reduced-motion: reduce) {
    .stats__item,
    .stats__icon,
    .stats__number span {
        animation: none;
    }
    
    .stats__item:hover {
        transform: none;
    }
    
    .stats__item:hover .stats__icon {
        transform: none;
    }
    
    .stats__icon::after {
        animation: none;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .stats {
        background: white;
        padding: var(--space-4) 0;
    }
    
    .stats::before {
        display: none;
    }
    
    .stats__item {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
    }
    
    .stats__icon {
        background: #333;
        box-shadow: none;
    }
    
    .stats__number {
        color: black;
    }
    
    .stats__label {
        color: #666;
    }
}