#top-nav {
    border-bottom: 1px dotted #808080;
    border-top: 1px dotted #808080;
    margin: 12px 0 20px;
    width: 100%;
}
/* dropdowns */
ul#menu {
    display: inline-block;
    line-height: 1.5;
    max-width: 960px;
}
/* Important: Parent <li>s should be relatively positioned */
ul#menu li {
    display: inline-block;
    list-style-type: none;
    position: relative; 
}
ul#menu li a {
    background-color: transparent;
    color: #666;
    display: block;
    font-family: 'Archivo Narrow', arial, sans-serif;
    font-size: 1.1em;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    text-transform: uppercase;
    padding: 20px 12px;
    transition: all 0.3s;
}
ul#menu li a:hover {
    transform: scale(1.1);
}
ul#menu li a:hover span i {
    color: #fff;
}
ul#menu li a span i {
    transition: color 0.2s;
}
ul#menu li a#selected {
    color: #fff;
    background-color: #d9001e;
    border-color: transparent;
    height: 26px;
    font-weight: bold;
}
ul#menu li a#selected span {
    color: #fff;
}

/* Submenu styling with roll down effect */
ul#menu li .submenu {
    visibility: hidden;
    opacity: 0; 
    position: absolute; 
    top: 100%; 
    left: 0; 
    background-color: #fff;
    list-style-type: none;
    margin: 0;
    padding: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 
    z-index: 1000; 
    transform: scaleY(0); 
    transform-origin: top; 
    transition: transform 0.5s ease, opacity 0.5s ease, visibility 0.5s ease;
    max-height: 0;
    overflow: hidden; 
    border-bottom-left-radius: 2px; 
    border-bottom-right-radius: 2px; 
}

/* Show first-level submenu on hover */
ul#menu li:hover > .submenu {
    visibility: visible;
    opacity: 1;
    transform: scaleY(1);
    max-height: 500px;
    overflow: visible;
}

/* Nested submenu styling */
ul#menu li .submenu li:hover > .submenu {
    visibility: visible;
    opacity: 1;
    transform: scaleY(1);
    max-height: 500px;
    overflow: visible;
    left: 100%; /* Position to the right of the parent submenu */
    top: 0; /* Align at the top of the parent submenu */
}

/* Positioning for all nested submenus */
ul#menu li .submenu li .submenu {
    position: absolute;
    left: 100%;
    top: 0;
    transform-origin: top left;
}

ul#menu li.has-submenu > a::after {
    content: "\f107";
    font-family: 'Font Awesome 5 Pro';
    display: inline-block;
    margin-left: 5px;
}

/* Adjust the arrow icon for nested submenus */
ul#menu li .submenu li.has-submenu > a::after {
    content: "\f105"; 
    font-family: 'Font Awesome 5 Pro';
    display: inline-block;
    margin-left: 5px;
}
ul#menu li .submenu li {
    width: 100%;
}
ul#menu li .submenu li a {
    padding: 10px;
    display: block;
    text-decoration: none;
    color: #000;
    font-weight: normal;
    text-align: left;
    min-width: 175px;
}
ul#menu li .submenu li a:hover {
    background-color: #ddd;
}

/* Additional styles specific to the user-options-menu */
#icon-container .user-options-menu li .submenu {
    right: 0;
    left: auto;
    text-align: right;
}
#icon-container .user-options-menu li .submenu li a {
    min-width: 195px;
}

/* Full-header container setup */
#full-header-container-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}
#upper-options {
    flex: 1;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
#upper-options ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
#icon-container {
    display: flex;
    flex-direction: column;
    align-items: right;
}
#icon-container .username {
    margin-top: 5px;
    font-size: 1em;
    color: #333; 
    white-space: nowrap;
}
#icon-container .username.impersonation {
    color: #d9001e;
}

.submenu-separator {
    border-top: 1px solid #f0f0f0; 
    margin: 4px 0; 
    background-color: transparent !important; /* Forcefully remove any background */
    padding: 0 !important; 
    width: 100%; /* Ensure the line spans the full width */
    height: 1px; /* Keep the line thin */
}

/* Responsive design for small screens */
@media only screen and (max-width: 767px) {
    ul#menu {
        margin-bottom: 0;
    }
    ul#menu li a {
        padding: 10px 7px;
    }
    #upper-options ul {
        margin-top: 10px;
    }

    /* learning center dropdown button */
    .dropdown-btn {
        display: block;
        padding: 15px;
        background-color: #333;
        color: white;
        cursor: pointer;
        font-weight: bold;
        text-align: center;
        width: auto;
        max-width: 100%;
        z-index: 100;
        margin: 0;
        border-radius: 5px 5px 0 0;
    }

    /* learning center dropdown menu */
    ul#site-tabs {
        visibility: hidden;
        flex-direction: column;
        background-color: rgba(51, 51, 51, 0.9);
        width: 100%;
        list-style: none;
        padding: 0;
        margin: 0;
        position: absolute;
        top: calc(100%);
        left: 0;
        z-index: 999;
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        transition: opacity 0.5s ease, max-height 0.5s ease, visibility 0.5s;
    }

    ul#site-tabs li a {
        display: block; 
        padding: 15px 20px;
        background-color: transparent;
        color: #fff;
        font-family: 'Archivo Narrow', Arial, sans-serif;
        font-size: 1.1em;
        font-weight: bold;
        text-transform: uppercase;
        text-decoration: none;
        transition: background-color 0.3s ease;
        width: 100%;
        box-sizing: border-box;
    }

    /* Show menu on hover */
    nav:hover ul#site-tabs {
        visibility: visible;
        opacity: 1;
        max-height: 400px;
        overflow-y: auto;
    }

    /* Active tab styling */
    ul#site-tabs li a.tab-selected {
        background-color: #666 !important;
    }
    #user-info {
        text-align: left;
        margin: 0;
    }
}

/* Example specific to .tab-selected or other custom styling can be added here */
