/* ==================== OPTIMIERTE NAVIGATION STYLES ==================== */

/* Allgemeine Navigation Styles */
#navigation {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    border-bottom: 2px solid var(--bloodred);
    z-index: 1000;
    padding: 12px 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] #navigation {
    background-color: rgba(18, 18, 18, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 0 30px;
}

/* Navigation Links Container */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Grundstil für alle Links */
.nav-links a {
    text-decoration: none;
    font-family: 'JosefinSlab-SemiBold', serif;
    font-size: 1.1rem;
    padding: 8px 16px;
    border: 2px solid transparent;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: inline-block;
    white-space: nowrap;
    letter-spacing: 0.5px;
    color: var(--text-color);
}

/* Link Farben entsprechend der CI */
.nav-links a[href="index.html"],
.nav-links a[href="graphix.html"],
.nav-links a[href="about.html"] {
    color: var(--bloodred);
    border-color: var(--bloodred);
}

.nav-links a[href="corporate.html"] {
    color: var(--lowred);
    border-color: var(--lowred);
}

.nav-links a[href="motion.html"],
.nav-links a[href="learn.html"],
.nav-links a[href="projekt.html"],
.nav-links a[href="game.html"] {
    color: var(--green);
    border-color: var(--green);
}

.nav-links a[href="web.html"],
.nav-links a[href="datenschutz.html"],
.nav-links a[href="agb.html"],
.nav-links a[href="impressum.html"],
.nav-links a[href="/login.php"] {
    color: var(--grey);
    border-color: var(--grey);
}

/* Verbesserte Hover-Effekte für Links */
.nav-links a:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background-color: rgba(0, 0, 0, 0.05);
}

/* Dark Mode Anpassungen für Links */
[data-theme="dark"] .nav-links a {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .nav-links a[href="index.html"],
[data-theme="dark"] .nav-links a[href="graphix.html"],
[data-theme="dark"] .nav-links a[href="about.html"] {
    color: var(--bloodred);
}

[data-theme="dark"] .nav-links a[href="corporate.html"] {
    color: var(--lowred);
}

[data-theme="dark"] .nav-links a[href="motion.html"],
[data-theme="dark"] .nav-links a[href="learn.html"],
[data-theme="dark"] .nav-links a[href="projekt.html"],
[data-theme="dark"] .nav-links a[href="game.html"] {
    color: var(--green);
}

[data-theme="dark"] .nav-links a[href="web.html"],
[data-theme="dark"] .nav-links a[href="agb.html"],
[data-theme="dark"] .nav-links a[href="datenschutz.html"],
[data-theme="dark"] .nav-links a[href="impressum.html"],
[data-theme="dark"] .nav-links a[href="/login.php"] {
    border-color: #ffffff;
    color: #ffffff;
}

[data-theme="dark"] .nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* AKTIVE LINKS - Direktes Styling ohne .active Klasse */
/* Erkennung der aktiven Seite über URL-Vergleich */
.nav-links a[href="index.html"]:is(:link, :visited):where([aria-current="page"], .active, .current-page),
html[data-current-page="index"] .nav-links a[href="index.html"] {
    background-color: var(--bloodred);
    color: white !important;
    font-weight: bold;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
    position: relative;
}

.nav-links a[href="graphix.html"]:is(:link, :visited):where([aria-current="page"], .active, .current-page),
html[data-current-page="graphix"] .nav-links a[href="graphix.html"] {
    background-color: var(--bloodred);
    color: white !important;
    font-weight: bold;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
    position: relative;
}

.nav-links a[href="about.html"]:is(:link, :visited):where([aria-current="page"], .active, .current-page),
html[data-current-page="about"] .nav-links a[href="about.html"] {
    background-color: var(--bloodred);
    color: white !important;
    font-weight: bold;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
    position: relative;
}

.nav-links a[href="corporate.html"]:is(:link, :visited):where([aria-current="page"], .active, .current-page),
html[data-current-page="corporate"] .nav-links a[href="corporate.html"] {
    background-color: var(--lowred);
    color: white !important;
    font-weight: bold;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
    position: relative;
}

.nav-links a[href="motion.html"]:is(:link, :visited):where([aria-current="page"], .active, .current-page),
html[data-current-page="motion"] .nav-links a[href="motion.html"] {
    background-color: var(--green);
    color: white !important;
    font-weight: bold;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
    position: relative;
}

.nav-links a[href="web.html"]:is(:link, :visited):where([aria-current="page"], .active, .current-page),
html[data-current-page="web"] .nav-links a[href="web.html"] {
    background-color: var(--grey);
    color: white !important;
    font-weight: bold;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
    position: relative;
}

.nav-links a[href="game.html"]:is(:link, :visited):where([aria-current="page"], .active, .current-page),
html[data-current-page="game"] .nav-links a[href="game.html"] {
    background-color: var(--green);
    color: white !important;
    font-weight: bold;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
    position: relative;
}

.nav-links a[href="learn.html"]:is(:link, :visited):where([aria-current="page"], .active, .current-page),
html[data-current-page="learn"] .nav-links a[href="learn.html"] {
    background-color: var(--green);
    color: white !important;
    font-weight: bold;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
    position: relative;
}

.nav-links a[href="projekt.html"]:is(:link, :visited):where([aria-current="page"], .active, .current-page),
html[data-current-page="projekt"] .nav-links a[href="projekt.html"] {
    background-color: var(--green);
    color: white !important;
    font-weight: bold;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
    position: relative;
}

.nav-links a[href="impressum.html"]:is(:link, :visited):where([aria-current="page"], .active, .current-page),
html[data-current-page="impressum"] .nav-links a[href="impressum.html"] {
    background-color: var(--grey);
    color: white !important;
    font-weight: bold;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
    position: relative;
}

.nav-links a[href="datenschutz.html"]:is(:link, :visited):where([aria-current="page"], .active, .current-page),
html[data-current-page="datenschutz"] .nav-links a[href="datenschutz.html"] {
    background-color: var(--grey);
    color: white !important;
    font-weight: bold;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
    position: relative;
}

.nav-links a[href="agb.html"]:is(:link, :visited):where([aria-current="page"], .active, .current-page),
html[data-current-page="agb"] .nav-links a[href="agb.html"] {
    background-color: var(--grey);
    color: white !important;
    font-weight: bold;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
    position: relative;
}

.nav-links a[href="/login.php"]:is(:link, :visited):where([aria-current="page"], .active, .current-page),
html[data-current-page="login"] .nav-links a[href="/login.php"] {
    background-color: var(--grey);
    color: white !important;
    font-weight: bold;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
    position: relative;
}

/* Hamburger Menu für mobile Ansicht */
.hamburger-menu {
    display: none;
    cursor: pointer;
    width: 30px;
    height: 24px;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    justify-content: space-between;
    z-index: 1001;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--bloodred);
    transition: all 0.3s ease;
    border-radius: 3px;
}

