/*
Mining Tracker

Datei:
static/css/site-shell.css

Beschreibung:
Gemeinsamer Header und Footer für öffentliche, Auth- und App-Seiten.

Lizenz:
Privat
*/

:root {
    --mt-site-header-height: 108px;
}

.site-header {
    position: fixed;
    z-index: 1200;
    top: 0;
    right: 0;
    left: 0;
    min-height: var(--mt-site-header-height);
    border-bottom: 1px solid var(--mt-border);
    background: var(--mt-header-background);
    backdrop-filter: blur(18px);
}

.site-header__inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 2.5rem;
    align-items: center;
    min-height: var(--mt-site-header-height);
    padding-inline: 1.5rem;
}

.site-brand {
    display: inline-flex;
    gap: 0.9rem;
    align-items: center;
    color: var(--mt-text);
    font-weight: 800;
    text-decoration: none;
}

.site-brand:hover {
    color: var(--mt-text);
}

.site-brand__logo {
    display: block;
    width: 118px;
    height: 96px;
    object-fit: contain;
}

.site-brand__beta {
    margin-left: -0.2rem;
    color: var(--mt-accent);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.site-header__navigation {
    display: flex;
    align-items: center;
}

.site-header__navigation a {
    color: var(--mt-text-muted);
    font-weight: 650;
    text-decoration: none;
}

.site-header__navigation a:hover {
    color: var(--mt-text);
}

.site-header__actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    justify-content: flex-end;
    min-width: max-content;
    padding-left: 1rem;
}

.site-header__user {
    gap: 0.45rem;
    align-items: center;
    color: var(--mt-text-muted);
    text-decoration: none;
}

.site-header__user:hover {
    color: var(--mt-text);
}

.site-header__logout {
    margin: 0;
}

.site-header .public-language-switcher {
    display: flex;
    flex: 0 0 auto;
    gap: 0.2rem;
    padding: 0.2rem;
    border: 1px solid var(--mt-border);
    border-radius: 0.65rem;
}

.site-header .public-language-switcher__form {
    display: flex;
    gap: 0.2rem;
    margin: 0;
}

.site-header .public-language-switcher__option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.35rem 0.5rem;
    border: 0;
    border-radius: 0.45rem;
    background: transparent;
    color: var(--mt-text-muted);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
}

.site-header .public-language-switcher__option--active {
    background: var(--mt-surface-raised);
    color: var(--mt-text);
}

.app-layout,
.public-main {
    padding-top: var(--mt-site-header-height);
}

.app-layout {
    min-height: calc(100vh - var(--mt-site-header-height));
}

.app-sidebar {
    top: var(--mt-site-header-height);
}

.site-footer {
    border-top: 1px solid var(--mt-border);
    background: var(--mt-background-soft);
}

.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: 92px;
    padding: 1.25rem 1.5rem;
}

.site-footer--app {
    margin-left: var(--mt-sidebar-width);
}

.site-footer__brand {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.site-footer__brand img {
    display: block;
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.site-footer__brand p {
    margin: 0.2rem 0 0;
    color: var(--mt-text-muted);
    font-size: 0.85rem;
}

.site-footer__navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: var(--mt-text-muted);
    font-size: 0.9rem;
}

.auth-page {
    min-height: calc(
        100vh
        - var(--mt-site-header-height)
        - 92px
        - 4rem
    );
}

.auth-card__logo {
    display: block;
    width: 220px;
    max-width: 75vw;
    height: auto;
    margin: 0 auto 1.5rem;
    object-fit: contain;
}

@media (max-width: 900px) {
    :root {
        --mt-site-header-height: 92px;
    }

    .site-header__inner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.75rem;
        padding-inline: 1rem;
    }

    .site-brand__logo {
        width: 92px;
        height: 76px;
    }

    .site-header__navigation {
        justify-content: flex-start;
    }

    .site-header__actions {
        gap: 0.35rem;
    }

    .site-header__user,
    .site-header__logout {
        display: none;
    }

    .site-footer--app {
        margin-left: 0;
    }
}

@media (max-width: 650px) {
    :root {
        --mt-site-header-height: 82px;
    }

    .site-brand__logo {
        width: 82px;
        height: 66px;
    }

    .site-header__navigation a {
        font-size: 0.88rem;
    }

    .site-login-button {
        display: none;
    }

    .site-register-button {
        padding-inline: 0.65rem;
        font-size: 0.8rem;
    }

    .site-footer__inner {
        align-items: flex-start;
        flex-direction: column;
    }
}


.site-login-button,
.site-register-button,
.site-header__logout {
    flex: 0 0 auto;
    white-space: nowrap;
}


/*
 * Header-Finalisierung:
 * Flexbox verhindert Überlagerungen zwischen Sprache und Auth-Buttons.
 */

