/* === Grunddesign Navbar === */
.navbar {
    background: hsla(222, 47%, 11%, 0.95); /* Dunkles, leicht transparent */
    height: 80px;
    display: flex;
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    /* Box-Shadow nur leicht unten, nicht über Dropdown */
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1300px;
}



.navbar-logo {
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    position: relative;
    background: linear-gradient(90deg, hsl(200, 80%, 60%), hsl(28, 90%, 55%));
    background-size: 200% 100%; /* für Animation */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.3s ease;
    /* Schatten reduziert für schärfere Kanten */
    text-shadow: 0 0 0 rgba(0,0,0,0);
}

/* Hover: einmaliger Farb-Pop */
.navbar-logo:hover {
    animation: popColor 0.5s ease forwards;
    transform: scale(1.15);
}

@keyframes popColor {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 0%;
    }
    100% {
        background-position: 0% 0%;
    }
}

/* Unterstreichen */
.navbar-logo::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, hsl(28, 90%, 55%), hsl(200, 80%, 60%));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.navbar-logo:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* === Burger Menu === */
.navbar-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    cursor: pointer;
    background: none;
    border: none;
}

.bar {
    height: 3px;
    width: 100%;
    background-color: hsl(213, 31%, 91%);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.navbar-toggle.active .bar:nth-child(2) {
    opacity: 0;
}
.navbar-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.navbar-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* === Dropdown Menü Animation === */
.navbar-links {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) scaleY(0);
    transform-origin: top;
    width: 1050px;
    background: hsla(222, 47%, 11%, 0.95);
    backdrop-filter: blur(8px);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px 8px;
    justify-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 0 0 1rem 1rem;
    transition: transform 0.35s ease-in-out;
    z-index: 999;
}




.navbar-links.active {
    transform: translateX(-50%) scaleY(1);
    backdrop-filter: blur(8px);
}

/* === Boxen Links === */
.nav-box {
    position: relative; /* nötig für Overlay */
    background: hsl(222, 47%, 9%);
    border-radius: 10px;
    padding: 20px 25px;
    text-align: center;
    transition: all 0.3s ease, transform 0.2s ease;
    width: 200px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Overlay innerhalb der Box */
}

.nav-box a {
    color: hsl(213, 31%, 91%);
    text-decoration: none;
    font-weight: 500;
    width: 100%;
    z-index: 2; /* Text über Overlay */
    position: relative;
}

.nav-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px hsla(28, 90%, 55%, 0.4);
}

/* Overlay für dezente Tönung */
.nav-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: hsla(222, 47%, 11%, 0.5); /* halbtransparent */
    border-radius: 10px;
    z-index: 1;
    pointer-events: none;
}

/* Hover-Effekt für Hintergrundfarbe */
.nav-box:hover::before {
    background: hsla(28, 90%, 55%, 0.4); /* leichte Farbänderung beim Hover */
}

/* Navbar-Abstand zwischen Boxen */
.navbar-links {
    gap: 6px 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-links {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        width: 90%;
        gap: 6px 8px;
    }
}


/* Navbar Profil Link */
.navbar-profile {
    display: flex;
    align-items: center;      /* vertikal zentrieren */
    gap: 8px;
    text-decoration: none;
    color: hsl(213, 31%, 91%);
    font-weight: 500;
    height: 40px;             /* feste Höhe des Containers */
    flex-shrink: 0;
}

/* Avatar-Bild */
.navbar-profile .navbar-avatar {
    width: 50px;              /* feste Breite */
    height: 50px;             /* feste Höhe */
    border-radius: 50%;       /* rund */
    object-fit: cover;        /* füllt Kreis, kein Stretch */
    border: 2px solid hsla(213, 31%, 91%, 0.7);
    flex-shrink: 0;           /* nicht schrumpfen */
    display: block;           /* kein Inline-Problem */
    transition: transform 0.2s ease, box-shadow 0.3s ease, border-color 0.2s ease;
}

/* Hover-Glow */
.navbar-profile:hover .navbar-avatar {
    transform: scale(1.1);
    box-shadow: 0 0 8px 2px hsl(28, 90%, 55%);
    border-color: hsl(28, 90%, 55%);
}

/* Username */
.navbar-profile .profile-username {
    font-size: 1rem;
    white-space: nowrap;
    line-height: 1;           /* vertikale Zentrierung */
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-profile {
        height: 32px;
    }
    .navbar-profile .navbar-avatar {
        width: 28px;
        height: 28px;
    }
    .navbar-profile .profile-username {
        font-size: 0.9rem;
    }
}
