/* ═══════════════════════════════════════════════════════════
   BAID – Header user – Mode clair
   ═══════════════════════════════════════════════════════════ */

/* ── Police globale plateforme utilisateur ───────────────────
   Inter chargée depuis Google Fonts (cf. functions.php :
   wp_enqueue_style('baid-inter-font', ...)). Cohérent avec la
   landing pour une expérience visuelle uniforme. */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Header ───────────────────────────────────────────────── */
.header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* ── Marque ───────────────────────────────────────────────── */
.brand-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.brand-logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.brand-logo-img {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.brand-text {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.company-name {
    font-size: .82rem;
    color: #94a3b8;
    padding-left: 1rem;
    border-left: 1px solid #e2e8f0;
}

/* ── Nav ──────────────────────────────────────────────────── */
.header-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .25rem;
    flex: 1;
}

.header-nav-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem 1rem;
    min-height: 40px;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    transition: all .2s ease;
    white-space: nowrap;
}

.header-nav-link:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.header-nav-link.active {
    background: #fef2f2;
    color: #ff6b6b;
    font-weight: 600;
}

.header-nav-link .nav-icon { font-size: .95rem; }

/* ── Zone user ────────────────────────────────────────────── */
.user-zone {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    flex-shrink: 0;
}

/* Avatar + dropdown */
.user-avatar-wrap {
    position: relative;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    color: white;
    font-size: .82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    transition: border-color .2s;
    user-select: none;
}

.user-avatar:hover { border-color: #ff6b6b; }

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    min-width: 200px;
    padding: .5rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: all .2s ease;
    z-index: 300;
}

.user-avatar-wrap.open .user-dropdown {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: .75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: .25rem;
}

.user-dropdown-name {
    font-size: .9rem;
    font-weight: 600;
    color: #0f172a;
}

.user-dropdown-role {
    font-size: .78rem;
    color: #94a3b8;
    margin-top: 2px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem 1rem;
    border-radius: 8px;
    font-size: .88rem;
    color: #475569;
    text-decoration: none;
    cursor: pointer;
    transition: all .15s ease;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.user-dropdown-item:hover { background: #f8fafc; color: #0f172a; }
.user-dropdown-item--danger { color: #dc2626; }
.user-dropdown-item--danger:hover { background: #fef2f2; color: #dc2626; }

.user-dropdown-sep { height: 1px; background: #f1f5f9; margin: .25rem 0; }

/* ── Points badge ─────────────────────────────────────────── */
.header-points-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .9rem;
    background: linear-gradient(135deg, #fef9c3, #fef3c7);
    border: 1.5px solid #fbbf24;
    border-radius: 50px;
    font-size: .82rem;
    font-weight: 700;
    color: #92400e;
    text-decoration: none;
    transition: all .2s ease;
    white-space: nowrap;
}

.header-points-badge:hover {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #78350f;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(251,191,36,.3);
}

.header-points-badge i { color: #f59e0b; font-size: .85rem; }

/* ── Streak quotidien ─────────────────────────────────────── */
/* Dimensions strictement alignées sur .header-points-badge ci-dessus
   (padding, border-radius, font-size/weight, gap) — cohérence visuelle
   imposée. Seule la palette change (orange/rouge "chaud" pour évoquer
   le feu) pour distinguer streak vs points. */
.header-streak-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .9rem;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1.5px solid #fecaca;
    border-radius: 50px;
    font-size: .82rem;
    font-weight: 700;
    color: #dc2626;
    cursor: help;
    transition: all .2s ease;
    white-space: nowrap;
}
.header-streak-badge:hover {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(220, 38, 38, .25);
}

/* ── Cloche notifications employé ────────────────────────── */
.baid-notif-bell-wrap {
    position: relative;
}
.baid-notif-bell {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: .4rem;
    border-radius: 50%;
    color: #64748b;
    font-size: 1.1rem;
    transition: color .2s, background .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.baid-notif-bell:hover { color: #6366f1; background: #f1f5f9; }
.baid-notif-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(239,68,68,.4);
}
.baid-notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    width: 300px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 300;
    overflow: hidden;
}
.baid-notif-bell-wrap.open .baid-notif-dropdown { display: block; }
.baid-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}
.baid-notif-title { font-weight: 700; font-size: .85rem; color: #0f172a; }
.baid-notif-markread {
    background: none;
    border: none;
    cursor: pointer;
    font-size: .72rem;
    color: #6366f1;
    font-weight: 600;
    padding: 0;
}
.baid-notif-list { max-height: 320px; overflow-y: auto; }
.baid-notif-item {
    padding: .7rem 1rem;
    border-bottom: 1px solid #f8fafc;
    transition: background .15s;
}
.baid-notif-item:hover { background: #f8fafc; }
.baid-notif-item.unread { background: #eef2ff; }
.baid-notif-item-title {
    font-size: .8rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: .2rem;
}
.baid-notif-item-body {
    font-size: .75rem;
    color: #64748b;
    margin-bottom: .2rem;
}
.baid-notif-item-date {
    font-size: .68rem;
    color: #94a3b8;
}
.baid-notif-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #94a3b8;
    font-size: .82rem;
}
.baid-notif-empty span { font-size: 1.5rem; display: block; margin-bottom: .5rem; }

/* ── Subnav modules ───────────────────────────────────────── */
.baid-subnav {
    position: sticky;
    top: 64px;
    z-index: 199;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

/* Fade latéral mobile-only : signale le scroll horizontal des onglets.
   Restreint aux écrans étroits — en desktop, le mask rendait les bords
   transparents et laissait passer le fond coloré des pages (ex. fond
   orange Flash visible sur les côtés du subnav). */
@media (max-width: 768px) {
    .baid-subnav {
        -webkit-mask-image: linear-gradient(to right, transparent 0, black 1rem, black calc(100% - 2rem), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, black 1rem, black calc(100% - 2rem), transparent 100%);
    }
}

.baid-subnav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: .25rem;
    height: 44px;
    overflow-x: auto;
    scrollbar-width: none;
}
.baid-subnav-inner::-webkit-scrollbar { display: none; }

.baid-subnav-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .9rem;
    min-height: 36px;
    border-radius: 20px;
    font-size: .83rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}

.baid-subnav-link:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Accueil actif */
.baid-subnav-link.active {
    background: #fef2f2;
    color: #ff6b6b;
    font-weight: 600;
}

/* Défis : indigo→violet cohérent avec le hero de single-defi.php (gradient #4f46e5 → #7c3aed)
   et les vignettes (au lieu du jaune par défaut). */
.baid-subnav-link--defi.active,
.baid-subnav-link--defi:hover {
    background: #ede9fe;
    color: #4f46e5;
}

/* Tempêtes actif */
.baid-subnav-link--tempete.active {
    background: #ede9fe;
    color: #6d28d9;
}
.baid-subnav-link--tempete:hover {
    background: #ede9fe;
    color: #6d28d9;
}

.baid-subnav-icon { font-size: .9rem; line-height: 1; }

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .header-content { padding: 0 1rem; gap: 1rem; }
    .company-name   { display: none; }
    .header-nav-link span.nav-label { display: none; }
    .header-nav-link { padding: .5rem .65rem; }
    .header-nav {
        overflow-x: auto;
        scrollbar-width: none;
    }
    .header-nav::-webkit-scrollbar { display: none; }

    .baid-subnav-inner { padding: 0 1rem; }

    /* Dropdowns — empêcher le débordement à droite */
    .user-dropdown,
    .baid-notif-dropdown {
        width: calc(100vw - 1.5rem);
        max-width: 320px;
        min-width: 0;
        right: 0;
    }
}
