/**
 * NAVIGATION MODERNE - Moustaqim.com
 * Header avec couleurs Kaaba (Or/Noir/Blanc)
 * Utilise les variables CSS de design-system.css
 *
 * Classes uniques: site-header, nav-*, theme-toggle-*, mobile-menu-*
 */

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(135deg, var(--color-black) 0%, var(--color-black-light) 100%);
    box-shadow: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    transition: all var(--transition-normal);
}

.site-header.scrolled {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ========================================
   LOGO TEXTE
   ======================================== */

.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

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

.site-logo-text {
    font-family: var(--font-primary);
    font-size: 26px;
    font-weight: 700;
    color: var(--color-gold);
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 4px;
}

.site-logo-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-gold) 0%, transparent 100%);
}

/* ========================================
   NAVIGATION LINKS
   ======================================== */

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    list-style: none;
    margin: 0;
    padding: 0;
    line-height: normal;
}

.nav-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
    line-height: normal;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: var(--space-2) var(--space-4);
    color: var(--color-white);
    text-decoration: none;
    font-size: var(--text-base);
    font-weight: 500;
    font-family: var(--font-secondary);
    border-radius: 0;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-gold);
    transform: translateX(-50%);
    transition: width var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-gold);
    background: rgba(212, 175, 55, 0.1);
}

.nav-link:hover::after {
    width: 80%;
}

.nav-link.active {
    color: var(--color-gold);
    background: rgba(212, 175, 55, 0.15);
}

/* ========================================
   DARK MODE TOGGLE
   ======================================== */

.theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: var(--space-4);
}

.theme-toggle-btn {
    position: relative;
    width: 60px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid rgba(212, 175, 55, 0.3);
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--color-gold);
}

.theme-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: var(--color-gold);
    border-radius: 50%;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-toggle-slider svg {
    width: 14px;
    height: 14px;
    fill: var(--color-black);
}

[data-theme="dark"] .theme-toggle-slider {
    left: 32px;
}

/* ========================================
   MOBILE MENU TOGGLE
   ======================================== */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--color-gold);
    border-radius: 0;
    transition: all var(--transition-fast);
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ========================================
   RESPONSIVE NAVIGATION
   ======================================== */

@media (max-width: 968px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: linear-gradient(180deg, var(--color-black) 0%, var(--color-black-light) 100%);
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-normal);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .nav-menu.active {
        max-height: 500px;
    }

    .nav-link {
        padding: var(--space-4) var(--space-6);
        border-bottom: 1px solid rgba(212, 175, 55, 0.1);
        border-radius: 0;
    }

    .nav-link::after {
        display: none;
    }

    .theme-toggle {
        margin-left: 0;
        padding: var(--space-4) var(--space-6);
        justify-content: center;
        border-top: 2px solid rgba(212, 175, 55, 0.2);
    }
}

/* ========================================
   SMALL SCREENS
   ======================================== */

@media (max-width: 480px) {
    .nav-container {
        padding: 0 var(--space-4);
    }

    .site-logo-text {
        font-size: 20px;
        letter-spacing: 0.5px;
    }
}

/* ========================================
   LANGUAGE SELECTOR DROPDOWN
   ======================================== */

.lang-selector {
    position: relative;
}

.lang-dropdown {
    position: relative;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px;
    color: var(--color-white);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.lang-current:hover {
    border-color: var(--color-gold);
    background: rgba(212, 175, 55, 0.1);
}

.lang-flag {
    font-size: 16px;
}

.lang-code {
    font-weight: 600;
    font-size: 12px;
}

.lang-list {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    padding: 8px 0;
    background: var(--color-black);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    list-style: none;
    min-width: 180px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.lang-dropdown:hover .lang-list,
.lang-dropdown:focus-within .lang-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-list li {
    margin: 0;
    padding: 0;
}

.lang-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--color-white);
    text-decoration: none;
    transition: background 0.2s;
}

.lang-list li a:hover {
    background: rgba(212, 175, 55, 0.1);
}

.lang-list li.active a {
    background: rgba(212, 175, 55, 0.15);
    color: var(--color-gold);
}

.lang-name {
    font-size: 14px;
}

/* Scrollbar styling for language list */
.lang-list::-webkit-scrollbar {
    width: 6px;
}

.lang-list::-webkit-scrollbar-track {
    background: transparent;
}

.lang-list::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}

.lang-list::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}
