:root {
    --fin-bg: #131722; --fin-panel: #1e222d; --fin-border: #2a2e39;
    --fin-text-muted: #787b86; --fin-text: #d1d4dc; --fin-text-light: #ffffff;
    --fin-green: #089981; --fin-red: #f23645; --fin-blue: #2962ff; --fin-gold: #ffd700;
    --fin-shadow: 0 8px 32px rgba(0, 0, 0, 0.9);
    --fin-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --fin-mono: "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
    --anim-speed: 0.4s; --anim-curve: cubic-bezier(0.16, 1, 0.3, 1);
}

.etea-unified-header-container * { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
body.etea-no-scroll { overflow: hidden; height: 100vh; position: fixed; width: 100%; }

/* --- STRUCTURE FIXE --- */
.etea-header-wrapper {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000 !important;
    background: var(--fin-bg); display: flex; flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5); overflow: visible !important;
}

#etea-scroll-progress-bar {
    position: absolute; bottom: 0; left: 0; width: 0%; height: 2px;
    background-color: var(--fin-blue); z-index: 100000;
    transition: width 0.1s linear, height 0.3s var(--anim-curve), background-color 0.3s ease, box-shadow 0.3s ease;
}

.etea-compact-nav { display: flex; align-items: center; gap: 5px; height: 100%; position: relative; }
.compact-link { position: relative; color: var(--fin-text-muted); text-decoration: none; font-size: 11px; font-weight: bold; font-family: var(--fin-mono); padding: 10px 12px; transition: all 0.3s ease; }
/* Barre bleue cachée par défaut */
.compact-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--fin-blue); transition: all 0.3s var(--anim-curve); opacity: 0; transform: scaleX(0); }

/* Animation au hover */
.compact-link:hover { color: var(--fin-text-light) !important; }
.compact-link:hover::after { opacity: 1; transform: scaleX(1); box-shadow: 0 0 8px var(--fin-blue); }

.etea-fusion-active #etea-scroll-progress-bar { 
    height: 4px; 
    background-color: #5d87ff; 
    animation: etea-pulse-signal 1.5s infinite; /* AJOUTÉ */
}
.etea-fusion-active .compact-link::after { 
    height: 4px; 
    background-color: var(--fin-blue); 
    box-shadow: 0 0 10px var(--fin-blue); 
    left: 0; 
    width: 100%;
    opacity: 1; 
    transform: scaleX(1); 
    animation: etea-pulse-signal 1.5s infinite; /* AJOUTÉ */
}
.etea-fusion-active .compact-link { color: var(--fin-text-light) !important; animation: etea-pulse-signal 1.5s infinite; }
@keyframes etea-pulse-signal { 
    0% { 
        opacity: 1; 
        text-shadow: 0 0 0px var(--fin-blue);
        box-shadow: 0 0 0px var(--fin-blue); /* Pour les barres */
    } 
    50% { 
        opacity: 0.8; 
        text-shadow: 0 0 8px var(--fin-blue);
        box-shadow: 0 0 12px var(--fin-blue); /* Éclat des barres */
    } 
    100% { 
        opacity: 1; 
        text-shadow: 0 0 0px var(--fin-blue);
        box-shadow: 0 0 0px var(--fin-blue);
    } 
}
.is-sticky .etea-top-bar { height: 48px; }
.etea-header-spacer { height: 112px; background: var(--fin-bg); position: relative; z-index: 1; }

