/* Authorized top bar additions shared by BOTH interface designs (base = «Малахит»).
 * «Эфир» refinements: css/redesign-web/navigation.css. See docs/WEB_INTERFACE_DESIGNS.md. */

/* Balance chip: “1 250,0 ₽ +” right of the notifications bell */
/* order 35: always right of the bell (30), left of the profile (40) when the legacy nav reorders items */
.yf-authorized-nav > .yf-balance-nav-item { display: flex; align-items: center; order: 35; margin-left: 6px; }
.yf-balance-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 6px 0 12px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    color: #eaf5f1;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease;
}
.yf-balance-chip:hover,
.yf-balance-chip:focus-visible { border-color: rgba(101, 217, 174, .5); background: rgba(101, 217, 174, .12); outline: 0; }
.yf-balance-chip__plus {
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: rgba(101, 217, 174, .2);
    color: #9ff0cf;
    font-size: 13px;
    transition: background-color .35s ease, color .35s ease, transform .55s cubic-bezier(.4, 0, .2, 1);
}
.yf-balance-chip:hover .yf-balance-chip__plus { background: #65d9ae; color: #0b2621; }
.yf-balance-chip:hover .yf-balance-chip__plus { transform: rotate(90deg); }

/* Phones: the chip lives only in the profile menu */
@media (max-width: 767.98px) {
    .yf-balance-nav-item { display: none !important; }
}

/* Phones: profile menu opens centred under the bar instead of hugging the right edge */
@media (max-width: 767.98px) {
    .yf-authorized-profile .dropdown-menu.show {
        position: fixed !important;
        inset: 62px auto auto 50% !important;
        width: min(340px, calc(100vw - 24px));
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        transform: translateX(-50%) !important;
    }
}

/* Notifications bell: gentle ring every 10 s while something is unread */
.yf-notifications-button.has-unread i { animation: yf-notification-ring-loop 10s ease infinite; transform-origin: 50% 0; }
@keyframes yf-notification-ring-loop {
    0%, 6%, 100% { transform: rotate(0); }
    1.5% { transform: rotate(14deg); }
    3% { transform: rotate(-11deg); }
    4.5% { transform: rotate(6deg); }
}

/* ── Shared "+" glyph (both designs) ───────────────────────────────────────
   The Tabler font glyph sits a subpixel off its box, so it wobbled when rotated. The cross is drawn with two
   equal bars instead: exactly square, its centre is the rotation axis. Every "+" button turns it on hover,
   the same motion as the Balance chip. */
body.yf-dashboard-auth :is(button, a, summary, [role="button"], .yf-balance-chip__plus) > .ti-plus {
    --yf-plus-size: 10px;
    --yf-plus-stroke: 2px;
    display: inline-block;
    flex: 0 0 var(--yf-plus-size);
    width: var(--yf-plus-size);
    height: var(--yf-plus-size);
    border-radius: 1px;
    background:
        linear-gradient(currentColor, currentColor) center / 100% var(--yf-plus-stroke) no-repeat,
        linear-gradient(currentColor, currentColor) center / var(--yf-plus-stroke) 100% no-repeat;
    font-size: 0 !important;
    line-height: 0;
    vertical-align: -1px;
    transform-origin: 50% 50%;
    transition: transform .55s cubic-bezier(.4, 0, .2, 1);
}
body.yf-dashboard-auth :is(button, a, summary, [role="button"], .yf-balance-chip__plus) > .ti-plus::before { content: none; }
body.yf-dashboard-auth .yf-card-action > .ti-plus { --yf-plus-size: 10px; }
body.yf-dashboard-auth :is(button, a, summary, [role="button"]):not(:disabled):is(:hover, :focus-visible) > .ti-plus { transform: rotate(90deg); }
/* The Balance chip turns the whole round badge (see above); its glyph must not add a second turn. */
body.yf-dashboard-auth .yf-balance-chip__plus > .ti-plus { transition: none; transform: none !important; }
body.yf-dashboard-auth.yf-reduced-motion :is(button, a, summary, [role="button"]) > .ti-plus,
body.yf-dashboard-auth.yf-reduced-motion .yf-balance-chip__plus { transition: none; }
