/**
 * STYLES MODERNES POUR LES STATISTIQUES HERO BANNER
 * Design épuré et animations fluides
 */

/* ================================
   CONTAINER STATISTIQUES
=============================== */

.hero-stats {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    animation: fadeInUp 1s ease-out 1.2s both;
    justify-content: flex-start;
    flex-wrap: nowrap;
    position: relative;
    z-index: 10;
}

/* ================================
   ITEMS STATISTIQUES
=============================== */

.stat-item {
    position: relative;
    text-align: left;
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(138, 76, 255, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(25px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex: 1;
    min-width: 0;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    cursor: default;
    user-select: none;
}

/* Effet de brillance au survol */
.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.6s ease;
    z-index: 1;
}

.stat-item:hover::before {
    left: 100%;
}

.stat-item:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(138, 76, 255, 0.4);
    box-shadow: 
        0 20px 60px rgba(138, 76, 255, 0.2),
        0 8px 25px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ================================
   NUMÉROS STATISTIQUES
=============================== */

.stat-number {
    font-size: 3.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #8a4cff, #ff8aff, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
    font-family: 'Inter', -apple-system, BlondeMacSystemFont, sans-serif;
    letter-spacing: -0.02em;
}

/* Ligne décorative sous le chiffre */
.stat-number::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #8a4cff, #ff8aff);
    border-radius: 2px;
    opacity: 0.6;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.stat-item:hover .stat-number::after {
    transform: scaleX(1);
}

/* Effet de glow pour les chiffres */
.stat-number::before {
    content: attr(data-target);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #8a4cff, #ff8aff, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(8px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.stat-item:hover .stat-number::before {
    opacity: 0.3;
}

/* ================================
   LABELS STATISTIQUES
=============================== */

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    position: relative;
    transition: all 0.3s ease;
    font-family: 'Inter', -apple-system, BlondeMacSystemFont, sans-serif;
}

.stat-item:hover .stat-label {
    color: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

/* Icône optionnelle pour les labels */
.stat-label::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: linear-gradient(45deg, #8a4cff, #ff8aff);
    border-radius: 50%;
    margin-right: 8px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.stat-item:hover .stat-label::before {
    transform: scale(1.2);
    opacity: 1;
}

/* ================================
   ANIMATIONS SPÉCIALES
=============================== */

/* Animation d'apparition des stats */
.stat-item {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    animation: statItemAppear 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.stat-item:nth-child(1) { animation-delay: 0.1s; }
.stat-item:nth-child(2) { animation-delay: 0.3s; }
.stat-item:nth-child(3) { animation-delay: 0.5s; }
.stat-item:nth-child(4) { animation-delay: 0.7s; }
.stat-item:nth-child(5) { animation-delay: 0.9s; }

@keyframes statItemAppear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animation de pulsation pendant le comptage */
.stat-animating .stat-number {
    animation: statNumberPulse 0.6s ease-in-out;
}

@keyframes statNumberPulse {
    0%, 100% { 
        transform: scale(1);
        filter: brightness(1);
    }
    50% { 
        transform: scale(1.1);
        filter: brightness(1.2);
    }
}

/* Effet de particules */
.stat-completed {
    position: relative;
}

.stat-completed::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, #8a4cff, #ff8aff, #00d4ff);
    border-radius: 25px;
    opacity: 0;
    z-index: -1;
    animation: statCompletionGlow 2s ease-in-out;
}

@keyframes statCompletionGlow {
    0%, 100% { 
        opacity: 0;
        transform: scale(1);
    }
    50% { 
        opacity: 0.2;
        transform: scale(1.05);
    }
}

/* ================================
   RESPONSIVE DESIGN
=============================== */

/* Tablette */
@media (max-width: 1024px) {
    .hero-stats {
        gap: 15px;
        justify-content: flex-start;
    }
    
    .stat-item {
        padding: 18px 20px;
    }
    
    .stat-number {
        font-size: 2.6rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .hero-stats {
        gap: 12px;
        margin-top: 30px;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }
    
    .stat-item {
        padding: 15px 18px;
        border-radius: 16px;
    }
    
    .stat-number {
        font-size: 2.2rem;
        margin-bottom: 8px;
    }
    
    .stat-label {
        font-size: 0.75rem;
        letter-spacing: 1px;
    }
    
    .stat-item:hover {
        transform: translateY(-5px) scale(1.01);
    }
}

/* Très petit mobile */
@media (max-width: 480px) {
    .hero-stats {
        gap: 8px;
        margin-top: 25px;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }
    
    .stat-item {
        padding: 12px 15px;
        border-radius: 14px;
    }
    
    .stat-number {
        font-size: 1.8rem;
        margin-bottom: 6px;
    }
    
    .stat-label {
        font-size: 0.7rem;
        letter-spacing: 0.8px;
    }
    
    .stat-item:hover {
        transform: translateY(-3px) scale(1.005);
    }
}

/* ================================
   THÈMES ALTERNATIFS
=============================== */

/* Thème sombre alternatif */
.stat-item.theme-dark {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

.stat-item.theme-dark:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Thème coloré */
.stat-item.theme-colorful {
    background: linear-gradient(135deg, 
        rgba(138, 76, 255, 0.1), 
        rgba(255, 138, 255, 0.05)
    );
    border: 1px solid rgba(138, 76, 255, 0.3);
}

.stat-item.theme-colorful:hover {
    background: linear-gradient(135deg, 
        rgba(138, 76, 255, 0.2), 
        rgba(255, 138, 255, 0.1)
    );
    border-color: rgba(138, 76, 255, 0.5);
}

/* ================================
   ACCESSIBILITÉ
=============================== */

/* Réduire les animations pour les utilisateurs sensibles */
@media (prefers-reduced-motion: reduce) {
    .stat-item,
    .stat-number,
    .stat-label {
        animation: none !important;
        transition: none !important;
    }
    
    .stat-item::before,
    .stat-item::after,
    .stat-number::before,
    .stat-number::after,
    .stat-label::before {
        animation: none !important;
        transition: none !important;
    }
}

/* Mode contraste élevé */
@media (prefers-contrast: high) {
    .stat-item {
        border-width: 2px;
        background: rgba(255, 255, 255, 0.1);
    }
    
    .stat-number {
        -webkit-text-fill-color: #ffffff;
        color: #ffffff;
    }
    
    .stat-label {
        color: #ffffff;
    }
}

/* ================================
   PERFORMANCES
=============================== */

/* Optimisations GPU */
.stat-item {
    will-change: transform, box-shadow;
    transform: translateZ(0);
}

.stat-number {
    will-change: transform, filter;
}

/* Réduction des effets sur les appareils moins puissants */
@media (max-width: 768px) and (max-height: 600px) {
    .stat-item::before {
        display: none;
    }
    
    .stat-number::before {
        display: none;
    }
    
    .stat-completed::after {
        display: none;
    }
}
