/*
 * Shared chrome that belongs to the app rather than to the theme or to one page.
 */

/*
 * Language switcher in the authenticated portal navbar.
 *
 * The theme paints .btn-light with `background-color: var(--bs-light-active) !important` on
 * hover, focus and while the dropdown is open, so the switcher turned pale grey and read as
 * disabled next to the dark header. These rules give it the brand teal instead.
 *
 * !important is needed to answer the theme's own !important, and the extra .btn-light in the
 * selector keeps this above it on specificity rather than relying on load order.
 *
 * Scoped to .app-navbar: the public landing strip has its own, lighter treatment in Home.css.
 */
.app-navbar .language-switcher .btn.btn-light:hover,
.app-navbar .language-switcher .btn.btn-light:focus,
.app-navbar .language-switcher .btn.btn-light:active,
.app-navbar .language-switcher .btn.btn-light.show {
    background-color: #236b70 !important;
    border-color: #236b70 !important;
    color: #fff !important;
}

/* The icon and the dropdown caret inherit the theme's dark colour otherwise. */
.app-navbar .language-switcher .btn.btn-light:hover i,
.app-navbar .language-switcher .btn.btn-light:focus i,
.app-navbar .language-switcher .btn.btn-light:active i,
.app-navbar .language-switcher .btn.btn-light.show i,
.app-navbar .language-switcher .btn.btn-light:hover::after,
.app-navbar .language-switcher .btn.btn-light:focus::after,
.app-navbar .language-switcher .btn.btn-light:active::after,
.app-navbar .language-switcher .btn.btn-light.show::after {
    color: #fff !important;
}

@media (max-width: 767.98px) {
    .app-navbar .app-navbar-language {
        padding-top: 0 !important;
    }

    .app-navbar .language-switcher {
        margin-top: 0 !important;
    }

    .app-navbar .language-switcher .dropdown-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0;
        gap: 0 !important;
    }

    .app-navbar .language-switcher .language-switcher-label,
    .app-navbar .language-switcher .dropdown-toggle::after {
        display: none;
    }
}

.select2-currency-option {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.select2-currency-option__icon {
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 1.25rem;
    border-radius: 999px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.select2-currency-option__fallback {
    width: 1.75rem;
    height: 1.25rem;
    flex: 0 0 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef2f7;
    color: #344054;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}

/*
 * Sidebar menu density.
 *
 * The theme's sidebar rows were ~40px tall with bold 1.1rem titles, 1.5rem icons and bulleted,
 * indented sub-items. These rules tighten it to a compact nav: ~32px rows for both items and
 * sub-items, 14px titles, 1.25rem icons, and sub-items without bullets whose text lines up with
 * their parent's title.
 *
 * Logical properties (padding-inline, margin-inline) so the same file serves both directions.
 */
.app-sidebar-menu .menu .menu-item {
    padding-block: 0;
}

.app-sidebar-menu .menu .menu-item .menu-link {
    min-height: 2.5rem;
    padding-block: 0.35rem;
    padding-inline: 0.75rem;
}

.app-sidebar-menu .menu .menu-item .menu-link .menu-title {
    font-size: 1.075rem;
    line-height: 1.4;
}

.app-sidebar-menu .menu > .menu-item > .menu-link > .menu-title {
    font-weight: 500;
}

.app-sidebar-menu .menu .menu-sub .menu-item .menu-link .menu-title {
    font-weight: 400;
}

.app-sidebar-menu .menu .menu-icon {
    width: 1.5rem;
    margin-inline-end: 0.75rem;
}

.app-sidebar-menu .menu .menu-icon i {
    font-size: 1.25rem !important;
}

/* Sub-items: no bullet, no extra indent, text aligned under the parent's title. */
.app-sidebar-menu .menu.menu-sub-indention .menu-sub:not([data-popper-placement]) {
    margin-inline-start: 0;
}

.app-sidebar-menu .menu .menu-sub .menu-item .menu-link {
    /* parent link padding + icon width + icon gap */
    padding-inline-start: 3rem;
}

.app-sidebar-menu .menu .menu-sub .menu-bullet {
    display: none;
}

/* The page's main create action in the header (NavbarCreateButton / GenericCrud): + icon and label,
   just the icon on small screens. */
.exchange-create-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.exchange-create-button > i {
    padding: 0;
    color: inherit;
}

@media (max-width: 767.98px) {
    .exchange-create-button {
        justify-content: center;
        width: 35px;
        height: 35px;
        padding: 0 !important;
    }

    .exchange-create-button__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}
