/* =============================================
   BHR Mobile Header Optimierung
   NUR @media Queries - Desktop bleibt unberuehrt
   Ueberschreibt inline-Styles per !important
   ============================================= */

/* === Header-Spacer (responsive) === */
.header-spacer {
    height: 80px;
}

/* ===== TABLET: max 1024px ===== */
@media (max-width: 1024px) {
    .header .header-center,
    .header-center,
    .nav {
        display: none !important;
    }
    .hamburger-btn {
        display: flex !important;
    }
}

/* ===== MOBILE: max 768px ===== */
@media (max-width: 768px) {

    /* --- Header Container --- */
    .header {
        height: 56px !important;
    }
    .header .header-inner,
    .header-inner {
        height: 56px !important;
        padding: 0 12px !important;
    }
    .header-spacer {
        height: 56px !important;
    }
    /* Content-Spacer (padding-top Pattern) */
    .main-content,
    .main {
        padding-top: 56px !important;
    }

    /* --- Hamburger Button --- */
    .hamburger-btn {
        display: flex !important;
        min-width: 44px !important;
        min-height: 44px !important;
        width: 44px;
        height: 44px;
        background: rgba(255,255,255,0.08) !important;
        border: 1px solid rgba(255,255,255,0.12) !important;
        border-radius: 10px !important;
        margin-right: 8px;
        flex-shrink: 0;
    }

    /* --- Logo: Text verstecken, Icon verkleinern --- */
    .logo-info,
    .logo-text,
    .logo-sim,
    .logo-tagline {
        display: none !important;
    }
    .logo img,
    .header .logo img {
        height: 36px !important;
    }
    .logo {
        gap: 0 !important;
    }

    /* --- Desktop-Nav verstecken --- */
    .header .header-center,
    .header-center,
    .nav {
        display: none !important;
    }

    /* --- Header-Right: Kompakter --- */
    .header-right,
    .header .header-right {
        gap: 8px !important;
    }

    /* --- Sim-Toggle, Live-Badge verstecken (im Mobile-Menu) --- */
    .sim-toggle,
    .header .sim-toggle {
        display: none !important;
    }
    .live-badge,
    .header .live-badge {
        display: none !important;
    }
    .next-race-badge {
        display: none !important;
    }

    /* --- User-Menu: Nur Avatar zeigen --- */
    .user-info,
    .user-menu .user-info {
        display: none !important;
    }
    .user-chevron,
    .user-menu .user-chevron {
        display: none !important;
    }
    .user-menu,
    .header .user-menu {
        padding: 4px !important;
        gap: 0 !important;
        border-radius: 50% !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    .user-avatar {
        width: 38px !important;
        height: 38px !important;
        border-width: 2px !important;
    }

    /* --- Donate Button: Kompakt, Pulse aus --- */
    .btn-donate-site {
        width: 38px !important;
        height: 38px !important;
        flex-shrink: 0 !important;
    }
    .btn-donate-site .donate-label {
        display: none !important;
    }
    .donate-pulse-site {
        display: none !important;
    }

    /* --- Chat/Notification Icons: Touch-Targets --- */
    .notification-bell {
        min-width: 38px !important;
        min-height: 38px !important;
        width: 38px !important;
        height: 38px !important;
        flex-shrink: 0 !important;
    }

    /* --- Chat-Dropdown: Zentriert, volle Breite --- */
    #chat-dropdown-menu {
        position: fixed !important;
        top: 60px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        min-width: auto !important;
        width: calc(100vw - 32px) !important;
        max-width: 340px !important;
        margin-top: 0 !important;
        border-radius: 12px !important;
    }

    /* --- User-Dropdown: Besser positioniert --- */
    .user-dropdown {
        right: -8px !important;
        min-width: 220px !important;
    }

    /* --- Notification-Dropdown --- */
    .notification-dropdown {
        right: -40px !important;
        width: calc(100vw - 32px) !important;
        max-width: 340px !important;
    }

    /* --- Mobile Nav: Position an Header-Hoehe anpassen --- */
    .mobile-nav-inner {
        padding-top: 20px !important;
    }
    .mobile-nav-link {
        padding: 14px 16px !important;
        font-size: 15px !important;
        min-height: 48px !important;
    }
    .mobile-sim-toggle .sim-btn,
    .mobile-sim-toggle .mobile-sim-btn {
        min-height: 44px !important;
    }

    /* --- Steam Login Button --- */
    .btn-steam,
    .btn.btn-steam {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
    .btn-steam svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* --- Mobile-Menu Extras --- */
    .mobile-nav-divider {
        height: 1px;
        background: rgba(255,255,255,0.1);
        margin: 12px 0;
    }
    .mobile-nav-donate {
        color: #ff3864 !important;
    }
    .mobile-nav-donate svg {
        color: #ff3864 !important;
        fill: #ff3864 !important;
    }
    .mobile-nav-online {
        color: var(--accent, #05EE88) !important;
        font-weight: 600 !important;
        cursor: default !important;
    }
    .mobile-nav-online .mobile-live-dot {
        width: 8px;
        height: 8px;
        background: #05EE88;
        border-radius: 50%;
        animation: mobilePulse 2s infinite;
        flex-shrink: 0;
    }
    @keyframes mobilePulse {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.4; }
    }
}

/* ===== KLEINE HANDYS: max 480px ===== */
@media (max-width: 480px) {

    /* --- Header noch kompakter --- */
    .header {
        height: 52px !important;
    }
    .header .header-inner,
    .header-inner {
        height: 52px !important;
        padding: 0 8px !important;
    }
    .header-spacer {
        height: 52px !important;
    }
    .main-content,
    .main {
        padding-top: 52px !important;
    }

    /* --- Logo kleiner --- */
    .logo img,
    .header .logo img {
        height: 32px !important;
    }

    /* --- Hamburger kleiner --- */
    .hamburger-btn {
        min-width: 40px !important;
        min-height: 40px !important;
        width: 40px !important;
        height: 40px !important;
        margin-right: 6px !important;
    }
    .hamburger-line {
        width: 20px !important;
    }

    /* --- Header-Right noch enger --- */
    .header-right,
    .header .header-right {
        gap: 6px !important;
    }

    /* --- Donate verstecken (ist im Mobile-Menu) --- */
    .btn-donate-site {
        display: none !important;
    }

    /* --- Avatar kleiner --- */
    .user-avatar {
        width: 34px !important;
        height: 34px !important;
    }

    /* --- Icons kleiner --- */
    .notification-bell {
        min-width: 34px !important;
        min-height: 34px !important;
        width: 34px !important;
        height: 34px !important;
    }
    .notification-bell span {
        font-size: 16px !important;
    }

    /* --- Chat-Dropdown anpassen --- */
    #chat-dropdown-menu {
        top: 56px !important;
        width: calc(100vw - 24px) !important;
    }

    /* --- Mobile Nav Links groesser --- */
    .mobile-nav-link {
        padding: 14px 16px !important;
        font-size: 15px !important;
    }

    /* --- Steam Login Button --- */
    .btn-steam,
    .btn.btn-steam {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }
}

/* ===== LANDSCAPE MODUS ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        height: 48px !important;
    }
    .header .header-inner,
    .header-inner {
        height: 48px !important;
    }
    .header-spacer {
        height: 48px !important;
    }
    .main-content,
    .main {
        padding-top: 48px !important;
    }
    .logo img,
    .header .logo img {
        height: 30px !important;
    }
    .mobile-nav {
        max-height: calc(100vh - 48px) !important;
    }
    .mobile-nav-link {
        padding: 10px 16px !important;
        min-height: 40px !important;
    }
}
