/* ================================================================
   CREDITS BADGE — Indicador de saldo no statusbar + popup
   Namespace: .credits-*
   Ownership: app/js/utils/ui/creditsBadge.js
   ================================================================ */

/* ---------- Badge no statusbar ---------- */
.status-credits {
    cursor: pointer;
    transition: opacity 0.15s;
}

.status-credits:hover {
    opacity: 0.85;
}

.credits-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary, #aaa);
    padding: 1px 6px;
    border-radius: var(--radius-sm, 4px);
    background: var(--neutral-800, #252738);
    border: 1px solid var(--border, #333);
}

.credits-badge.credits-warning {
    border-color: var(--accent-amber, #f59e0b);
    color: var(--accent-amber, #f59e0b);
}

.credits-badge.credits-critical {
    border-color: var(--accent-red, #f93e3e);
    color: var(--accent-red, #f93e3e);
    animation: credits-pulse 1.5s ease infinite;
}

@keyframes credits-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.credits-bar-mini {
    display: inline-block;
    width: 32px;
    height: 4px;
    background: var(--neutral-700, #3a3d50);
    border-radius: 2px;
    overflow: hidden;
}

.credits-bar-fill {
    display: block;
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
    background: var(--accent-green, #49cc90);
}

.credits-count {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.credits-label {
    font-size: 10px;
    opacity: 0.7;
}

/* ---------- Popup de creditos ---------- */
.credits-popup {
    z-index: 300;
    background: var(--neutral-900, #1a1c2e);
    border: 1px solid var(--border, #2a2d3e);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    width: 280px;
    overflow: hidden;
    animation: credits-popup-in 0.15s ease;
}

@keyframes credits-popup-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.credits-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border, #2a2d3e);
    font-size: 13px;
    color: var(--text-primary, #e1e4ed);
}

.credits-popup-close {
    background: none;
    border: none;
    color: var(--text-secondary, #888);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.credits-popup-close:hover {
    color: var(--text-primary, #e1e4ed);
}

.credits-popup-body {
    padding: 14px;
}

/* Saldo grande */
.credits-summary {
    text-align: center;
    margin-bottom: 14px;
}

.credits-big {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #e1e4ed);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.credits-total {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary, #888);
}

.credits-bar {
    width: 100%;
    height: 6px;
    background: var(--neutral-700, #3a3d50);
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
}

.credits-meta {
    font-size: 11px;
    color: var(--text-secondary, #888);
}

/* Breakdown por categoria */
.credits-breakdown {
    border-top: 1px solid var(--border, #2a2d3e);
    padding-top: 10px;
}

.credits-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 12px;
    color: var(--text-secondary, #aaa);
}

.credits-row-icon {
    width: 14px;
    text-align: center;
    font-size: 10px;
    color: var(--accent-blue, #4fc3f7);
}

.credits-row-label {
    flex: 1;
}

.credits-row-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary, #e1e4ed);
}

/* Footer com botao */
.credits-popup-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--border, #2a2d3e);
    background: var(--neutral-850, #161822);
}

.credits-btn-topup {
    width: 100%;
    padding: 8px 0;
    border: none;
    border-radius: var(--radius-sm, 6px);
    background: var(--accent-blue, #4fc3f7);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.credits-btn-topup:hover {
    background: #039be5;
}