.site-header__inner {
    display: flex;
    gap: 2rem;
    align-items: center;
    min-height: var(--mt-site-header-height);
    padding-inline: 1.5rem;
}

.site-brand {
    flex: 0 0 auto;
}

.site-brand__logo {
    width: 150px;
    height: 100px;
    object-fit: contain;
}

.site-header__navigation {
    flex: 0 0 auto;
}

.site-header__actions {
    position: static !important;
    display: flex;
    flex: 0 0 auto;
    gap: 0.8rem;
    align-items: center;
    margin-left: auto;
    padding-left: 1rem;
    white-space: nowrap;
}

.site-header .public-language-switcher {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    flex: 0 0 auto;
    order: 1;
    margin: 0;
    transform: none !important;
}

.site-header .public-language-switcher__form {
    position: static !important;
    display: flex;
    gap: 0.2rem;
    margin: 0;
    transform: none !important;
}

.site-login-button {
    position: static !important;
    flex: 0 0 auto;
    order: 2;
    margin: 0;
    transform: none !important;
}

.site-register-button {
    position: static !important;
    flex: 0 0 auto;
    order: 3;
    margin: 0;
    transform: none !important;
}

.site-header__user {
    order: 2;
}

.site-header__logout {
    position: static !important;
    flex: 0 0 auto;
    order: 3;
    margin: 0;
    transform: none !important;
}


@media (max-width: 900px) {
    .site-header__inner {
        gap: 0.75rem;
        padding-inline: 1rem;
    }

    .site-brand__logo {
        width: 125px;
        height: 82px;
    }
}


@media (max-width: 650px) {
    .site-brand__logo {
        width: 105px;
        height: 72px;
    }

    .site-header__actions {
        gap: 0.35rem;
        padding-left: 0;
    }
}

/*
 * Eingeloggter Mobile-Header:
 * Navigation steckt bereits im Burger-Menü.
 * Sprache und Burger dürfen sich nicht überlagern.
 */
@media (max-width: 900px) {
    .site-header--authenticated .site-header__navigation {
        display: none;
    }

    .site-header--authenticated .site-header__actions {
        margin-left: auto;
        padding-left: 0;
        gap: 0.55rem;
    }

    .site-header--authenticated .public-language-switcher {
        position: static !important;
        flex: 0 0 auto;
        margin: 0;
        transform: none !important;
    }

    .site-header--authenticated .mobile-navigation-toggle {
        position: static !important;
        flex: 0 0 auto;
        margin: 0;
        transform: none !important;
    }
}

/* Mobile authenticated header final layout */
@media (max-width: 767.98px) {
    .site-header--authenticated .site-header__inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.5rem;
        align-items: center;
        padding-inline: 0.75rem;
    }

    .site-header--authenticated .site-brand {
        min-width: 0;
        overflow: hidden;
    }

    .site-header--authenticated .site-brand__logo {
        width: 96px;
        height: 68px;
        flex: 0 0 auto;
    }

    .site-header--authenticated .site-brand__beta {
        flex: 0 0 auto;
        margin-left: -0.3rem;
        font-size: 0.52rem;
    }

    .site-header--authenticated .site-header__navigation {
        display: none;
    }

    .site-header--authenticated .site-header__actions {
        position: static !important;
        display: flex;
        width: auto;
        min-width: 0;
        gap: 0.45rem;
        align-items: center;
        justify-content: flex-end;
        margin: 0;
        padding: 0;
        white-space: nowrap;
    }

    .site-header--authenticated .public-language-switcher {
        position: static !important;
        inset: auto !important;
        width: auto !important;
        min-width: 0;
        margin: 0 !important;
        padding: 0.15rem;
        flex: 0 0 auto;
        transform: none !important;
    }

    .site-header--authenticated .public-language-switcher__form {
        position: static !important;
        display: flex;
        gap: 0.1rem;
        margin: 0;
        padding: 0;
        transform: none !important;
    }

    .site-header--authenticated
    .public-language-switcher__option {
        min-width: 1.9rem;
        min-height: 2rem;
        padding: 0.3rem 0.4rem;
    }

    .site-header--authenticated .mobile-navigation-toggle {
        position: static !important;
        display: inline-grid !important;
        width: 2.55rem;
        height: 2.55rem;
        flex: 0 0 2.55rem;
        margin: 0;
        transform: none !important;
    }
}


/*
 * Public mobile header.
 *
 * Auf kleinen Displays müssen Branding, Features,
 * Sprachauswahl, Login und Registrierung in eine Zeile passen.
 * Diese Regeln gelten ausschließlich für ausgeloggte Benutzer.
 */
