/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
}

/* Header ALSTOM */
.alstom-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-container {
    max-width: 1860px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 40px;
    gap: 30px;
}

/* Logo ALSTOM */
.header-logo {
    flex-shrink: 0;
}

.header-logo a {
    text-decoration: none;
    display: block;
    line-height: 0;
}

.logo-img {
    height: 40px;
    width: auto;
    display: block;
}

/* Navigation principale */
.header-nav {
    flex-grow: 1;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 35px;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #000000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    opacity: 0.7;
}

.nav-link.active {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Menu de droite */
.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-shrink: 0;
}

.header-link {
    color: #000000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.header-link:hover {
    opacity: 0.7;
}

.header-connexion {
    color: #3F2A8C;
    font-weight: 500;
}

/* Sélecteur de langue */
.language-selector {
    position: relative;
}

.language-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.language-btn:hover {
    background-color: #f5f5f5;
}

.flag-icon {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}

.dropdown-icon {
    font-size: 10px;
    color: #666;
    transition: transform 0.2s ease;
}

.language-selector:hover .dropdown-icon {
    transform: rotate(180deg);
}

.language-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    list-style: none;
    min-width: 160px;
    padding: 8px 0;
    z-index: 100;
}

/* Pont invisible pour éviter la perte du hover */
.language-selector::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    height: 10px;
    background: transparent;
}

.language-selector:hover .language-dropdown {
    display: block;
}

.language-dropdown li {
    margin: 0;
}

.language-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-family: 'Lato', sans-serif;
    transition: background-color 0.2s ease;
}

.language-dropdown a:hover {
    background-color: #f5f5f5;
}

.language-dropdown a.active {
    background-color: rgba(var(--primary-color-rgb), 0.08);
    color: var(--primary-color);
}

.language-dropdown img {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}

/* Menu utilisateur connecté */
.user-menu {
    position: relative;
}

.user-profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 25px;
    text-decoration: none;
    color: #1E3246;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    cursor: pointer;
    background: none;
    border: none;
}

.user-profile-link:hover {
    background-color: #f5f5f5;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initials {
    color: #ffffff;
    font-family: 'Ubuntu', sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.user-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu.active .user-profile-link {
    background-color: #f5f5f5;
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    list-style: none;
    min-width: 200px;
    padding: 8px 0;
    z-index: 100;
    margin-top: 5px;
}

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

.user-dropdown li {
    margin: 0;
}

.user-dropdown a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #1E3246;
    font-size: 14px;
    font-family: 'Lato', sans-serif;
    transition: background-color 0.2s ease;
}

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

.user-dropdown .logout-link {
    color: var(--primary-color);
}

.user-dropdown .logout-link:hover {
    background-color: rgba(var(--primary-color-rgb), 0.08);
}

.dropdown-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 8px 0;
}

/* Sélecteur de template */
.template-selector {
    position: relative;
}

.template-selector__btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.08) 0%, rgba(var(--primary-color-rgb), 0.04) 100%);
    border: 1px solid rgba(var(--primary-color-rgb), 0.2);
    border-radius: 10px;
    color: var(--primary-color);
    font-family: 'Ubuntu', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.template-selector__btn:hover {
    background: rgba(var(--primary-color-rgb), 0.12);
    border-color: var(--primary-color);
}

.template-selector__btn i {
    font-size: 14px;
}

.template-selector__btn .dropdown-icon {
    font-size: 9px;
    transition: transform 0.2s ease;
}

.template-selector.active .template-selector__btn .dropdown-icon {
    transform: rotate(180deg);
}

.template-selector__dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    list-style: none;
    min-width: 260px;
    padding: 8px;
    z-index: 200;
}

.template-selector.active .template-selector__dropdown {
    display: block;
    animation: tplDropIn 0.2s ease;
}

@keyframes tplDropIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.template-selector__dropdown li {
    margin: 0;
}

.template-selector__dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #374151;
    border-radius: 10px;
    transition: background-color 0.15s ease;
}

.template-selector__dropdown a:hover {
    background: #f3f4f6;
}

.template-selector__dropdown a.active {
    background: rgba(var(--primary-color-rgb), 0.08);
    color: var(--primary-color);
}

.template-selector__dropdown a i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: var(--primary-color);
    opacity: 0.7;
}

.template-selector__dropdown a.active i {
    opacity: 1;
}

.template-selector__dropdown a div {
    display: flex;
    flex-direction: column;
}

.template-selector__dropdown a strong {
    font-family: 'Ubuntu', sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.template-selector__dropdown a small {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

.template-selector__dropdown a.active small {
    color: rgba(var(--primary-color-rgb), 0.6);
}

/* Responsive */
@media (max-width: 1200px) {
    .header-container {
        padding: 12px 20px;
        gap: 20px;
    }

    .nav-list {
        gap: 20px;
    }

    .header-right {
        gap: 15px;
    }
}

@media (max-width: 992px) {
    .header-container {
        flex-wrap: wrap;
    }

    .header-nav {
        order: 3;
        flex-basis: 100%;
    }

    .nav-list {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-list {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .header-right {
        flex-direction: column;
        gap: 10px;
    }

    .logo-img {
        height: 30px;
    }
}