/* Navbar Styles */
.navbar {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 4.5em;
    background-color: #282424;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.navbar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    height: 100%;
}

.navbar-item {
    position: relative;
}

.navbar a {
    display: block;
    padding: 1.2em 2em;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease-in-out;
}

.navbar a:hover {
    background-color: #444;
}

/* Dropdown Menu */
.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 200px;
    background: #333;
    list-style: none;
    padding: 0;
    border-radius: 5px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.nav-dropdown-item a {
    padding: 12px 20px;
    display: block;
    text-align: left;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease-in-out;
}

.nav-dropdown-item a:hover {
    background-color: #555;
}

/* Show the main dropdown when hovering over its parent */
.navbar-item:hover > .nav-dropdown {
    display: block;
}

/* Nested Dropdown: hidden by default and positioned to the right */
.nested-dropdown {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;  /* positions it to the right of its parent */
    width: 200px;
    background: #333;
    border-radius: 5px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 1002;
}

/* Show nested dropdown only when hovering over its parent nav-dropdown-item */
.nav-dropdown-item:hover > .nested-dropdown {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        height: auto;
    }

    .navbar-menu {
        flex-direction: column;
    }

    .navbar a {
        padding: 1em;
    }

    .nav-dropdown {
        width: 100%;
        position: static;
    }
}
