/* Styles du header */
header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1000;
    overflow: visible;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: visible;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
    overflow: visible;
}

/* Navigation */
nav {
    overflow: visible;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
    margin: 0;
    overflow: visible;
}

nav li {
    display: flex;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
}

nav a:hover {
    opacity: 0.8;
}

/* Menu utilisateur */
.user-menu {
    position: relative;
    display: inline-block;
    z-index: 1001;
}

.user-menu-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
}

.user-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
}

.dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.user-menu.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 99999;
}

.user-menu.active .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
    border-bottom: 1px solid #f0f0f0;
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown a:hover {
    background-color: #f8f9fa;
}

.user-dropdown a:first-child {
    border-radius: 8px 8px 0 0;
}

.user-dropdown a:last-child {
    border-radius: 0 0 8px 8px;
}

.user-dropdown form {
    margin: 0;
    padding: 0;
}

.user-dropdown .logout-btn {
    background: none;
    border: none;
    color: #333;
    text-decoration: none;
    padding: 12px 16px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.3s;
    border-bottom: none;
    font-family: inherit;
    font-size: inherit;
    border-radius: 0 0 8px 8px;
}

.user-dropdown .logout-btn:hover {
    background-color: #f8f9fa;
}

.user-info {
    padding: 12px 16px;
    border-bottom: 2px solid #f0f0f0;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.user-name {
    font-weight: 600;
    color: #333;
    margin: 0;
    font-size: 0.9rem;
}

.user-email {
    color: #666;
    margin: 2px 0 0 0;
    font-size: 0.8rem;
}

.dropdown-divider {
    height: 0;
    margin: 0.5rem 0;
    overflow: hidden;
    border-top: 2px solid #e9ecef;
}

.header-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-left: auto;
    border: 1px solid #d9e0e7;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    box-shadow: 0 4px 14px rgba(15, 26, 40, 0.08);
    cursor: pointer;
}

.header-nav-toggle:focus-visible {
    outline: 2px solid #0f4a7a;
    outline-offset: 2px;
}

@media (max-width: 768px) {
    header .header-content {
        flex-wrap: wrap;
        align-items: center;
        gap: 0.75rem;
    }

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

    header .header-nav-toggle {
        display: inline-flex;
    }

    header .header-right {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-top: 0.25rem;
        padding: 0.75rem;
        background: #fff;
        border: 1px solid #d9e0e7;
        border-radius: 14px;
        box-shadow: 0 12px 24px rgba(15, 26, 40, 0.1);
    }

    header .header-right.is-open {
        display: flex;
    }

    header .header-right nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        padding: 0;
    }

    header .header-right nav li {
        display: block;
    }

    header .header-right nav a {
        width: 100%;
        justify-content: flex-start;
        padding: 0.6rem 0.7rem;
        border-radius: 8px;
        color: #4b5563;
    }

    header .header-right nav a:hover {
        background: #eef5fb;
        color: #0f4a7a;
    }

    header .header-right nav a.btn {
        justify-content: center;
        margin-top: 0.25rem;
    }

    header .user-menu {
        width: 100%;
    }

    header .user-menu-toggle {
        width: 100%;
        justify-content: space-between;
        border-radius: 10px;
    }

    header .user-dropdown {
        position: static;
        display: none;
        width: 100%;
        min-width: 0;
        margin-top: 0.5rem;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 1px solid #d9e0e7;
    }

    header .user-menu.active .user-dropdown {
        display: block;
        transform: none;
    }
}
