/* =========================================================
   Stargrave – Header (Sci-Fi HUD)
   Datei: /public/css/header.css
   ========================================================= */

/* -------------------------
   Grundlayout Header
------------------------- */

.sgHeader {
    position: sticky;
    top: 0;
    z-index: 20;
    background:
        radial-gradient(circle at 0% 0%, rgba(74, 242, 255, 0.16), transparent 60%),
        radial-gradient(circle at 100% 0%, rgba(192, 140, 255, 0.16), transparent 60%),
        linear-gradient(to bottom,
            rgba(3, 6, 16, 0.98),
            rgba(3, 6, 16, 0.90),
            rgba(3, 6, 16, 0.65),
            rgba(3, 6, 16, 0.0)
        );
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.85);
    overflow: visible;
}

/* Neon-Linie + dezente Scanlines */

.sgHeader::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--sg-accent), var(--sg-accent-2));
    opacity: 0.95;
    box-shadow: 0 0 20px rgba(74, 242, 255, 0.7);
    pointer-events: none;
}

.sgHeader::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(
            transparent 0,
            rgba(255, 255, 255, 0.03) 1px,
            transparent 2px
        );
    background-size: 100% 10px;
    opacity: 0.2;
    pointer-events: none;
}

/* -------------------------
   Innerer Wrapper (3 Spalten)
------------------------- */

.sgHeader__inner {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: flex-end;
    gap: 24px;
    padding: 10px 0 12px;
}

/* Leichte Glasfläche unter Mitte/Buttons */

.sgHeader__inner::before {
    content: "";
    position: absolute;
    left: 24%;
    right: 6%;
    bottom: 4px;
    height: 44px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 50% 0%, rgba(74, 242, 255, 0.22), transparent 70%);
    opacity: 0.55;
    filter: blur(6px);
    pointer-events: none;
}

/* Spaltenbasics */

.sgHeader__left,
.sgHeader__center,
.sgHeader__right {
    position: relative;
    z-index: 1;
}

/* -------------------------
   Brand / Logo (links)
------------------------- */

.sgBrand {
    display: inline-flex;
    align-items: flex-end;
    gap: 12px;
    min-width: 0;
}

.sgBrand__logo {
    display: block;
    height: 200px;
    width: auto;
    margin-top: -20px; /* weniger Überstand nach oben, Logo rutscht tiefer */
    filter:
        drop-shadow(0 12px 30px rgba(0, 0, 0, 0.9))
        drop-shadow(0 0 26px rgba(74, 242, 255, 0.45));
    transition:
        transform 0.18s ease-out,
        filter 0.18s ease-out;
}

.sgBrand:hover .sgBrand__logo {
    transform: translateY(-2px);
    filter:
        drop-shadow(0 16px 40px rgba(0, 0, 0, 1))
        drop-shadow(0 0 32px rgba(74, 242, 255, 0.6));
}

/* -------------------------
   Status + Navigation (Mitte)
------------------------- */

.sgHeaderStatusRow {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.sgHeaderStatusPill {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(196, 209, 240, 0.96);
    background: rgba(4, 8, 22, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.8),
        0 0 12px rgba(74, 242, 255, 0.18);
}

/* Navigation */

.sgNav {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.sgNav__link {
    position: relative;
    font-size: 0.78rem;
    color: rgba(215, 224, 255, 0.9);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    background:
        radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.06), transparent 55%),
        rgba(6, 10, 26, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.7),
        0 0 16px rgba(74, 242, 255, 0.12);
    transition:
        background-color 0.16s ease-out,
        border-color 0.16s ease-out,
        color 0.16s ease-out,
        box-shadow 0.16s ease-out,
        transform 0.12s ease-out;
}

.sgNav__link::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 4px;
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--sg-accent), var(--sg-accent-2));
    opacity: 0;
    transform: scaleX(0.4);
    transform-origin: center;
    transition:
        opacity 0.16s ease-out,
        transform 0.16s ease-out;
}

.sgNav__link:hover {
    color: rgba(255, 255, 255, 0.98);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(74, 242, 255, 0.2);
    transform: translateY(-1px);
}

.sgNav__link:hover::after {
    opacity: 1;
    transform: scaleX(1);
}

/* -------------------------
   Right: Zugang / User
------------------------- */

/* Guest: Access Panel */

.sgHeaderAccess {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 16px;
    background:
        radial-gradient(circle at 0% 0%, rgba(74, 242, 255, 0.22), transparent 70%),
        rgba(4, 8, 22, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 10px 26px rgba(0, 0, 0, 0.9),
        0 0 26px rgba(74, 242, 255, 0.24);
    max-width: 260px;
}

.sgHeaderAccess__label {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(185, 199, 236, 0.96);
}

.sgHeaderAccess__hint {
    font-size: 0.8rem;
    color: rgba(205, 215, 244, 0.96);
}

.sgHeaderAccess__actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

/* User: eingeloggter Zustand */

.sgHeaderUser {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(4, 8, 22, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.85),
        0 0 20px rgba(74, 242, 255, 0.20);
}

.sgHeaderUser__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sgHeaderUser__label {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(180, 194, 230, 0.96);
}

.sgHeaderUser__name {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(230, 238, 255, 0.98);
}

.sgHeaderUser__btn {
    font-size: 0.8rem;
}

/* -------------------------
   Buttons im Header leicht anpassen
------------------------- */

.sgHeader__right .sgBtn {
    padding-block: 8px;
    padding-inline: 14px;
    font-size: 0.8rem;
}

.sgHeader__right .sgBtnPrimary {
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.8),
        0 0 24px rgba(74, 242, 255, 0.35);
}

.sgHeader__right .sgBtnPrimary:hover {
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.9),
        0 0 30px rgba(74, 242, 255, 0.45);
}

/* -------------------------
   Responsive
------------------------- */

@media (max-width: 980px) {
    .sgHeader__inner {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: auto auto;
        row-gap: 10px;
    }

    .sgHeader__left {
        grid-column: 1 / 2;
        grid-row: 1 / 3;
    }

    .sgHeader__center {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }

    .sgHeader__right {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        justify-self: flex-end;
    }

    .sgBrand__logo {
        height: 150px;
        margin-top: -16px; /* auch hier weniger Überstand */
    }

    .sgHeader__inner::before {
        left: 32%;
        right: 4%;
        height: 38px;
    }
}

@media (max-width: 640px) {
    .sgHeader__inner {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        row-gap: 10px;
    }

    .sgHeader__left {
        order: 1;
        justify-self: flex-start;
    }

    .sgHeader__center {
        order: 3;
    }

    .sgHeader__right {
        order: 2;
        justify-self: stretch;
    }

    .sgBrand__logo {
        height: 120px;
        margin-top: -10px; /* mobile: nur minimal überstehend */
    }

    .sgHeader__inner::before {
        left: 10%;
        right: 10%;
        bottom: 0;
        height: 34px;
    }

    .sgHeaderAccess {
        max-width: 100%;
    }
}
