/* Sidemenu Styles */

/* Fixed sidemenu */
.sidemenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 16.66666667%; /* col-md-2 width */
    height: 100vh;
    background: linear-gradient(45deg, #004787 0%, #005e82 25%, #006780 50%, #006e7b 75%, #007575 100%);
    border-right: none;
    overflow-y: auto;
    z-index: 1040;
    padding: 0;
    margin-left: 0;
}

/* Adjust main content to accommodate fixed sidemenu */
.col-md-10.main-content {
    padding-left: 15px;
    width: 83.33333333%;
    margin-left: 16.66666667%; /* Match the width of the sidemenu */
}

/* Fix the top menu spacing */
.top-menu {
    padding: 0;
    margin: 0;
    height: 60px;
}

.top-menu-container {
    padding: 0 30px;
}

/* Active menu styles */
.sidemenu .nav-pills > li.active > a {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
}

.sidemenu .dropdown-menu > li.active > a {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
}

/* Only highlight the current active item */
.sidemenu .dropdown-menu > li:not(.active) > a {
    background-color: transparent;
}

/* Force dropdown menu to be open when parent is active */
.sidemenu .dropdown.active .dropdown-menu {
    display: block !important;
}

.sidemenu-header {
    padding: 0 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 80px;
    display: flex;
    align-items: center;
}

.sidemenu-header img {
    width: 80%;
    max-height: 60px;
    object-fit: contain;
    padding: 0 10px;
}

.sidemenu-content {
    padding: 0;
    margin-top: 40px;
}

/* Main menu items */
.sidemenu .nav-pills > li > a {
    border-radius: 0;
    color: #fff;
    padding: 12px 15px;
    padding-left: 20px; /* Increased left padding */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
}

/* Dropdown menus */
.sidemenu .dropdown-menu > li > a {
    padding: 8px 15px 8px 50px;
    white-space: normal;
    color: #fff;
    font-weight: 300;
}

.sidemenu .dropdown-menu > li > a.add-button {
    padding: 0;
    width: 18px;
    height: 18px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.sidemenu .nav-pills > li > a:hover,
.sidemenu .nav-pills > li > a:focus {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: underline;
    font-weight: 600;
}

.sidemenu .nav-pills > li.active > a,
.sidemenu .nav-pills > li.open > a {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: underline;
    font-weight: 600;
}

.sidemenu .menu-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    filter: brightness(0) invert(1);
}

.sidemenu .menu-text {
    flex-grow: 1;
}

.sidemenu .menu-arrow {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

/* Cambia la freccia quando il dropdown è aperto */
.sidemenu .dropdown.open .menu-arrow {
    content: url('../icon/AltArrowDown.svg');
}

/* Dropdown menus */
.sidemenu .dropdown-menu {
    display: none;
    position: static;
    float: none;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background-color: rgba(0, 0, 0, 0.2);
}

.sidemenu .dropdown.open .dropdown-menu {
    display: block;
}

.sidemenu .dropdown-menu > li > a:hover,
.sidemenu .dropdown-menu > li > a:focus {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: underline;
}

.sidemenu .divider {
    background-color: rgba(255, 255, 255, 0.1);
    margin: 5px 0;
}

/* Main content adjustment */
/* Rimuovi o modifica questa parte */
.main-content {
    /* Rimuovi o commenta queste righe che forzano una larghezza fissa */
    /* margin-left: 25%; */
    /* width: 75%; */
    padding: 15px;
}

/* Media queries for mobile */
@media (max-width: 768px) {
    .sidemenu {
        width: 100%;
        height: auto;
        position: relative;
        display: none;
    }
    
    .sidemenu.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* Add this utility class */
.no-padding-left {
    padding-left: 0;
}

/* Top Menu Styles */
.top-menu {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background-color: white;
    border-bottom: 1px solid #e7e7e7;
    /* box-shadow: 0 1px 5px rgba(0,0,0,0.1); */
    z-index: 1030;
    /* margin-left: -15px; */
}

.top-menu-container {
    display: flex;
    justify-content: space-between !important;
    align-items: center;
    height: 100%;
    padding: 0 30px; /* Increased padding for equal spacing on both sides */
    width: 100%;
}

.top-menu-left {
    justify-content: flex-start !important;
    display: flex;
    align-items: center;
}

/* Title styling */
.top-menu-title {
    font-weight: 200;
    font-size: 18px;
    margin-right: 15px;
}

/* Vertical divider */
.top-menu-divider {
    height: 50px;
    width: 1px;
    background-color: #E1E1E1;
    margin: 0 15px;
}

/* Market selector - fix bold text */
.market-selector {
    font-weight: 600 !important;
    background: -webkit-linear-gradient(to right, #004787 0, #007575 52%);
    background: linear-gradient(to top, #004787 0, #007575 52%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block; /* Important for gradient text */
    font-size: 18px;
}

/* Username - fix bold text */
.menu-name-user strong {
    font-weight: 500 !important;
    display: inline-block; /* Ensure proper rendering */
}

.menu-name-user {
    font-size: 18px;
}

/* Force bold text for both elements as a fallback */
.market-selector, .menu-name-user strong {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 700 !important;
}

.top-menu-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    padding: 0 30px;
    width: 100%;
}

.top-menu-logo {
    display: flex;
    align-items: center;
}

.top-menu-right {
    display: flex;
    align-items: center;
}

.top-menu-item {
    margin-left: 20px;
    position: relative;
}

.top-menu-item a {
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.top-menu-dropdown {
    position: absolute;
    right: 0;
    left: auto;
    top: 100%;
    background-color: white;
    border: 1px solid #e7e7e7;
    border-radius: 4px;
    box-shadow: 0 6px 12px rgba(0,0,0,.175);
    min-width: 160px;
    z-index: 1000;
    display: none;
    list-style: none;
    padding: 5px 0;
    margin: 0;
}

.top-menu-item.open .top-menu-dropdown {
    display: block;
}

.top-menu-dropdown li a {
    padding: 8px 20px;
    display: block;
}

.top-menu-dropdown li a:hover {
    background-color: #f5f5f5;
}

.menu-name-user {
    margin: 0 5px;
}

/* Add spacing below the fixed menu */
.spacer80 {
    height: 80px;
}

/* Active menu item styles */
.sidemenu .nav-pills > li.active > a,
.sidemenu .nav-pills > li.active > a:hover,
.sidemenu .nav-pills > li.active > a:focus {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
}

.sidemenu .dropdown-menu > li.active > a,
.sidemenu .dropdown-menu > li.active > a:hover,
.sidemenu .dropdown-menu > li.active > a:focus {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
}

/* Keep dropdown menu open when active */
.sidemenu .nav-pills > li.active.dropdown .dropdown-menu {
    display: block;
}

/* Override the padding-left for active menu items */
.sidemenu .dropdown-menu > li.active  {
    padding-left: 0px !important; /* Reset to default padding */
}

/* Sidemenu add-button*/
.add-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    line-height: 16px !important;
    width: 18px;
    height: 18px;
    text-align: center;
    border-radius: 4px;
    background-color: transparent;
    color: white;
    font-weight: bold;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
}

.add-button:hover {
    background-color: rgba(255, 255, 255, 0.5) !important;
    color: white;
    text-decoration: none !important;
}

.add-button.active {
    background-color: #079181 !important;
    text-decoration: none !important;
}

.dropdown-menu li {
    position: relative;
}

.sidemenu .dropdown-menu > li > a {
    padding-right: 35px; /* Add space on the right for the + button */
    overflow: hidden;
    text-overflow: ellipsis;
}