/* --- ÉTAGE 1 : TOP BAR --- */
.etea-top-bar { height: 42px; display: flex; align-items: center; background: #000; border-bottom: 1px solid var(--fin-border); z-index: 1000; transition: all var(--anim-speed) var(--anim-curve); overflow: visible !important; }
.etea-ticker-section { flex: 1; overflow: hidden; }

.etea-ticker-item { transition: background 0.3s ease; }
.etea-ticker-item:hover { background: rgba(255, 215, 0, 0.08) !important; }
.etea-ticker-anchor:hover .etea-ticker-text { color: #fff; transform: translateX(5px); }
.etea-ticker-anchor .etea-ticker-text { transition: all 0.3s ease; }
.etea-ticker-item:hover .etea-mini-logo { box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); transform: scale(1.1); }
.etea-mini-logo { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.etea-ticker-item:hover .etea-ticker-tag { filter: brightness(1.2); }

.etea-timing-text { display: inline; }
.is-sticky .etea-timing-text { display: none !important; }

.etea-sticky-search-area { display: none; overflow: visible; margin: 0; }
.is-sticky .etea-sticky-search-area { display: block; max-width: 220px; flex: 0 1 auto; margin: 0 15px; }
.is-sticky .etea-sticky-search-area .etea-global-search-form { height: 30px; background: rgba(255,255,255,0.05); }

.etea-compact-nav { display: flex; align-items: center; gap: 10px; max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; transition: all 0.4s; padding: 0; }
.is-sticky .etea-compact-nav { max-width: 500px; opacity: 1; padding: 0 15px; border-left: 1px solid rgba(255,255,255,0.1); overflow: visible; }

/* --- ÉTAGE 2 : MAIN BAR --- */
.etea-main-bar { height: 70px; background: var(--fin-bg); border-bottom: 1px solid var(--fin-border); transition: all var(--anim-speed) var(--anim-curve); overflow: visible !important; position: relative; z-index: 500; }
.is-sticky .etea-main-bar { height: 0; opacity: 0; transform: translateY(-100%); pointer-events: none; }
.is-sticky .etea-top-bar { height: 48px; padding: 0 15px; }
.is-sticky .etea-ticker-label { display: none !important; } 
.is-sticky .etea-ticker-static-section, .is-sticky .etea-ticker-earnings { border-right: 1px solid rgba(255,255,255,0.1) !important; }

.etea-header-inner { max-width: 1600px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; height: 100%; gap: 30px; overflow: visible !important; }
.etea-logo-section { flex-shrink: 0; }
.etea-main-logo { height: 45px; width: auto; transition: transform 0.2s; }
.etea-main-logo:hover { transform: scale(1.05); }

/* --- RECHERCHE GLOBALE --- */
.etea-search-section { flex: 1; max-width: 500px; position: relative; }
.etea-global-search-wrapper { position: relative; width: 100%; }
.etea-global-search-form { display: flex; align-items: center; background-color: var(--fin-panel); border: 1px solid var(--fin-border); border-radius: 4px; height: 34px; transition: all 0.2s; overflow: hidden; }
.etea-global-search-form:hover { border-color: var(--fin-text-muted); }
.etea-global-search-form:focus-within { border-color: var(--fin-blue); background-color: #1c202b; box-shadow: 0 0 0 1px var(--fin-blue); }
.etea-global-search-button { background: transparent; border: none; width: 38px; height: 100%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--fin-text-muted); }
.etea-global-search-button:hover { color: var(--fin-text-light); }

body .etea-header-wrapper .etea-global-search-wrapper input[type="text"].etea-global-search-input { flex-grow: 1 !important; border: none !important; background: transparent !important; color: var(--fin-text-light) !important; font-size: 13px !important; outline: none !important; padding: 0 12px 0 0 !important; box-shadow: none !important; }
body .etea-header-wrapper .etea-global-search-wrapper input[type="text"].etea-global-search-input::placeholder { color: var(--fin-text-muted) !important; opacity: 0.7 !important; }

/* DROPDOWN RECHERCHE */
.etea-search-dropdown-container { position: absolute; top: calc(100% + 8px); left: 0; width: 680px; max-width: 95vw; background: var(--fin-bg); border: 1px solid var(--fin-border); border-radius: 6px; box-shadow: var(--fin-shadow); z-index: 10000000 !important; display: flex; flex-direction: row; animation: slideIn 0.2s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.etea-sticky-search-area .etea-search-dropdown-container { left: auto; right: 0; }

.etea-search-col-left { flex: 4; border-right: 1px solid var(--fin-border); background: var(--fin-bg); }
.etea-search-col-right { flex: 5; background: var(--fin-panel); }
.etea-dropdown-section-title { padding: 12px 16px; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--fin-text-muted); border-bottom: 1px solid var(--fin-border); }
.etea-dropdown-list { list-style: none; margin: 0; padding: 0; max-height: 400px; overflow-y: auto; }
.etea-dropdown-list li { border-bottom: 1px solid var(--fin-border); }
.etea-dropdown-list li a { display: flex; align-items: center; padding: 10px 16px; color: var(--fin-text); text-decoration: none; transition: background 0.15s; font-size: 13px; }
.etea-dropdown-list li a:hover { background: rgba(41, 98, 255, 0.08); }
.etea-dropdown-list .t-code { font-family: var(--fin-mono); color: var(--fin-blue); font-weight: 700; width: 70px; display:inline-block; }
.etea-dropdown-list .t-name { flex-grow: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fin-text-light); }
.etea-search-news-item { display: flex; gap: 12px; padding: 12px 16px; text-decoration: none; border-bottom: 1px solid var(--fin-border); }
.etea-search-news-item:hover { background: rgba(255, 255, 255, 0.03); }
.etea-search-news-item img { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; background: var(--fin-panel); }
.etea-search-news-content { display: flex; flex-direction: column; justify-content: center; }
.etea-search-news-content h4 { margin: 0 0 4px 0; font-size: 12px; color: var(--fin-text-light); line-height: 1.4; text-transform: uppercase; }
.etea-search-news-content span { font-size: 10px; color: var(--fin-text-muted); }
.etea-portfolio-logo { background: #ffffff !important; border-radius: 50%; padding: 2px; object-fit: contain; border: 1px solid var(--fin-border); }
.etea-dropdown-list::-webkit-scrollbar { width: 6px; }
.etea-dropdown-list::-webkit-scrollbar-track { background: var(--fin-bg); }
.etea-dropdown-list::-webkit-scrollbar-thumb { background: var(--fin-border); border-radius: 10px; }

/* --- NAVIGATION DROITE (MAIN) --- */
.etea-right-section { display: flex; align-items: center; gap: 24px; height: 100%; margin-left: auto; }

/* ==========================================================================
   FIX WPAUTOP & STYLING DROPDOWNS
   ========================================================================== */
.etea-header-nav { height: 100%; }

/* Purge massive des paragraphes fantômes WP */
.etea-header-wrapper p:empty { display: none !important; }
.etea-logged-actions p,
.etea-nav-bell-wrapper p,
.etea-nav-profile-wrapper p {
    display: contents !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* On protège explicitement le paragraphe de description du bouton Upgrade */
.etea-profile-panel .mini-section p,
.etea-guest-upgrade-box p { 
    display: block !important; 
    margin: 0 0 12px 0 !important; 
    line-height: 1.4; 
}

/* Effets Hover pour les boutons Guest */
.etea-guest-upgrade-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}
.etea-notif-panel p { margin: 0 0 10px 0 !important; line-height: 1.4; }

.etea-header-nav-list { display: flex; list-style: none; margin: 0; padding: 0; height: 100%; }
.etea-nav-item { position: relative; display: flex; align-items: center; height: 100%; }
.etea-nav-item > a { color: var(--fin-text); text-decoration: none; font-size: 13px; font-weight: 500; padding: 0 12px; height: 100%; display: flex; align-items: center; gap: 6px; position: relative; }
.etea-nav-item:hover > a { color: var(--fin-text-light); }
.etea-nav-item > a::after { content: ''; position: absolute; bottom: 0; left: 12px; right: 12px; height: 2px; background: var(--fin-green); transform: scaleX(0); transition: transform 0.2s; }
.etea-nav-item:hover > a::after { transform: scaleX(1); }
.etea-chevron-icon { width: 12px; height: 12px; stroke: currentColor; opacity: 0.7; }
.etea-submenu { display: none; position: absolute; top: 100%; left: 0; background: var(--fin-panel); border: 1px solid var(--fin-border); border-radius: 0 0 4px 4px; padding: 6px 0; min-width: 200px; box-shadow: var(--fin-shadow); z-index: 1000000 !important; list-style: none; margin:0; }
.etea-has-submenu:hover .etea-submenu { display: block; animation: fadeIn 0.2s ease; }
.etea-submenu li a { padding: 10px 16px; font-size: 13px; color: var(--fin-text); text-decoration: none; display: flex; align-items: center; }
.etea-submenu li a:hover { background: var(--fin-bg); color: var(--fin-green); }

/* --- ACTIONS (PROFIL/LOGOUT/CLOCHE) --- */
.etea-top-actions-wrapper { display: none; align-items: center; gap: 15px; }
.is-sticky .etea-top-actions-wrapper { display: flex; margin-left: auto; }

.etea-logged-actions { display: flex; align-items: center; gap: 10px; }
.etea-nav-action-link, .etea-nav-logout-icon { 
    width: 32px; height: 32px; border-radius: 4px; display: flex; align-items: center; justify-content: center; 
    background: var(--fin-panel); border: 1px solid var(--fin-border); color: var(--fin-text-muted); transition: all 0.2s; cursor: pointer; padding:0;
}
.etea-nav-action-link:hover { border-color: var(--fin-blue); color: var(--fin-blue); background: rgba(41, 98, 255, 0.05); }
.etea-nav-logout-icon:hover { border-color: var(--fin-red); color: var(--fin-red); background: rgba(242, 54, 69, 0.05); }

/* Ajustement Avatar Image */
.etea-nav-avatar { padding: 0 !important; border-color: var(--fin-green); overflow: hidden; border:none; }
.etea-nav-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 4px; }

/* DROPDOWNS CLOCHE ET PROFIL */
.etea-nav-bell-wrapper, .etea-nav-profile-wrapper { position: relative; }
.etea-bell-badge { position: absolute; top: -5px; right: -5px; background: var(--fin-red); color: white; font-size: 9px; font-weight: bold; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-family: sans-serif; }

.etea-dropdown-panel { position: absolute; top: 120%; right: 0; width: 300px; background: var(--fin-panel); border: 1px solid var(--fin-border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.8); z-index: 100000; overflow: hidden; }
.etea-dropdown-panel .panel-header { background: var(--fin-bg); padding: 10px 15px; font-size: 10px; font-weight: bold; color: var(--fin-text-muted); border-bottom: 1px solid var(--fin-border); }
.etea-dropdown-panel .panel-content { max-height: 450px; overflow-y: auto; padding: 0; }

.etea-notif-item { display: flex; gap: 12px; padding: 15px; border-bottom: 1px solid var(--fin-border); text-decoration: none; color: var(--fin-text); transition: 0.2s; }
.etea-notif-item:hover { background: rgba(255,255,255,0.05); border-left: 3px solid var(--fin-blue); padding-left: 12px; }
.etea-notif-item .icon { font-size: 16px; margin-top: 2px; }
.etea-notif-item .info strong { display: block; font-size: 12px; color: var(--fin-text-light); }
.etea-notif-item .info p { margin: 4px 0 0 0; font-size: 11px; color: var(--fin-text-muted); line-height: 1.4; }

.mini-section { padding: 15px; }

/* --- TOAST NOTIFICATION --- */
.etea-toast { position: fixed; bottom: 30px; right: 30px; background: #1e222d; color: #fff; padding: 15px 25px; border-radius: 6px; border-left: 4px solid var(--fin-green); box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 1000000; font-family: 'Share Tech Mono', monospace; font-size: 13px; display: none; }
.etea-toggle-wl-btn.active .icon { text-shadow: 0 0 10px rgba(255, 215, 0, 0.8); filter: drop-shadow(0 0 5px gold); }
.etea-toggle-wl-btn.active { border-color: var(--fin-green) !important; background: rgba(8, 153, 129, 0.05) !important; }

/* MENU BURGER (Main) */
.etea-menu-toggle { display: none; margin-left: 15px; width: 24px; height: 24px; position: relative; cursor: pointer; z-index: 1000; }
.etea-menu-toggle span { display: block; position: absolute; height: 2px; width: 100%; background: var(--fin-text-light); border-radius: 2px; transition: .25s ease-in-out; }
.etea-menu-toggle span:nth-child(1) { top: 6px; } .etea-menu-toggle span:nth-child(2) { top: 12px; } .etea-menu-toggle span:nth-child(3) { top: 18px; }
.etea-menu-toggle.active span:nth-child(1) { top: 12px; transform: rotate(135deg); } .etea-menu-toggle.active span:nth-child(2) { opacity: 0; left: -20px; } .etea-menu-toggle.active span:nth-child(3) { top: 12px; transform: rotate(-135deg); }


/* --- GESTION DU MINI LOGO AU SCROLL --- */
.etea-scroll-logo-area { display: none; align-items: center; padding-left: 15px; opacity: 0; transform: translateX(-10px); transition: all 0.3s ease; }
.is-sticky .etea-scroll-logo-area { display: flex; opacity: 1; }
.etea-mini-scroll-logo { height: 28px !important; width: auto !important; display: block; filter: drop-shadow(0 0 5px rgba(41, 98, 255, 0.2)); }
.is-sticky .etea-ticker-section { padding-left: 10px; }

.is-sticky .etea-status-tag { font-size: 0 !important; background: transparent !important; border: none !important; padding: 0 !important; width: auto !important; min-width: 0 !important; box-shadow: none !important; }
.is-sticky .etea-status-tag::before { font-size: 16px !important; display: inline-block; vertical-align: middle; }
.is-sticky .etea-status-tag.neutral::before { content: "⚪"; }
.is-sticky .etea-status-tag.pos::before { content: "⚡"; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

.etea-mobile-only-item { display: none !important; }
.etea-mobile-actions-wrapper { display: none; align-items: center; gap: 15px; }

@media (max-width: 1150px) {
    .is-sticky .compact-link { display: none !important; }
    .is-sticky .etea-compact-nav { padding: 0; border: none; }
    .etea-desktop-actions-wrapper { display: none !important; }
    .etea-mobile-actions-wrapper { display: flex !important; margin-left: auto; padding-right: 15px; }
    .is-sticky .etea-mobile-actions-wrapper { padding-right: 0; }
    .etea-compact-nav { display: none !important; }
}

@media (max-width: 1100px) {
    .etea-header-nav { display: none !important; } 
    .etea-menu-toggle { display: block !important; } 
    .etea-top-actions-wrapper { display: flex; margin-left: auto; padding-right: 15px; }

    .etea-main-bar { height: auto; padding: 10px 0; }
    .etea-header-spacer { height: 160px; } 
    .etea-header-inner { flex-wrap: wrap; }
    .etea-search-section { min-width: 100%; order: 3; } 

    .etea-header-nav.active {
        display: block !important; position: fixed; top: 0; left: 0; width: 100%;
        height: 100vh; background: var(--fin-bg); overflow-y: auto; padding: 60px 0 16px 0; z-index: 1000;
    }
    
    .etea-header-nav-list { flex-direction: column; height: auto; }
    .etea-nav-item { height: auto; display: block; }
    .etea-nav-item > a { padding: 16px 24px; font-size: 16px; display: flex; justify-content: space-between; }
    .etea-submenu { position: static; width: 100%; background: #1a1e2a; box-shadow: none; border: none; }
    .etea-has-submenu:hover .etea-chevron-icon { transform: rotate(-90deg); }
    
    .etea-mobile-only-item { display: block !important; }
    .etea-mobile-auth-links { display: flex !important; flex-direction: column !important; gap: 15px; padding: 30px 20px !important; border-top: 1px solid var(--fin-border); border-bottom: none !important; margin-top: 20px; }
    
    .etea-nav-item.etea-mobile-auth-links > a { transition: none; }
    .etea-nav-item.etea-mobile-auth-links:hover > a { color: inherit; }
    .etea-nav-item.etea-mobile-auth-links > a::after { display: none !important; }
    
    .mobile-btn-profile {
        display: block; width: 100%; text-align: center;
        background: var(--fin-green); color: #fff !important;
        padding: 12px !important; border-radius: 6px;
        font-weight: bold; text-transform: uppercase; font-size: 13px !important;
        border: none !important; transition: 0.2s;
    }
    .mobile-btn-profile:hover { filter: brightness(1.15); box-shadow: 0 4px 12px rgba(8, 153, 129, 0.4); }
    
    .mobile-btn-logout {
        display: block; width: 100%; text-align: center;
        background: transparent; color: var(--fin-red) !important;
        border: 1px solid var(--fin-red); padding: 12px !important;
        border-radius: 6px; font-weight: bold; text-transform: uppercase; font-size: 13px !important;
        transition: 0.2s;
    }
    .mobile-btn-logout:hover { background: rgba(242, 54, 69, 0.1) !important; color: var(--fin-red) !important; }

    .mobile-btn-login {
        display: block; width: 100%; text-align: center;
        background: var(--fin-blue); color: #fff !important;
        padding: 12px !important; border-radius: 6px;
        font-weight: bold; text-transform: uppercase; font-size: 13px !important;
        border: none !important; transition: 0.2s;
    }
    .mobile-btn-login:hover { filter: brightness(1.15); box-shadow: 0 4px 12px rgba(41, 98, 255, 0.4); }
}

@media (max-width: 768px) {
    .is-sticky .etea-top-bar { display: flex !important; flex-wrap: nowrap !important; height: 42px !important; padding: 0 10px !important; }
    .is-sticky .etea-ticker-section { flex: 1; }
    .is-sticky .etea-sticky-search-area { display: block; max-width: 130px; margin: 0 5px !important; }
    .etea-search-dropdown-container { width: 100%; max-width: none; flex-direction: column; left: 0 !important; right: auto !important; }
    .etea-search-col-left { border-right: none; border-bottom: 1px solid var(--fin-border); }
    .etea-mini-scroll-logo { height: 24px; }
    .etea-scroll-logo-area { padding-left: 10px; }
}