/* Mobile-First: Basis-Styles gelten für mobile Geräte */
.topbar {
    background: linear-gradient(180deg, var(--nav), var(--nav2));
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.10);
}

.header-container {
    width: min(var(--max), calc(100% - 40px));
    margin: 0 auto;
}

.topbar-inner {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.header {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-weight: 800;
    letter-spacing: .2px;
    color: #fff;
    text-decoration: none;
}

.brand:hover {
    opacity: .9;
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #f97316);
    box-shadow: 0 0 0 4px rgba(255,255,255,.08);
}

.brand-small {
    font-weight: 600;
    opacity: .85;
}

.header-logo-area {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    flex: 0 0 auto;
    min-width: 50px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.header-nav {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    display: none;
    position: absolute;
    top: 100%;
    left: auto;
    right: 0;
    flex-direction: column;
    background: var(--nav);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 4px;
    padding: 10px;
    min-width: 200px;
    max-width: 300px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    gap: 0;
}

.nav-link {
    font-family: var(--font-family-primary);
    font-size: 14px;
    line-height: var(--line-height-base);
    text-decoration: none;
    color: #fff;
    padding: 8px 10px;
    border-radius: 999px;
    opacity: .92;
}

.nav-link:hover {
    background: rgba(255,255,255,.10);
    opacity: .9;
}

.nav-link.pill {
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.06);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    display: flex;
    gap: 10px;
}

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.06);
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    width: 180px;
}

.search-input::placeholder {
    color: rgba(255,255,255,.7);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.06);
    color: #fff;
    cursor: pointer;
    font-size: 18px;
}

.icon-btn:hover {
    background: rgba(255,255,255,.10);
}

.mobile-nav-toggle {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: none;
    border: 1px solid rgba(255,255,255,.16);
    cursor: pointer;
}

.mobile-nav-toggle-line {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #fff;
}

.language-switcher {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    position: relative;
    z-index: 10000;
}

.language-switcher-button {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.06);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    border-radius: 12px;
}

.language-switcher-button:hover {
    background: rgba(255,255,255,.10);
}

.language-switcher.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.flag-icon {
    width: 24px;
    height: 18px;
    display: block;
    object-fit: contain;
    vertical-align: middle;
    border: none !important;
}

.language-switcher-button .flag-icon {
    flex-shrink: 0;
    border: none !important;
}

.language-dropdown {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    background: var(--nav);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 4px;
    min-width: 150px;
    margin-top: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
}

.language-switcher.active .language-dropdown {
    display: block;
}

.language-option {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    background: var(--nav);
    border-bottom: 1px solid rgba(255,255,255,.10);
    transition: background-color 0.2s;
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: rgba(255,255,255,.10);
    text-decoration: none;
}

.language-option.active {
    background: rgba(255,255,255,.12);
    font-weight: bold;
}

.language-option.active .flag-icon {
    /* Kein Rahmen für Flaggen */
}

.language-option .flag-icon {
    flex-shrink: 0;
    border: none !important;
    width: 24px;
    height: 18px;
    display: block;
    object-fit: contain;
}

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

.header-user-avatar-link {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    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);
}

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

.header-user-avatar-placeholder {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    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;
}

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

/* Mobile-First: Responsive Design - Regel 022: 4 Breakpoints */
/* Basis-Styles gelten für mobile (max-width: 576px) - keine Media Query erforderlich */

/* Tablet/iPad (min-width: 600px) */
@media (min-width: 600px) {
    .header-container {
        width: min(var(--max), calc(100% - 40px));
    }
}

/* Kleiner Desktop/13-Zoll (min-width: 1024px) */
@media (min-width: 1024px) {
    .header-container {
        width: min(var(--max), calc(100% - 40px));
    }
    
    .mobile-nav-toggle {
        display: none;
    }
    
    .header-nav {
        display: flex;
        position: static;
        flex-direction: row;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        min-width: auto;
        max-width: none;
        box-shadow: none;
        gap: 14px;
    }
    
    .nav-link {
        padding: 8px 10px;
    }
    
    .header-user-avatar {
        display: flex;
    }
    
    .language-dropdown {
        left: auto;
        right: 0;
    }
}

/* Großer Desktop/Widescreen (min-width: 1440px) */
@media (min-width: 1440px) {
    .header-container {
        width: min(var(--max), calc(100% - 40px));
    }
}
