/* =========================================================
   Navbar-Styles
   Definiert Layout, Interaktion und Responsive-Verhalten
   für das globale Navbar-Fragment.
   ========================================================= */

/* Navbar-spezifische Variable (Höhe für Sticky-Layout) */
:root {
    --navbar-height: 64px;
}

/* =========================================================
   Navbar – Desktop/Standard
   ========================================================= */

.navbar {
    /* Sticky Navigation bleibt beim Scrollen am oberen Rand */
    position: sticky;
    top: 0;
    z-index: 20;

    /* Mindesthöhe über Variable steuerbar */
    min-height: var(--navbar-height);

    /* Halbtransparent + Blur-Effekt für „Glass“-Look */
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(10px);

    /* Trennlinie zur Seite */
    border-bottom: 1px solid rgba(225, 225, 225, .8);

    /* Innenabstand links/rechts */
    padding: 0 24px;

    /* Flex-Layout: Logo links, User/Links rechts */
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

/* Linker und rechter Bereich der Navbar */
.navbar-left,
.navbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0; /* verhindert Layout-Probleme bei langen Inhalten */
}

/* Logo-Link (Branding) */
.nav-logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-dark);
    text-decoration: none;
    white-space: nowrap;
}

/* Container für eingeloggte/ausgeloggte Nutzeransicht */
.nav-user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: .95rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Standard-Navigationslink */
.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: .95rem;
    position: relative;  /* benötigt für Unterstreichung (::after) */
    padding: 8px 4px;
    white-space: nowrap;
}

/* Hover-Farbe für Links */
.nav-link:hover {
    color: var(--accent-dark);
}

/* Unterstreichungsanimation per Pseudoelement */
.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 2px;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition-fast);
}

.nav-link:hover::after {
    width: 100%;
}

/* =========================================================
   Mobile-Layout (max-width: 640px)
   ========================================================= */

@media (max-width: 640px) {

    /* Navbar wird vertikal gestapelt:
       oben Logo, darunter scrollbarer Link-Bereich */
    .navbar {
        padding: 10px 14px;
        min-height: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .navbar-left {
        width: 100%;
        justify-content: flex-start;
    }

    /* Rechter Bereich wird horizontal scrollbar,
       damit Links nicht umbrechen oder zu klein werden */
    .navbar-right {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }

    /* Scrollbar optisch ausblenden (WebKit) */
    .navbar-right::-webkit-scrollbar {
        height: 0;
    }

    /* Kompaktere Abstände auf Mobile */
    .nav-user {
        gap: 10px;
    }

    /* Label "Angemeldet als" ausblenden für Platz */
    .nav-label {
        display: none;
    }

    /* Links als „Chips/Buttons“ darstellen (bessere Touch-Ziele) */
    .nav-link {
        padding: 10px 10px;
        border: 1px solid rgba(225, 225, 225, .8);
        border-radius: 10px;
        background: rgba(255, 255, 255, .9);
    }

    /* Unterstreichungsanimation auf Mobile deaktivieren */
    .nav-link::after {
        display: none;
    }
}
