/**
 * Frontend exchange sidebar — mirrors admin s7__sidebar-nav (main.css + custom.css dark).
 * Scoped to .ex-sidebar so legacy .dropdown-widget elsewhere is unchanged.
 */

.exchange-app .ex-sidebar {
    background: transparent !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.exchange-app .ex-sidebar .dropdown-widget {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
    box-shadow: none !important;
}

.exchange-app .ex-sidebar .s7__sidebar-nav-wrapper {
    overflow: auto;
    max-height: calc(100vh - 120px);
    padding: 0 0.25rem;
}

.exchange-app .ex-sidebar .s7__sidebar-nav {
    padding-inline-start: 0;
    list-style: none;
    margin-bottom: 0;
    margin-inline-start: -5px;
}

.exchange-app .ex-sidebar .s7__sidebar-nav > li + li {
    margin-top: 0.1875rem;
}

.exchange-app .ex-sidebar .s7__sidebar-nav li {
    list-style: none;
    border-bottom: none !important;
}

.exchange-app .ex-sidebar .s7__sidebar-nav li a {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6a7c95;
    padding: 0.5rem 0.9375rem 0.5rem 0.625rem;
    border-radius: 5px;
    transition: all 0.3s;
}

.exchange-app .ex-sidebar .s7__sidebar-nav li a:hover {
    color: var(--color-primary);
}

.exchange-app .ex-sidebar .s7__sidebar-nav li a .nav-icon,
.exchange-app .ex-sidebar .s7__sidebar-nav li a .ex-cat-icon {
    width: 1.125rem;
    min-width: 1.125rem;
    margin-inline-end: 0.75rem;
    font-size: 1.125rem;
    line-height: 1;
    text-align: center;
    flex-shrink: 0;
}

.exchange-app .ex-sidebar .s7__sidebar-nav li a .s7__nav-caption {
    flex: 1 1 auto;
    min-width: 0;
}

.exchange-app .ex-sidebar .s7__sidebar-nav li a .ex-sidebar-badge {
    margin-inline-start: auto;
    flex-shrink: 0;
}

.exchange-app .ex-sidebar .s7__sidebar-nav li.has-child {
    position: relative;
}

.exchange-app .ex-sidebar .s7__sidebar-nav li.has-child::after {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 0.875rem;
    color: #6a7c95;
    pointer-events: none;
    transition: all 0.3s;
}

.exchange-app .ex-sidebar .s7__sidebar-nav li.has-child > a .fa-angle-right {
    display: none !important;
}

.exchange-app .ex-sidebar .s7__sidebar-nav > li.active > a,
.exchange-app .ex-sidebar .s7__sidebar-nav > li.open > a,
.exchange-app .ex-sidebar .s7__sidebar-nav > li.has-child > a[aria-expanded="true"] {
    background-color: var(--color-primary);
    color: #fff !important;
}

.exchange-app .ex-sidebar .s7__sidebar-nav > li.active > a .nav-icon,
.exchange-app .ex-sidebar .s7__sidebar-nav > li.active > a .ex-cat-icon,
.exchange-app .ex-sidebar .s7__sidebar-nav > li.open > a .nav-icon,
.exchange-app .ex-sidebar .s7__sidebar-nav > li.open > a .ex-cat-icon,
.exchange-app .ex-sidebar .s7__sidebar-nav > li.has-child > a[aria-expanded="true"] .nav-icon,
.exchange-app .ex-sidebar .s7__sidebar-nav > li.has-child > a[aria-expanded="true"] .ex-cat-icon {
    color: #fff !important;
}

.exchange-app .ex-sidebar .s7__sidebar-nav > li.active::after,
.exchange-app .ex-sidebar .s7__sidebar-nav > li.open::after,
.exchange-app .ex-sidebar .s7__sidebar-nav > li.has-child:has(> a[aria-expanded="true"])::after {
    color: #fff !important;
}

.exchange-app .ex-sidebar .s7__sidebar-nav .s7__sub-nav {
    padding-inline-start: 1.5rem;
    margin-inline-start: 1.375rem;
    border-left: 1px solid var(--border-color);
    list-style: none;
    margin-bottom: 0;
    background: transparent !important;
    border-top: none !important;
}

.exchange-app .ex-sidebar .s7__sidebar-nav .s7__sub-nav li a {
    padding: 0.3125rem 0;
    font-size: 0.875rem;
    display: block;
}

.exchange-app .ex-sidebar .s7__sidebar-nav .s7__sub-nav li a.active {
    color: var(--color-primary) !important;
}

.exchange-app .ex-sidebar .s7__menu-title {
    text-transform: uppercase;
    font-weight: 500;
    font-size: 0.75rem;
    margin-top: 1.5625rem !important;
    margin-bottom: 0.625rem;
    color: #829ec5;
    list-style: none;
    padding: 0 0.625rem;
}

.exchange-app .ex-sidebar .s7__menu-title:first-child {
    margin-top: 0.5rem !important;
}

/* Kill legacy dropdown-widget chrome inside exchange sidebar */
.exchange-app .ex-sidebar .dropdown-widget ul {
    margin: 0;
    padding: 0;
    width: 100%;
    background: transparent !important;
}

.exchange-app .ex-sidebar .dropdown-widget ul .list-heading,
.exchange-app .ex-sidebar .dropdown-widget h5 {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.exchange-app .ex-sidebar .dropdown-widget ul li {
    border-bottom: none !important;
}

.exchange-app .ex-sidebar .dropdown-widget ul ul {
    border-top: none !important;
    background: transparent !important;
}

.exchange-app .ex-sidebar .dropdown-widget ul ul li a {
    padding-left: 0 !important;
}

/* Dark mode — match admin custom.css */
.theme-dark .exchange-app .ex-sidebar .s7__sidebar-nav li a,
.theme-dark .exchange-app .ex-sidebar .s7__sidebar-nav li.has-child::after {
    color: #cdd9ec;
}

.theme-dark .exchange-app .ex-sidebar .s7__sidebar-nav li a .nav-icon,
.theme-dark .exchange-app .ex-sidebar .s7__sidebar-nav li a .ex-cat-icon {
    color: #a5b9d5 !important;
}

.theme-dark .exchange-app .ex-sidebar .s7__sidebar-nav li a:hover {
    color: var(--color-primary);
}

.theme-dark .exchange-app .ex-sidebar .s7__sidebar-nav li a:hover .nav-icon,
.theme-dark .exchange-app .ex-sidebar .s7__sidebar-nav li a:hover .ex-cat-icon {
    color: var(--color-primary) !important;
}

.theme-dark .exchange-app .ex-sidebar .s7__sidebar-nav > li.active > a,
.theme-dark .exchange-app .ex-sidebar .s7__sidebar-nav > li.open > a,
.theme-dark .exchange-app .ex-sidebar .s7__sidebar-nav > li.has-child > a[aria-expanded="true"] {
    color: #fff !important;
}

.theme-dark .exchange-app .ex-sidebar .s7__sidebar-nav > li.active > a .nav-icon,
.theme-dark .exchange-app .ex-sidebar .s7__sidebar-nav > li.active > a .ex-cat-icon,
.theme-dark .exchange-app .ex-sidebar .s7__sidebar-nav > li.open > a .nav-icon,
.theme-dark .exchange-app .ex-sidebar .s7__sidebar-nav > li.open > a .ex-cat-icon,
.theme-dark .exchange-app .ex-sidebar .s7__sidebar-nav > li.has-child > a[aria-expanded="true"] .nav-icon,
.theme-dark .exchange-app .ex-sidebar .s7__sidebar-nav > li.has-child > a[aria-expanded="true"] .ex-cat-icon {
    color: #fff !important;
}

/* Mobile slide-out menu uses same s7 nav */
.exchange-app .sidebar-menu .ex-sidebar .s7__sidebar-nav-wrapper {
    max-height: none;
    padding: 0;
}

.theme-dark .exchange-app .ex-sidebar .s7__menu-title {
    color: #829ec5;
}

/* Live dot in sidebar — keep green pulse, not s7 gray */
.exchange-app .ex-sidebar .s7__sidebar-nav li a .ex-live-dot {
    width: 0.5rem !important;
    min-width: 0.5rem !important;
    height: 0.5rem;
    margin-inline-end: 0.75rem;
    font-size: 0 !important;
    color: transparent !important;
}
