/* General Styles */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background: rgb(10, 2, 17);
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #150524;
    padding: 10px;
    text-align: center;
}

header h1 {
    margin-top: 5px;
    margin-bottom: 5px;
    font-size: 2rem;
    color: #FFE500;
}

nav {
    background-color: #23083d;
    position: relative;
}

.nav-links {
    display: flex;
    justify-content: center;
    padding: 10px 0;
    align-items: center;
    list-style: none;
    margin: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

a {
    color: #7D1DD3;
    text-decoration: underline;
}

a:hover {
    color: #FFE500;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    padding: 10px 15px;
    transition: background 0.3s ease, color 0.3s ease;
    font-weight: bold;
}

.dropbtn::after {
    content: '☰';
    padding-left: 5px;
    color: #7D1DD3;
}

.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #333;
    max-width: 160px;
    z-index: 1;
    top: 100%;
    left: 0;
}

.dropdown:hover > .dropdown-content {
    display: block; /* Display the first-level dropdown */
}

/* Ensure submenus are only visible when hovering directly over the submenu's parent */
.dropdown-content .dropdown-submenu:hover > .dropdown-content {
    display: block; /* Only show the submenu when hovering over the submenu parent */
}

.dropdown-content .dropdown-submenu > .dropdown-content {
    display: none; /* Hide submenu until specifically hovered over */
}

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-content {
    top: 0;
    left: 100%;
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #575757;
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
    font-size: 24px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    position: absolute;
    top: 12px;
    right: 42%; /* Positioned on the right */
}

/* Responsive Styles */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        text-align: center;
        width: 40px;
        height: 40px;
    }

    nav {
        position: absolute;
        top: 0;
        left: 0;
        width: 250px;
        height: 100%;
        background-color: #333;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    nav.active {
        transform: translateX(0);
    }

    .nav-links {
        flex-direction: column;
        display: flex;
        align-items: flex-start;
        padding: 0;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .nav-links.active {
        opacity: 1;
        padding-top: 50px;
    }

    .nav-links li {
        width: 100%;
        margin: 0;
        padding: 15px 0; /* Increased padding for more height */
    }

    .dropdown-content {
        position: static;
        width: 100%;
        text-align: left;
    }

    .dropdown-submenu .dropdown-content {
        position: static;
    }

    .dropdown-content a {
        padding: 10px 15px; /* Ensure padding within the submenu items */
        width: calc(100% - 30px); /* Adjust width to fit within the nav bar */
    }

    /* Ensure submenus do not overflow on the right */
    .dropdown-submenu .dropdown-content {
        left: auto;
        right: 0;
    }

    /* Darken main content when nav is active */
    main.active {
        filter: brightness(0.5);
        transition: filter 0.3s ease;
    }

    .menu-toggle {
        display: block;
        text-align: center;
        width: 100%;
    }
}

/* Specific fix for mobile overlapping */
@media (max-width: 768px) {
    .nav-links li {
        width: 100%;
    }

    .dropdown-content a {
        padding: 10px 0;
        display: block;
        width: calc(100% - 30px); /* Ensure submenu items fit within the navbar */
    }

    .dropdown-content a:hover {
        background-color: #7D1DD3;
    }

    .dropdown:hover .dropdown-content,
    .dropdown-submenu:hover .dropdown-content {
        display: block;
    }
}

main {
    flex-grow: 1;
    padding: 20px;
}

footer {
    background-color: #23083d;
    padding: 10px;
    text-align: center;
    color: rgb(255, 229, 0, .4);
}
