/* Grundlegende Stile */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: #000;
    background-color: #fff;
    padding: 60px;
    box-sizing: border-box;
    overflow-x: hidden;
    /* Verhindert horizontales Scrollen */
}

a {
    text-decoration: none;
    color: #000;
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 60px;
    /* Berücksichtigt das Padding des Body */
    right: 60px;
    background-color: #fff;
    display: flex;
    align-items: center;
    z-index: 3000;
    /* Erhöhte Z-Index, damit Header über dem Nav-Menü liegt */
    height: 80px;
    /* Anpassbar */
}

.logo {
    flex: 1;
    margin-top: 60px;
    /* Padding oberhalb des Logos */
}

.logo a {
    text-decoration: none;
    display: block;
}

.logo h1 {
    margin: 0;
    font-size: 36px;
    /* Größere Schriftgröße */
    font-weight: 200;
    /* Dünnere Schrift */
    color: #333;
    /* Tiefer Grauton */
    line-height: 1.2;
}

.logo h1:first-child {
    margin-bottom: -10px;
}

.mobile-header {
    display: none;
}

.hamburger {
    font-size: 30px;
    cursor: pointer;
}

/* Navigation Menu */
.nav-menu {
    width: 180px;
    position: fixed;
    top: 140px;
    /* Höhe des Headers */
    left: 60px;
    /* Berücksichtigt das Padding des Body */
    bottom: 60px;
    /* Berücksichtigt das Padding des Body */
    background-color: #fff;
    overflow: visible;
    /* Ermöglicht das Überlaufen des Submenus */
}

.nav-menu ul {
    margin-top: 0px;
}

.nav-menu ul li {
    position: relative;
    text-align: left;
    height: 40px;
    line-height: 40px;
    width: 100%;
    padding-left: 10px;
}

.nav-menu ul li a,
.nav-menu ul li .menu-item-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
    transition: color 0.2s ease;
    cursor: pointer;
}

/* Hover-Effekt für Hauptmenü-Einträge */
.nav-menu ul li a:hover,
.nav-menu ul li .menu-item-parent:hover {
    color: #FF00FF;
    /* Knallige Magenta-Farbe */
    background-color: #f3f3f3;
    /* Leichter Hintergrund für besseren Kontrast */
}

/* Hover-Effekt für den gesamten Menüpunkt */
.nav-menu ul li:hover {
    background-color: #f4f4f4;
    /* Leichter Hintergrund für besseren Kontrast */
}

.nav-menu ul li .arrow-icon {
    font-size: 16px;
    margin-left: 5px;
    transition: transform 0.3s, color 0.2s ease;
}

/* Hover-Effekt für den Pfeil */
.nav-menu ul li a:hover .arrow-icon,
.nav-menu ul li .menu-item-parent:hover .arrow-icon {
    color: #FF00FF;
    /* Knallige Magenta-Farbe */
}

.nav-menu ul li:after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: #000;
}

.nav-menu ul li:first-child:before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -1px;
    height: 1px;
    background: #000;
}

.nav-menu ul li:last-child:after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: #000;
}

.nav-menu ul li .submenu {
    display: none;
    position: absolute;
    left: 100%;
    /* Positioniert das Submenu rechts neben dem Hauptmenü */
    top: 0;
    background-color: #fff;
    min-width: max-content;
    /* Mindestbreite basierend auf Inhalt */
    padding: 0;
    /* Entfernt Standard-Padding */
    z-index: 1000;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
    /* Leichter Schatten für bessere Sichtbarkeit */
}

/* Stellt sicher, dass das Submenu die Breite des längsten Textes annimmt */
.nav-menu ul li.has-submenu:hover>.submenu {
    display: block;
}

.nav-menu ul li .submenu li {
    position: relative;
    height: 40px;
    line-height: 40px;
    padding: 0 20px;
    /* Mehr Platz für den Text */
    white-space: nowrap;
    /* Verhindert Textumbrüche */
    width: 100%;
    /* Volle Breite des Submenüs */
}

.nav-menu ul li .submenu li a {
    display: block;
    width: 100%;
    padding: 0;
    transition: color 0.2s ease;
}

/* Hover-Effekt für Submenü-Einträge */
.nav-menu ul li .submenu li:hover {
    background-color: #f0f0f0;
    /* Leichter Hintergrund für besseren Kontrast */
}

.nav-menu ul li .submenu li:hover a {
    color: #FF00FF;
    /* Knallige Magenta-Farbe */
}

.nav-menu ul li .submenu li:after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: #000;
}

.nav-menu ul li .submenu li:first-child:before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -1px;
    height: 1px;
    background: #000;
}

.nav-menu ul li .submenu li:last-child:after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: #000;
}

/* Desktop Submenu on Hover */
@media (min-width: 769px) {
    .nav-menu ul li.has-submenu>a {
        cursor: default;
    }

    .nav-menu ul li.has-submenu>a .arrow-icon {
        transform: none;
    }

    .main-content {
        margin-left: 240px;
        /* Platz für Menübreite + Body-Padding */
        padding-top: 100px;
        /* Platz für Header */
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    body {
        padding: 20px;
        overflow-x: hidden;
        /* Verhindert horizontales Scrollen */
    }

    header {
        left: 20px;
        right: 20px;
        z-index: 3000;
        /* Stellt sicher, dass der Header über dem Nav-Menü liegt */
    }

    .nav-menu {
        width: 250px;
        position: fixed;
        top: 80px;
        /* Höhe des Headers */
        right: -270px;
        left: auto;
        bottom: 0;
        transition: right 0.3s ease;
        z-index: 2000;
    }

    .nav-menu.active {
        right: 20px;
        /* Ausrichtung mit Body-Padding */
    }

    .nav-menu ul li {
        padding-top: 12px;
        padding-bottom: 8px;
        padding-left: 10px;
        height: auto;
        line-height: normal;
        /* Normalisiert Zeilenhöhe */
    }

    .nav-menu ul li .submenu {
        position: static;
        display: none;
        padding-left: 20px;
    }

    .nav-menu ul li.active .submenu {
        display: block;
    }

    .nav-menu ul li .submenu li {
        padding-left: 10px;
        height: auto;
        /* Entfernt feste Höhe */
        line-height: normal;
        /* Normalisiert Zeilenhöhe */
    }

    .nav-menu ul li.has-submenu .menu-item-parent .arrow-icon {
        transition: transform 0.3s;
    }

    .nav-menu ul li.active .menu-item-parent .arrow-icon {
        transform: rotate(90deg);
    }

    .main-content {
        margin-left: 0;
        padding-top: 100px;
        /* Platz für Header */
    }

    .mobile-header {
        display: block;
        margin-left: auto;
    }

    .hamburger {
        margin-left: auto;
    }

    .nav-menu ul li .submenu li:last-child:after {
        height: 0px;
        background: #00000000;
    }

    .nav-menu ul li .submenu li:first-child:before {
        height: 0px;
        background: #00000000;
    }

    .logo {
        flex: 1;
        margin-top: 20px;
        /* Padding oberhalb des Logos */

    }
}
