/* Top bar profile card + dropdown (click to open). Shared by the home page and every inner page's top bar.
   Markup: <div class="nav-item tb-topbar__user"> <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" data-bs-display="static"> img + .tb-topbar__name </a>
           <div class="dropdown-menu dropdown-menu-end tb-user-menu"> items </div> </div>
   It is deliberately NOT a ".dropdown": main.js opens every ".dropdown" on hover, which fights the click toggle. */
@media (min-width: 992px) {
    .tb-topbar__user > .nav-link { display: flex; align-items: center; gap: 8px; }
    .tb-topbar__user img { width: 34px; height: 34px; object-fit: cover; border: 2px solid rgba(255, 255, 255, .55); margin: 0 !important; }
    .tb-topbar__name { color: #fff; font-weight: 600; font-size: 14px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (min-width: 992px) {
    .tb-topbar__user { position: relative; }
    .tb-topbar__user > .nav-link { padding: 0 !important; width: auto !important; background: transparent !important; cursor: pointer; }
    .tb-topbar__name { padding-right: 2px; }

    /* little chevron that shows the name is clickable and flips while open */
    .tb-topbar__user > .nav-link.dropdown-toggle::after {
        display: inline-block !important;
        content: '';
        margin: 0 4px 0 0;
        border: 0;
        width: 10px; height: 6px;
        background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23ffffff' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
        transition: transform .2s ease;
    }
    .tb-topbar__user > .nav-link.show::after { transform: rotate(180deg); }

    /* menu: same dark card as the language dropdown, right-aligned under the profile */
    .tb-topbar__user .tb-user-menu {
        top: calc(100% + 12px);
        right: 0;
        left: auto;
        min-width: 190px;
        margin: 0 !important;
        padding: 6px;
        z-index: 1085;
        background: rgba(15, 20, 36, .97);
        border: 1px solid rgba(255, 255, 255, .14);
        border-radius: 14px;
        box-shadow: 0 18px 40px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
    }
    .tb-topbar__user .tb-user-menu::before {
        content: '';
        position: absolute;
        top: -6px; right: 22px;
        width: 10px; height: 10px;
        background: rgba(15, 20, 36, .97);
        border-left: 1px solid rgba(255, 255, 255, .14);
        border-top: 1px solid rgba(255, 255, 255, .14);
        transform: rotate(45deg);
    }
    .tb-topbar__user .tb-user-menu.show { animation: tbMenuIn .16s ease; }
    .tb-topbar__user .tb-user-menu .dropdown-item {
        display: flex; align-items: center; gap: 12px;
        padding: 10px 12px;
        border-radius: 9px;
        color: #e8ebf5;
        font-size: 15px; font-weight: 600; line-height: 1.2;
        background: transparent;
        white-space: nowrap;
    }
    .tb-topbar__user .tb-user-menu .dropdown-item i { width: 16px; text-align: center; color: #fea116; }
    .tb-topbar__user .tb-user-menu .dropdown-item:hover,
    .tb-topbar__user .tb-user-menu .dropdown-item:focus { background: rgba(255, 255, 255, .09) !important; color: #fff !important; }
}
@keyframes tbMenuIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
