/* Centering the menu wrapper */
.wrapper {
    width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Main menu styling */
#menu ul {
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
}

#menu .main-menu {
    display: flex;
    background-color: #51840B; /* Green background for the menu */
    font-family: Arial, sans-serif; /* Arial font */
    font-size: 12px; /* Set font size globally for the entire menu */
}

/* Make each list item take equal width and center content */
#menu li {
    position: relative;
    flex: 1; /* Each li will take equal width */
    display: flex;
    justify-content: center; /* Horizontally centers the link */
    align-items: center; /* Vertically centers the link */
    height: 40px; /* Adjust height if needed */
    border-right: 1px solid #a5b4cd; /* Border between items */
    box-sizing: border-box; /* Ensures padding and border are within the width */
    margin: 0;
}

/* Remove the border-right from the last item */
#menu li:last-child {
    border-right: none;
}

/* Main menu links */
#menu a {
    display: block;
    width: 100%; /* Ensures the 'a' takes up the full width */
    padding: 12px 20px;
    text-decoration: none;
    color: white;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.125);
    text-align: center; /* Ensures text is centered in the box */
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
    outline: none; /* Remove any outline */
    border: none; /* Remove any borders */
    box-shadow: none; /* Remove any box shadow */
}

/* Hover effect for the li (whole box turns darker green) */
#menu li:hover {
    background-color: #3d6209; /* Darker green on hover for the li */
}

/* Hover effect for the link (text turns yellow) */
#menu a:hover {
    color: #ebf903; /* Yellow text on hover */
    background-color: transparent; /* Ensure no background override on hover */
}

/* Ensure there's no border under button during hover */
#menu li:hover {
    border-color: transparent; /* Prevent any unwanted border */
}

/* Sub-menu styling */
#menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #51840B; /* Green background for sub-menu */
    border: 1px solid #a5b4cd;
    min-width: 180px;
    z-index: 1000;
}

#menu .sub-menu li {
    border-bottom: 1px solid #3d6209; /* Darker green border for sub-menu items */
}

#menu .sub-menu li:last-child {
    border-bottom: none;
}

/* Sub-menu links */
#menu .sub-menu a {
    display: block;
    padding: 10px;
    color: white;
    background-color: #51840B; /* Green background for sub-menu links */
    font-family: Arial, sans-serif; /* Ensure Arial font for sub-menu */
    font-size: 12px; /* Ensure consistent font size */
    transition: all 0.2s ease-in-out;
}

#menu .sub-menu a:hover {
    background-color: #3d6209; /* Darker green background on hover */
    color: #ebf903; /* Yellow text on hover */
}

/* Hover to show sub-menu */
#menu li:hover > .sub-menu {
    display: block;
}

/* Sub-submenu positioning */
#menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
}

/* Responsive Design for Smaller Screens */
@media only screen and (max-width: 768px) {
    #menu .main-menu {
        flex-direction: column;
    }

    #menu li {
        border-right: none;
        border-bottom: 1px solid #a5b4cd;
    }

    #menu .sub-menu {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
    }
}