/* ════════════════════════════════════════════════
   header.css — Styles du top-header et header nav
   TedoungalBus · Inclure dans toutes les pages
   ════════════════════════════════════════════════ */

/* ── Variables globales (à ne pas dupliquer si déjà présentes) ── */
:root {
    --primary:    #1a1a1a;
    --secondary:  #d4a574;
    --accent:     #8b6f47;
    --light:      #f8f6f3;
    --cream:      #ebe8e3;
    --text:       #2d2d2d;
    --text-light: #6b6b6b;
}

/* ══════════════════════════════════════
   TOP HEADER (barre noire du dessus)
══════════════════════════════════════ */
.top-header {
    background: var(--primary);
    color: white;
    padding: 0.8rem 2rem;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(212, 165, 116, 0.2);
}

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

.top-header-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.top-header-item:hover { opacity: 1; }

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

.top-header a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.top-header a:hover { color: var(--secondary); }

.lang-switch {
    font-weight: 500;
    position: relative;
}

.lang-switch.active {
    color: var(--secondary);
    font-weight: 600;
}

.lang-switch.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--secondary);
}

/* ══════════════════════════════════════
   HEADER PRINCIPAL (sticky)
══════════════════════════════════════ */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

header.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* ── Navigation ── */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ── Logo ── */
.logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.logo:hover { transform: scale(1.05); }

.logo-icon {
    font-size: 1.8rem;
    color: var(--secondary);
}

/* ── Liens nav ── */
.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
    flex-wrap: nowrap;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    position: relative;
    transition: color 0.3s;
    white-space: nowrap;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: width 0.3s;
}

.nav-links a:hover         { color: var(--secondary); }
.nav-links a:hover::after  { width: 100%; }
.nav-links a.active        { color: var(--secondary); }
.nav-links a.active::after { width: 100%; }

/* ── Boutons CTA ── */
.nav-cta {
    display: flex !important;
    flex-direction: row !important;
    gap: 1rem;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.btn-login {
    padding: 0.6rem 1.5rem;
    background: transparent;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    border: 2px solid var(--primary);
    transition: all 0.3s;
}

.btn-login:hover {
    background: var(--primary);
    color: white;
}

.btn-reserve {
    padding: 0.6rem 1.8rem;
    background: var(--secondary);
    color: white;
    text-decoration: none;
    font-weight: 500;
    border: 2px solid var(--secondary);
    transition: all 0.3s;
}

.btn-reserve:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 165, 116, 0.3);
}

/* ══════════════════════════════════════
   PROFIL UTILISATEUR & DROPDOWN
══════════════════════════════════════ */
.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 14px 6px 6px;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(212,165,116,.22), rgba(139,111,71,.18));
    border: 1.5px solid rgba(212, 165, 116, 0.45);
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 12px rgba(212, 165, 116, 0.15);
}

.user-profile:hover {
    background: linear-gradient(135deg, rgba(212,165,116,.35), rgba(139,111,71,.28));
    border-color: var(--secondary);
    box-shadow: 0 6px 24px rgba(212, 165, 116, 0.35);
    transform: translateY(-1px);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    font-size: 0.9rem;
    box-shadow: 0 3px 10px rgba(212, 165, 116, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.user-name {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* ── Chevron animé ── */
.dropdown-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(26, 26, 26, 0.1);
    border: 1.5px solid rgba(26, 26, 26, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.dropdown-arrow::after {
    content: '';
    display: block;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-profile.active .dropdown-arrow {
    background: rgba(212, 165, 116, 0.35);
    border-color: var(--secondary);
}

.user-profile.active .dropdown-arrow::after {
    transform: rotate(-135deg) translateY(-2px);
}

/* ── Panel dropdown ── */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow:
        0 4px 6px rgba(0,0,0,.05),
        0 20px 50px rgba(0,0,0,.18),
        0 0 0 1px rgba(0,0,0,.06);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top right;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

.profile-dropdown::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
}

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

/* ── Header interne du dropdown ── */
.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-header-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.dropdown-header-info .dh-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.2;
}

.dropdown-header-info .dh-role {
    font-size: 0.72rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

/* ── Items ── */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f7f7f7;
}

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

.dropdown-item .di-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #faf7f3;
    color: var(--accent);
    padding-left: 22px;
}

.dropdown-item:hover .di-icon {
    background: rgba(212, 165, 116, 0.18);
}

.dropdown-item.logout { color: #e53935; }
.dropdown-item.logout .di-icon { background: rgba(229, 57, 53, 0.08); }
.dropdown-item.logout:hover { background: rgba(229, 57, 53, 0.05); color: #c62828; }

.dropdown-divider {
    height: 1px;
    background: #efefef;
    margin: 4px 0;
}

/* ══════════════════════════════════════
   MENU TOGGLE MOBILE
══════════════════════════════════════ */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--primary);
    display: block;
    transition: all 0.3s ease;
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 968px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.99);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        box-shadow: 0 10px 30px rgba(0,0,0,.1);
        z-index: 999;
    }

    .nav-links.open { display: flex; }

    .nav-links li { width: 100%; }

    .nav-links a {
        display: block;
        padding: 0.9rem 2rem;
        border-bottom: 1px solid var(--cream);
    }

    .nav-links a::after { display: none; }

    .nav-cta {
        padding: 1rem 2rem;
        flex-wrap: wrap;
        flex-direction: row !important;
        border-bottom: none;
    }

    .menu-toggle { display: flex; }
}

@media (max-width: 576px) {
    .top-header { display: none; }

    nav { padding: 1rem; }
}