[data-theme="dark"] .hamburger-line {
    background-color: var(--lowred);
}

/* Verbesserte Mobile Navigation */
@media (max-width: 992px) {
    .nav-links {
        gap: 12px;
    }
    
    .nav-links a {
        font-size: 1rem;
        padding: 6px 12px;
    }
}

@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }
    
    .hamburger-menu.active .hamburger-line:nth-child(1) {
        transform: translateY(10.5px) rotate(45deg);
    }
    
    .hamburger-menu.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger-menu.active .hamburger-line:nth-child(3) {
        transform: translateY(-10.5px) rotate(-45deg);
    }
    
    .nav-container {
        justify-content: center;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background-color: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 80px;
        gap: 15px;
        transition: all 0.4s ease;
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
        z-index: 1000;
    }
    
    [data-theme="dark"] .nav-links {
        background-color: rgba(18, 18, 18, 0.98);
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.4);
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-links li {
        width: 90%;
        margin-bottom: 8px;
    }
    
    .nav-links a {
        width: 100%;
        text-align: left;
        padding: 14px 20px;
        font-size: 1.2rem;
        border: none;
        border-left: 4px solid transparent;
        background: transparent;
        display: flex;
        align-items: center;
    }
    
    .nav-links a::before {
        content: "→";
        margin-right: 10px;
        transition: transform 0.3s ease;
    }
    
    .nav-links a:hover::before {
        transform: translateX(5px);
    }
    
    /* Link Farben in der mobilen Ansicht */
    .nav-links a[href="index.html"],
    .nav-links a[href="graphix.html"],
    .nav-links a[href="about.html"] {
        border-left-color: var(--bloodred);
    }
    
    .nav-links a[href="motion.html"],
    .nav-links a[href="impressum.html"],
    .nav-links a[href="learn.html"],
    .nav-links a[href="projekt.html"] {
        border-left-color: var(--green);
    }
    
    .nav-links a[href="corporate.html"],
    .nav-links a[href="datenschutz.html"] {
        border-left-color: var(--lowred);
    }
    
    .nav-links a[href="web.html"],
    .nav-links a[href="game.html"],
    .nav-links a[href="agb.html"],
    .nav-links a[href="/login.php"] {
        border-left-color: var(--grey);
    }
    
    /* Verbesserte aktive Links in mobiler Ansicht */
    .nav-links a[href]:is(:link, :visited):where([aria-current="page"], .active, .current-page),
    html[data-current-page] .nav-links a[href$=".html"],
    html[data-current-page] .nav-links a[href$=".php"] {
        background-color: rgba(0, 0, 0, 0.05);
        border-left-width: 8px;
        font-weight: bold;
        padding-left: 16px;
        transform: none;
        box-shadow: none;
    }
    
    /* Dark Mode Anpassungen für mobile Links */
    [data-theme="dark"] .nav-links a[href="web.html"],
    [data-theme="dark"] .nav-links a[href="game.html"],
    [data-theme="dark"] .nav-links a[href="agb.html"],
    [data-theme="dark"] .nav-links a[href="impressum.html"],
    [data-theme="dark"] .nav-links a[href="datenschutz.html"],
    [data-theme="dark"] .nav-links a[href="/login.php"] {
        border-left-color: #ffffff;
        color: #ffffff;
    }
    
    /* Hover-Effekt für mobile Links */
    .nav-links a:hover {
        transform: none;
        background-color: rgba(0, 0, 0, 0.05);
    }
    
    [data-theme="dark"] .nav-links a:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
    
    /* Overlay für Mobile Navigation */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(3px);
        z-index: 999;
    }
    
    .nav-overlay.active {
        display: block;
    }
}

/* Optimierung für sehr kleine Bildschirmen */
@media (max-width: 360px) {
    .nav-links li {
        width: 95%;
    }
    
    .nav-links a {
        padding: 12px 15px;
    }
    
    .hamburger-menu {
        left: 15px;
    }
}

/* Barrierefreiheits-Verbesserungen */
.nav-links a:focus {
    outline: 2px dashed var(--bloodred);
    outline-offset: 2px;
}

[data-theme="dark"] .nav-links a:focus {
    outline-color: var(--green);
}

/* Füge dieses Script am Ende der CSS-Datei hinzu, um die aktive Seite zu markieren */
@supports (content: attr(data-current-page)) {
    html:not([data-current-page]) {
        content: attr(data-current-page);
    }
}