@media (max-width: 767.98px) {
    .site-header:not(.site-header--authenticated)
    .site-header__inner {
        display: flex;
        gap: 0.35rem;
        align-items: center;
        padding-inline: 0.5rem;
    }

    .site-header:not(.site-header--authenticated)
    .site-brand {
        min-width: 0;
        flex: 0 1 auto;
        gap: 0.2rem;
    }

    .site-header:not(.site-header--authenticated)
    .site-brand__logo {
        width: 72px;
        height: 54px;
        flex: 0 0 auto;
    }

    .site-header:not(.site-header--authenticated)
    .site-brand__beta {
        margin-left: -0.15rem;
        font-size: 0.45rem;
    }

    .site-header:not(.site-header--authenticated)
    .site-header__navigation {
        flex: 0 0 auto;
        margin: 0;
    }

    .site-header:not(.site-header--authenticated)
    .site-header__navigation a {
        font-size: 0.72rem;
    }

    .site-header:not(.site-header--authenticated)
    .site-header__actions {
        display: flex;
        min-width: 0;
        gap: 0.2rem;
        align-items: center;
        margin-left: auto;
        padding-left: 0;
    }

    .site-header:not(.site-header--authenticated)
    .public-language-switcher {
        width: auto !important;
        min-width: 0;
        padding: 0.1rem;
        flex: 0 0 auto;
    }

    .site-header:not(.site-header--authenticated)
    .public-language-switcher__option {
        min-width: 1.6rem;
        min-height: 1.9rem;
        padding: 0.25rem 0.3rem;
        font-size: 0.65rem;
    }

    .site-header:not(.site-header--authenticated)
    .site-login-button,
    .site-header:not(.site-header--authenticated)
    .site-register-button {
        min-height: 1.95rem;
        padding: 0.3rem 0.42rem;
        font-size: 0.68rem;
        line-height: 1.1;
        white-space: nowrap;
    }
}


@media (max-width: 380px) {
    .site-header:not(.site-header--authenticated)
    .site-header__inner {
        gap: 0.2rem;
        padding-inline: 0.3rem;
    }

    .site-header:not(.site-header--authenticated)
    .site-brand__logo {
        width: 62px;
        height: 48px;
    }

    .site-header:not(.site-header--authenticated)
    .site-brand__beta {
        display: none;
    }

    .site-header:not(.site-header--authenticated)
    .site-header__navigation a {
        font-size: 0.66rem;
    }

    .site-header:not(.site-header--authenticated)
    .public-language-switcher__option {
        min-width: 1.45rem;
        padding-inline: 0.22rem;
    }

    .site-header:not(.site-header--authenticated)
    .site-login-button,
    .site-header:not(.site-header--authenticated)
    .site-register-button {
        padding-inline: 0.32rem;
        font-size: 0.64rem;
    }
}


/* Public mobile header final */
@media (max-width: 767.98px) {
    .site-header:not(.site-header--authenticated)
    .site-header__inner {
        display: flex;
        width: 100%;
        gap: 0.35rem;
        align-items: center;
        padding-inline: 0.45rem;
        overflow: visible;
    }

    /*
     * Features wird mobil ausgeblendet.
     * Dadurch bleibt genug Platz für Sprache + Auth-Buttons.
     */
    .site-header:not(.site-header--authenticated)
    .site-header__navigation {
        display: none !important;
    }

    .site-header:not(.site-header--authenticated)
    .site-brand {
        flex: 0 0 auto;
        min-width: 0;
        gap: 0.15rem;
    }

    .site-header:not(.site-header--authenticated)
    .site-brand__logo {
        width: 68px;
        height: 50px;
        object-fit: contain;
    }

    .site-header:not(.site-header--authenticated)
    .site-brand__beta {
        margin-left: -0.15rem;
        font-size: 0.45rem;
    }

    .site-header:not(.site-header--authenticated)
    .site-header__actions {
        position: static !important;
        display: flex;
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        gap: 0.25rem;
        align-items: center;
        justify-content: flex-end;
        margin: 0;
        padding: 0;
        overflow: visible;
        white-space: nowrap;
    }

    .site-header:not(.site-header--authenticated)
    .public-language-switcher {
        position: static !important;
        flex: 0 0 auto;
        width: auto !important;
        min-width: 0;
        margin: 0 !important;
        padding: 0.1rem;
        transform: none !important;
    }

    .site-header:not(.site-header--authenticated)
    .public-language-switcher__form {
        display: flex;
        gap: 0.05rem;
        margin: 0;
        padding: 0;
    }

    .site-header:not(.site-header--authenticated)
    .public-language-switcher__option {
        min-width: 1.65rem;
        min-height: 1.9rem;
        padding: 0.25rem 0.3rem;
        font-size: 0.65rem;
    }

    .site-header:not(.site-header--authenticated)
    .site-login-button,
    .site-header:not(.site-header--authenticated)
    .site-register-button {
        position: static !important;
        flex: 0 0 auto;
        min-width: 0;
        min-height: 1.95rem;
        margin: 0;
        padding: 0.3rem 0.45rem;
        font-size: 0.68rem;
        line-height: 1.1;
        white-space: nowrap;
        transform: none !important;
    }
}

