/* Header Global - Composant réutilisable */

.global-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-logo:hover {
    opacity: 0.9;
}

.header-nav {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-nav li {
    margin: 0;
}

.header-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.header-nav a:hover,
.header-nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.header-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    font-size: 0.9rem;
}

.header-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.header-button.primary {
    background: #28a745;
    border-color: #28a745;
}

.header-button.primary:hover {
    background: #218838;
}

.header-button.secondary {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Badge de notifications dans le header */
.notifications-link {
    position: relative;
    display: inline-block;
    overflow: visible; /* Assurer que le badge reste visible */
}
.notif-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e02424;
    color: #fff;
    border-radius: 50%;
    padding: 0 4px;
    height: 16px;
    min-width: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    border: 2px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 10;
    pointer-events: none; /* Le clic passe au bouton parent */
}

/* Menu mobile */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.header-nav.mobile-active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    padding: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
    }

    .header-nav {
        display: none;
        width: 100%;
        order: 3;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .header-right {
        gap: 0.5rem;
    }

    .user-info {
        font-size: 0.8rem;
    }

    .header-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 0.5rem;
    }

    .header-logo {
        font-size: 1.2rem;
    }

    .user-info .username {
        display: none;
    }
}
