/* UBrightMinds Wallet v1.2.0 - menu links, no floating dock */

/* These classes are attached only to explicitly configured Wallet Custom Links.
   Yellow is reserved for Top Up; the live Wallet balance uses teal. */
a.ubm-fw-menu-balance,
a.ubm-fw-menu-balance:visited,
a.ubm-fw-menu-balance:hover,
a.ubm-fw-menu-balance:focus-visible {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    gap: 5px;
    max-width: 100%;
    padding: 9px 13px !important;
    border-radius: 9px !important;
    background: #0f766e !important;
    color: #fff !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    text-decoration: none !important;
    white-space: normal;
}
a.ubm-fw-menu-balance:hover,
a.ubm-fw-menu-balance:focus-visible {
    background: #115e59 !important;
}
a.ubm-fw-menu-topup,
a.ubm-fw-menu-topup:visited,
a.ubm-fw-menu-topup:hover,
a.ubm-fw-menu-topup:focus-visible {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    max-width: 100%;
    padding: 9px 13px !important;
    border-radius: 9px !important;
    background: #facc15 !important;
    color: #422006 !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    text-decoration: none !important;
}
a.ubm-fw-menu-topup:hover,
a.ubm-fw-menu-topup:focus-visible {
    background: #fde047 !important;
}
a.ubm-fw-menu-balance:focus-visible,
a.ubm-fw-menu-topup:focus-visible {
    outline: 3px solid #60a5fa !important;
    outline-offset: 3px;
}

.ubm-fw[hidden],
.ubm-fw [hidden] {
    display: none !important;
}

.ubm-fw {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
    color: #0f172a;
}

.ubm-fw-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .68);
}

body.ubm-fw-dialog-open {
    overflow: hidden !important;
}

.ubm-fw-dialog {
    position: relative;
    z-index: 1;
    width: min(480px, 100%);
    max-height: min(760px, calc(100dvh - 40px));
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid #dbe3ea;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 55px rgba(0, 0, 0, .3);
}

.ubm-fw-panel {
    display: block;
    padding: 20px;
    box-sizing: border-box;
}

.ubm-fw-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.ubm-fw-panel-head > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ubm-fw-panel-head h2 {
    font-family: inherit;
    font-size: 20px;
    line-height: 1.25;
    margin: 0;
    color: #0f172a;
    font-weight: 800;
}

.ubm-fw-panel-head span {
    font-size: 12px;
    color: #64748b;
}

.ubm-fw-panel-close,
.ubm-fw-refresh {
    appearance: none;
    margin: 0;
    font-family: inherit;
    cursor: pointer;
}

.ubm-fw-panel-close {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: #f1f5f9;
    color: #475569;
    font-size: 25px;
    line-height: 1;
}

.ubm-fw-panel-close:hover,
.ubm-fw-panel-close:focus-visible {
    background: #e2e8f0;
    color: #0f766e;
}

.ubm-fw-topup-host > .ubm-pqd-inline-wallet-widget {
    margin-top: 14px !important;
}

.ubm-fw-topup-host .ubm-pqd-iw-head {
    display: none !important;
}

.ubm-fw-unavailable,
.ubm-fw-fetch-error {
    margin-top: 14px;
    padding: 12px;
    border-radius: 9px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 600;
}

.ubm-fw-unavailable a {
    font-weight: 800;
    text-decoration: underline;
}

.ubm-fw-current-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 14px;
    border-radius: 12px;
    background: #ecfdf5;
}

.ubm-fw-current-balance span {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .035em;
    color: #0f766e;
}

.ubm-fw-current-balance strong {
    font-size: 19px;
    color: #065f46;
    white-space: nowrap;
}

.ubm-fw-breakdown-grid,
.ubm-fw-statement-rows {
    margin-top: 12px;
}

.ubm-fw-breakdown-grid > div,
.ubm-fw-statement-rows > div,
.ubm-fw-expense-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 7px 2px;
    font-size: 13px;
    line-height: 1.35;
}

.ubm-fw-breakdown-grid span,
.ubm-fw-statement-rows span {
    color: #64748b;
}

.ubm-fw-breakdown-grid strong,
.ubm-fw-statement-rows strong,
.ubm-fw-expense-row > strong {
    flex: 0 0 auto;
    white-space: nowrap;
    color: #0f172a;
}

.ubm-fw-breakdown-total,
.ubm-fw-subtotal {
    margin-top: 4px;
    padding-top: 10px !important;
    border-top: 1px solid #e2e8f0;
    font-weight: 800;
}

.ubm-fw-current-row {
    margin-top: 4px;
    padding-top: 10px !important;
    border-top: 1px solid #cbd5e1;
    font-weight: 900;
}

.ubm-fw-section-title,
.ubm-fw-expenses-title {
    margin-top: 16px;
    padding-top: 13px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #334155;
}

.ubm-fw-topup-date {
    margin-top: 7px;
    font-size: 12px;
    color: #64748b;
}

.ubm-fw-positive { color: #047857 !important; }
.ubm-fw-negative { color: #b91c1c !important; }

.ubm-fw-empty {
    margin: 9px 0 3px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.ubm-fw-expense-list { margin-top: 5px; }
.ubm-fw-expense-row { border-bottom: 1px solid #f1f5f9; }

.ubm-fw-expense-name {
    display: flex;
    min-width: 0;
    flex-direction: column;
    color: #334155;
    overflow-wrap: anywhere;
}

.ubm-fw-expense-name small {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 11px;
}

.ubm-fw-refresh {
    width: 100%;
    min-height: 36px;
    margin-top: 14px;
    padding: 8px 12px;
    border: 1px solid #99f6e4;
    border-radius: 8px;
    background: #f0fdfa;
    color: #0f766e;
    font-size: 12px;
    font-weight: 800;
}

.ubm-fw-refresh:hover { background: #ccfbf1; }

/* Legacy shortcode support */
.ubm-fw-inline { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.ubm-fw-inline-icon { display: inline-flex; }
.ubm-fw-inline-icon svg { width: 18px; height: 18px; }
.ubm-fw-inline-breakdown { margin-left: 8px; font-size: .9em; opacity: .75; }

@media (max-width: 640px) {
    .ubm-fw {
        align-items: flex-end;
        padding: 0;
    }
    .ubm-fw-dialog {
        width: 100%;
        max-height: min(88dvh, 780px);
        border-radius: 18px 18px 0 0;
        border-bottom: 0;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .ubm-fw-panel { padding: 16px; }
    .ubm-fw-current-balance strong { font-size: 17px; }
    .ubm-fw-topup-host .ubm-pqd-inline-wallet-widget { padding: 11px !important; }
    a.ubm-fw-menu-balance, a.ubm-fw-menu-topup { padding: 8px 10px !important; }
}

@media (prefers-reduced-motion: no-preference) {
    .ubm-fw-dialog { animation: ubm-fw-dialog-enter .18s ease-out; }
    @keyframes ubm-fw-dialog-enter {
        from { transform: translateY(10px); opacity: .85; }
        to { transform: translateY(0); opacity: 1; }
    }
}
