/* MODERN PREHEADER STYLES */
.preheader {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #334155 100%);
    border-bottom: 2px solid #27AE5F;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    height: 56px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.preheader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(39, 174, 95, 0.1) 0%, 
        transparent 20%,
        transparent 80%,
        rgba(52, 211, 153, 0.1) 100%);
    animation: gradientFlow 4s ease-in-out infinite;
}

@keyframes gradientFlow {
    0%, 100% { opacity: 0.6; transform: translateX(-10px); }
    50% { opacity: 1; transform: translateX(10px); }
}

.preheader-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    position: relative;
    z-index: 2;
}

.preheader-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preheader-announcement {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.announcement-badge {
    background: linear-gradient(135deg, #27AE5F, #34D399);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.announcement-text {
    color: #E2E8F0;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
}

.announcement-icon {
    color: #34D399;
    font-size: 12px;
    animation: sparkle 3s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: rotate(0deg) scale(1); opacity: 0.8; }
    25% { transform: rotate(90deg) scale(1.1); opacity: 1; }
    50% { transform: rotate(180deg) scale(1); opacity: 0.8; }
    75% { transform: rotate(270deg) scale(1.1); opacity: 1; }
}

.preheader-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.preheader-stats {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    color: #94A3B8 !important;
    font-size: 12px !important;
    padding: 0 16px !important; /* Espacement plus visible pour éviter de toucher les bords */
    margin-right: 8px !important; /* Marge supplémentaire */
}

.preheader .stat-item {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 12px !important; /* Espacement interne plus généreux */
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    min-width: fit-content !important;
}

.preheader .stat-item:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(39, 174, 95, 0.2) !important;
}

.preheader .stat-value {
    color: #34D399;
    font-weight: 600;
}

/* DASHBOARD CTA PREHEADER - REDESIGNED TO MATCH STAT ITEMS */
.dashboard-cta-preheader {
    background: linear-gradient(135deg, #27AE5F 0%, #22C55E 50%, #34D399 100%) !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 18px !important; /* Même border-radius que les stat items */
    padding: 10px 14px !important; /* Même padding que les stat items */
    display: flex !important;
    align-items: center !important;
    gap: 8px !important; /* Gap réduit pour compacité */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 12px !important; /* Même taille que les stat items */
    font-weight: 600 !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(39, 174, 95, 0.3) !important; /* Même ombre que les stat items */
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    white-space: nowrap !important;
    height: auto !important; /* Hauteur automatique pour s'aligner */
    min-height: 36px !important; /* Hauteur minimale cohérente */
    margin-left: 8px !important; /* Espacement avec les stats */
}

.dashboard-cta-preheader::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent) !important;
    transition: left 0.6s !important;
}

.dashboard-cta-preheader:hover::before {
    left: 100% !important;
}

.dashboard-cta-preheader:hover {
    transform: translateY(-1px) !important; /* Même effet que les stat items */
    box-shadow: 0 4px 12px rgba(39, 174, 95, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: linear-gradient(135deg, #22C55E 0%, #27AE5F 50%, #16A34A 100%) !important;
}

.dashboard-cta-preheader .dashboard-icon {
    width: 18px !important; /* Taille réduite pour cohérence */
    height: 18px !important;
    background: rgba(255,255,255,0.25) !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 10px !important; /* Icône plus petite */
    backdrop-filter: blur(10px) !important;
}

.dashboard-cta-preheader .dashboard-content {
    font-weight: 600 !important; /* Cohérent avec les stat items */
    font-size: 12px !important; /* Même taille que les stat items */
    color: white !important;
}

.dashboard-cta-preheader .dashboard-arrow {
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: transform 0.3s ease !important;
}

.dashboard-cta-preheader:hover .dashboard-arrow {
    transform: translateX(2px) !important;
}

/* RESPONSIVE ADJUSTMENTS FOR SMALLER PREHEADER HEIGHT */
@media (max-width: 768px) {
    .preheader {
        height: 48px !important;
        font-size: 11px !important;
    }
    
    .preheader-container {
        padding: 8px 16px !important;
        gap: 8px !important;
    }
    
    .preheader-announcement {
        font-size: 11px !important;
        gap: 6px !important;
    }
    
    .announcement-badge {
        padding: 2px 6px !important;
        font-size: 9px !important;
    }
    
    .preheader-stats {
        display: none !important;
    }
    
    .dashboard-cta-preheader {
        padding: 6px 10px !important;
        font-size: 10px !important;
        min-height: 28px !important;
        gap: 4px !important;
    }
    
    .dashboard-cta-preheader .dashboard-content {
        font-size: 10px !important;
    }
    
    .dashboard-cta-preheader .dashboard-arrow {
        font-size: 8px !important;
    }
}

@media (max-width: 480px) {
    .preheader {
        height: 44px !important;
    }
    
    .preheader-container {
        padding: 6px 12px !important;
    }
    
    .preheader-announcement {
        font-size: 10px !important;
    }
    
    .announcement-text {
        display: none !important; /* Masquer le texte sur très petits écrans */
    }
    
    .dashboard-cta-preheader {
        padding: 5px 8px !important;
        font-size: 9px !important;
        min-height: 24px !important;
    }
    
    .dashboard-cta-preheader .dashboard-content {
        font-size: 9px !important;
    }
}

/* SECTION OVERRIDES POUR ASSURER LA COMPATIBILITÉ */

/* Mobile-specific adjustments are handled in navigation-fix.css */

/* FORCE STAT ITEM SPACING - OVERRIDE ANY CONFLICTS */
.preheader .preheader-right .preheader-stats {
    padding: 0 20px !important;
    margin-right: 12px !important;
}

.preheader .preheader-right .preheader-stats .stat-item {
    padding: 10px 14px !important;
    margin: 0 2px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 18px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.preheader .preheader-right .preheader-stats .stat-item i {
    margin-right: 4px !important;
}

/* ENHANCED MOBILE EXPERIENCE */
@media (max-width: 768px) {
    .preheader .preheader-right .preheader-stats {
        display: none !important;
    }
    
    .preheader .dashboard-cta-preheader {
        margin-left: 0 !important;
    }
}

/* ACCESSIBILITY IMPROVEMENTS */
.preheader a:focus,
.dashboard-cta-preheader:focus {
    outline: 2px solid #27AE5F !important;
    outline-offset: 2px !important;
}

/* PERFORMANCE OPTIMIZATIONS */
.preheader,
.preheader *,
.preheader *::before,
.preheader *::after {
    will-change: auto !important;
    backface-visibility: hidden !important;
}

/* HIGH CONTRAST MODE SUPPORT */
@media (prefers-contrast: high) {
    .preheader {
        border-bottom: 3px solid #27AE5F !important;
    }
    
    .announcement-badge {
        border: 1px solid white !important;
    }
    
    .dashboard-cta-preheader {
        border: 2px solid white !important;
    }
}

/* REDUCED MOTION SUPPORT */
@media (prefers-reduced-motion: reduce) {
    .preheader::before,
    .announcement-badge,
    .announcement-icon,
    .dashboard-cta-preheader::before {
        animation: none !important;
    }
    
    .stat-item,
    .dashboard-cta-preheader {
        transition: none !important;
    }
}

/* PRINT STYLES */
@media print {
    .preheader {
        display: none !important;
    }
}