@media (max-width: 390px) {
    .site-header:not(.site-header--authenticated)
    .site-header__inner {
        gap: 0.2rem;
        padding-inline: 0.3rem;
    }

    .site-header:not(.site-header--authenticated)
    .site-brand__logo {
        width: 56px;
        height: 46px;
    }

    .site-header:not(.site-header--authenticated)
    .site-brand__beta {
        display: none;
    }

    .site-header:not(.site-header--authenticated)
    .site-header__actions {
        gap: 0.15rem;
    }

    .site-header:not(.site-header--authenticated)
    .public-language-switcher__option {
        min-width: 1.45rem;
        padding-inline: 0.2rem;
        font-size: 0.62rem;
    }

    .site-header:not(.site-header--authenticated)
    .site-login-button,
    .site-header:not(.site-header--authenticated)
    .site-register-button {
        padding-inline: 0.3rem;
        font-size: 0.62rem;
    }
}


/* Public mobile header single row */
@media (max-width: 767.98px) {
    .site-header:not(.site-header--authenticated)
    .site-header__inner {
        display: flex !important;
        width: 100%;
        gap: 0.3rem;
        align-items: center;
        padding: 0.4rem 0.45rem;
        overflow: visible;
    }

    .site-header:not(.site-header--authenticated)
    .site-header__navigation {
        display: none !important;
    }

    .site-header:not(.site-header--authenticated)
    .site-brand {
        display: flex;
        flex: 0 0 auto;
        min-width: 0;
        gap: 0;
        align-items: center;
    }

    .site-header:not(.site-header--authenticated)
    .site-brand__logo {
        width: 66px;
        height: 48px;
        object-fit: contain;
    }

    .site-header:not(.site-header--authenticated)
    .site-brand__beta {
        display: none !important;
    }

    .site-header:not(.site-header--authenticated)
    .site-header__actions {
        position: static !important;
        display: flex !important;
        flex: 1 1 auto;
        width: auto !important;
        min-width: 0;
        gap: 0.25rem;
        align-items: center;
        justify-content: flex-end;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible;
        white-space: nowrap;
    }

    .site-header:not(.site-header--authenticated)
    .site-header__actions > div {
        display: block !important;
        grid-area: auto !important;
        flex: 0 0 auto;
        margin: 0 !important;
    }

    .site-header:not(.site-header--authenticated)
    .public-language-switcher {
        position: static !important;
        display: flex !important;
        width: auto !important;
        min-width: 0;
        margin: 0 !important;
        padding: 0.1rem;
        transform: none !important;
    }

    .site-header:not(.site-header--authenticated)
    .public-language-switcher__form {
        display: flex !important;
        gap: 0;
        margin: 0;
        padding: 0;
    }

    .site-header:not(.site-header--authenticated)
    .public-language-switcher__option {
        min-width: 1.75rem;
        min-height: 2rem;
        padding: 0.25rem 0.3rem;
        font-size: 0.68rem;
    }

    .site-header:not(.site-header--authenticated)
    .site-login-button,
    .site-header:not(.site-header--authenticated)
    .site-register-button {
        position: static !important;
        display: inline-flex !important;
        grid-area: auto !important;
        width: auto !important;
        min-width: 0;
        min-height: 2rem;
        flex: 0 0 auto;
        margin: 0 !important;
        padding: 0.35rem 0.5rem;
        align-items: center;
        justify-content: center;
        font-size: 0.7rem;
        line-height: 1;
        white-space: nowrap;
        transform: none !important;
    }
}

@media (max-width: 390px) {
    .site-header:not(.site-header--authenticated)
    .site-header__inner {
        gap: 0.18rem;
        padding-inline: 0.3rem;
    }

    .site-header:not(.site-header--authenticated)
    .site-brand__logo {
        width: 58px;
        height: 44px;
    }

    .site-header:not(.site-header--authenticated)
    .site-header__actions {
        gap: 0.15rem;
    }

    .site-header:not(.site-header--authenticated)
    .public-language-switcher__option {
        min-width: 1.55rem;
        padding-inline: 0.2rem;
        font-size: 0.64rem;
    }

    .site-header:not(.site-header--authenticated)
    .site-login-button,
    .site-header:not(.site-header--authenticated)
    .site-register-button {
        padding-inline: 0.38rem;
        font-size: 0.66rem;
    }
}
