/* ============================================
   Header — Navigation principale
   ============================================ */

.site-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-height); z-index: var(--z-sticky);
    background: var(--bg-glass-strong); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    transition: background var(--transition-base);
}

.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 100%; max-width: 1400px; margin: 0 auto; padding: 0 1.5rem;
}

/* Logo */
.header-logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.header-logo img { height: 40px; width: auto; }
.header-logo span {
    font-family: var(--font-display); font-size: 1.4rem; font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Nav principale */
.header-nav { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
    position: relative; padding: 0.5rem 1rem;
    font-size: 0.9rem; font-weight: 500; color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast); border-radius: var(--radius-sm);
}
.nav-link::after {
    content: ''; position: absolute; bottom: -2px; left: 50%; width: 0; height: 2px;
    background: var(--accent-primary); transition: all var(--transition-base);
    transform: translateX(-50%); border-radius: 1px;
}
.nav-link:hover { color: var(--text-primary); }
.nav-link:hover::after { width: 60%; }
.nav-link.active { color: var(--accent-primary); }
.nav-link.active::after { width: 60%; }

/* Actions droite */
.header-actions { display: flex; align-items: center; gap: 0.75rem; }

/* Pill EP */
.ep-pill {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.35rem 0.85rem; border-radius: var(--radius-full);
    background: rgba(200, 155, 60, 0.1); border: 1px solid rgba(200, 155, 60, 0.25);
    font-size: 0.8rem; font-weight: 600; color: var(--accent-secondary);
    transition: all var(--transition-fast); text-decoration: none;
}
.ep-pill:hover { background: rgba(200, 155, 60, 0.18); }
.ep-pill svg { width: 14px; height: 14px; }

/* Notification bell */
.notif-btn {
    position: relative; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-md); color: var(--text-secondary);
    background: none; border: none; cursor: pointer;
    transition: all var(--transition-fast);
}
.notif-btn:hover { background: var(--bg-card); color: var(--text-primary); }
.notif-btn i { font-size: 1.1rem; }
.notif-count {
    position: absolute; top: 4px; right: 4px;
    min-width: 16px; height: 16px; padding: 0 4px;
    font-size: 0.65rem; font-weight: 700; line-height: 16px; text-align: center;
    background: var(--accent-danger); color: #fff; border-radius: 8px;
}

/* Notification wrapper & dropdown */
.notif-wrapper { position: relative; }
.notif-dropdown {
    display: none; position: absolute; top: calc(100% + 0.5rem); right: 0;
    width: 340px; max-height: 400px; overflow-y: auto;
    background: var(--bg-card); border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    z-index: 100;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-subtle);
}
.notif-dropdown-header h4 { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.notif-empty {
    padding: 2rem 1rem; text-align: center;
    color: var(--text-muted); font-size: 0.85rem;
}
.notif-item {
    display: flex; gap: 0.75rem; padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast); cursor: pointer;
}
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item.unread { background: rgba(99, 102, 241, 0.05); }

/* User dropdown avatar */
.header-user {
    display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
    padding: 0.3rem; border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}
.header-user:hover { background: var(--bg-card); }
.header-user .avatar,
.header-user-avatar {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
}
.header-user .user-name,
.header-user-name {
    font-size: 0.85rem; font-weight: 500; color: var(--text-primary);
}

/* User dropdown menu */
.user-dropdown {
    display: none; position: absolute; top: calc(100% + 0.5rem); right: 0;
    min-width: 200px; background: var(--bg-card);
    border: 1px solid var(--border-glass); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); z-index: 100;
    padding: 0.5rem 0; overflow: hidden;
}
.user-dropdown.open { display: block; }
.user-dropdown a,
.user-dropdown button {
    display: flex; align-items: center; gap: 0.6rem;
    width: 100%; padding: 0.6rem 1rem;
    font-size: 0.85rem; color: var(--text-secondary);
    text-decoration: none; background: none; border: none;
    cursor: pointer; transition: all var(--transition-fast);
}
.user-dropdown a:hover,
.user-dropdown button:hover {
    background: rgba(255,255,255,0.05); color: var(--text-primary);
}
.user-dropdown a i,
.user-dropdown button i { width: 16px; text-align: center; font-size: 0.85rem; }
.user-dropdown-divider {
    height: 1px; margin: 0.4rem 0;
    background: var(--border-subtle);
}

/* Login button (non connecté) */
.btn-header-login {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1.2rem; border-radius: var(--radius-md);
    background: var(--accent-primary); color: #fff;
    font-size: 0.85rem; font-weight: 600;
    text-decoration: none; transition: all var(--transition-fast);
}
.btn-header-login:hover {
    background: var(--accent-primary-hover, var(--accent-primary));
    transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Auth buttons (non connecté) */
.header-auth { display: flex; align-items: center; gap: 0.5rem; }

/* Hamburger mobile */
.hamburger {
    display: none; width: 40px; height: 40px;
    align-items: center; justify-content: center;
    flex-direction: column; gap: 5px; cursor: pointer;
    background: none; border: none; padding: 0;
}
.hamburger span {
    display: block; width: 22px; height: 2px;
    background: var(--text-primary); border-radius: 1px;
    transition: all var(--transition-fast);
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile nav */
.mobile-nav {
    display: none; position: fixed; top: var(--header-height); left: 0; right: 0; bottom: 0;
    background: var(--bg-glass-strong); backdrop-filter: blur(20px);
    z-index: calc(var(--z-sticky) - 1); padding: 1.5rem;
    flex-direction: column; gap: 0.5rem;
    transform: translateX(100%); transition: transform var(--transition-slow);
    overflow-y: auto;
}
.mobile-nav.open { display: flex; transform: translateX(0); }
.mobile-nav .nav-link {
    font-size: 1.1rem; padding: 0.85rem 1rem; border-radius: var(--radius-md);
}
.mobile-nav .nav-link:hover { background: var(--bg-card); }

/* ── Responsive ─────────────────────────── */
@media (max-width: 768px) {
    .header-nav { display: none; }
    .hamburger { display: flex; }
    .header-actions .ep-pill,
    .header-actions .user-name,
    .header-user-name { display: none; }
    .notif-dropdown { width: calc(100vw - 2rem); right: -1rem; }
    .user-dropdown { right: -0.5rem; }
}
