/* Navigation: Mobile-First Responsive Design */

/* ============================================
   MOBILE (Base - bis 575px)
   ============================================ */

.base-layout-header {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: 1.5;
    background: #ffffff;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    position: relative;
    overflow-x: clip;
    overflow-y: visible;
    box-sizing: border-box;
    gap: 10px;
    z-index: 1000;
    max-width: 1600px;
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
}

.base-layout-header-logo-area {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: 1.5;
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Navigation: Auf Mobile versteckt, wird über Hamburger-Menü geöffnet */
.base-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-background);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 20px 20px 20px;
    z-index: 999;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    gap: 20px;
}

/* Navigation geöffnet (Mobile) */
.base-nav.open {
    display: flex;
}

.base-nav-link {
    font-family: var(--font-family-primary);
    font-size: 0.95rem;
    line-height: 1.5;
    text-decoration: none;
    color: #1f2933;
    padding: 12px 0;
    border-radius: 0;
    transition: var(--transition-fast);
    font-weight: 400;
    letter-spacing: 0;
    white-space: nowrap;
    width: 100%;
    border-bottom: 1px solid var(--color-border);
}

.base-nav-link:hover {
    text-decoration: none;
    color: #1f6fd5;
    background-color: transparent;
}

.base-layout-header-actions {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: 1.5;
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    box-sizing: border-box;
    align-items: center;
    flex-shrink: 0;
}

/* Hamburger-Menü Button (Mobile) */
.base-mobile-nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    gap: 5px;
}

.base-mobile-nav-toggle-line {
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: var(--transition-fast);
    border-radius: 1px;
}

.mobile-nav-toggle.active .mobile-nav-toggle-line:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-nav-toggle.active .mobile-nav-toggle-line:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.active .mobile-nav-toggle-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.base-language-switcher {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
    margin: 0;
    padding: 0;
    overflow: visible;
    min-width: 0;
}

/* Language Switcher: Desktop sichtbar, Mobile im Menü */
.base-language-switcher-desktop {
    display: none;
}

.base-language-switcher-mobile {
    display: flex;
    width: 100%;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    margin-top: 10px;
}

.base-language-flag-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0;
    margin: 0;
    transition: var(--transition-fast);
    opacity: 0.7;
}

.language-flag-link:hover {
    opacity: 1;
}

.language-flag-link.active {
    opacity: 1;
}

.base-flag-icon {
    width: 24px;
    height: 18px;
    min-width: 24px;
    min-height: 18px;
    display: block;
    object-fit: contain;
    vertical-align: middle;
    border: none;
    background: transparent;
}

/* VERPFLICHTEND: Z-Index für Language-Switcher muss hoch genug sein (Regel 020 in 011-ui-i18n.mdc) */
.language-switcher-desktop,
.base-language-switcher-mobile {
    z-index: 10;
    position: relative;
}

.base-header-user-avatar {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: 1.5;
    display: none;
    align-items: center;
}

.base-header-user-avatar-link {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    text-decoration: none;
    border: 2px solid var(--color-border);
}

.header-user-avatar-link:hover {
    border-color: var(--color-primary);
}

.base-header-user-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.base-header-user-avatar-placeholder {
    font-family: var(--font-family-primary);
    font-size: 14px;
    line-height: 1.8;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
    font-weight: bold;
    text-transform: uppercase;
}

/* ============================================
   TABLET (600px - 1023px)
   ============================================ */

@media (min-width: 600px) {
    .base-layout-header {
        padding: 12px 40px;
    }

    .base-nav {
        padding: 80px 40px 40px 40px;
    }
}

/* ============================================
   DESKTOP (1024px - 1439px)
   ============================================ */

@media (min-width: 1024px) {
    .base-layout-header {
        padding: 12px 60px;
    }

    /* Navigation: Auf Desktop immer sichtbar, inline */
    .base-nav {
        display: flex;
        position: static;
        flex-direction: row;
        background: transparent;
        border: none;
        padding: 0;
        box-shadow: none;
        gap: 10px;
        align-items: center;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        overflow: visible;
    }

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

    .base-nav-link {
        font-size: 0.95rem;
        margin-left: 1rem;
        padding: 0;
        width: auto;
        border-bottom: none;
    }
    
    .base-nav-link.is-active {
        font-weight: 600;
        color: #1f6fd5;
    }

    /* Hamburger-Menü auf Desktop versteckt */
    .base-mobile-nav-toggle {
        display: none;
    }

    /* Language Switcher: Desktop sichtbar, Mobile versteckt */
    .base-language-switcher-desktop {
        display: flex;
    }

    .base-language-switcher-mobile {
        display: none;
    }
}

/* ============================================
   WIDESCREEN (1440px+)
   ============================================ */

@media (min-width: 1440px) {
    .base-layout-header {
        padding: 12px 60px;
    }
}
