/* ═══════════════════════════════════════════════════════════
   profile-cards.css  —  [sbd_wallet] [sbd_pediguide] [sbd_cloud]
   Scoped to .sbd-pc-*  —  no conflicts with UM or SBD styles.

   UM sets .um-profile-body { max-width:600px } in its CSS AND
   as an inline style. profile-cards.js strips the inline style
   and adds .sbd-tab-active so this override can take effect.
═══════════════════════════════════════════════════════════ */

/* ── Override UM's 600px body constraint (class added by JS) ── */
.um-profile .um-profile-body.sbd-tab-active {
    max-width: 100% !important;
    width:     100% !important;
}

/* ── Shared base ─────────────────────────────────────────── */
.sbd-pc-single,
.sbd-pc-combined {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color:       #0f1117;
    box-sizing:  border-box;
    width:       100%;
}

/* ── SINGLE: each individual shortcode in its own UM tab ─── */
.sbd-pc-single {
    display: block;
    padding: 20px 0 32px;
    margin:  0;
}
.sbd-pc-single .sbd-pc-card {
    width:     100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin:    0;
}

/* ── COMBINED: [sbd_profile_cards] two-column grid ─────── */
.sbd-pc-combined {
    display:               grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows:    auto auto;
    gap:                   20px;
    padding:               20px 0 32px;
}

/* nth-child targets the three .sbd-pc-single wrappers inside combined */
.sbd-pc-combined > .sbd-pc-single:nth-child(1) { grid-column: 1;      grid-row: 1; padding: 0; }
.sbd-pc-combined > .sbd-pc-single:nth-child(2) { grid-column: 2;      grid-row: 1; padding: 0; }
.sbd-pc-combined > .sbd-pc-single:nth-child(3) { grid-column: 1 / -1; grid-row: 2; padding: 0; }

/* Cards inside combined cells also stretch fully */
.sbd-pc-combined .sbd-pc-card {
    width:     100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin:    0;
    height:    100%;
}

/* ── Cloud accordions ────────────────────────────────────── */
.sbd-cloud-accordion {
    border:        1px solid #e4e5ec;
    border-radius: 12px;
    overflow:      hidden;
    margin-bottom: 12px;
}
.sbd-cloud-accordion:last-of-type { margin-bottom: 0; }

/* ── Card shell ────────────────────────────────────────── */
.sbd-pc-card {
    background: #fff;
    border: 1px solid #e4e5ec;
    border-radius: 16px;
    padding: 22px 20px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Card header row ───────────────────────────────────── */
.sbd-pc-card-head {
    display: flex;
    align-items: center;
    gap: 13px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f1f8;
}

.sbd-pc-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sbd-pc-icon.wallet    { background: #eef2ff; color: #3b5bdb; }
.sbd-pc-icon.pediguide { background: #ebfbee; color: #2f9e44; }
.sbd-pc-icon.cloud     { background: #fff4e6; color: #e8590c; }

.sbd-pc-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 3px;
    line-height: 1.2;
    color: #0f1117;
}
.sbd-pc-sub {
    font-size: 0.76rem;
    color: #9398a5;
    line-height: 1.3;
}

/* ── Notices ───────────────────────────────────────────── */
.sbd-pc-notice {
    background: #fff9db;
    border: 1px solid #ffe066;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 0.9rem;
    color: #5c4000;
    margin: 16px 0;
}

/* ── WALLET: balance card ──────────────────────────────── */
.sbd-pc-balance-card {
    background: linear-gradient(135deg, #1c3461 0%, #3b5bdb 55%, #6741d9 100%);
    border-radius: 13px;
    padding: 20px 18px 16px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.sbd-pc-balance-card::after {
    content: '';
    position: absolute;
    width: 160px; height: 160px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    top: -50px; right: -30px;
    pointer-events: none;
}
.sbd-pc-balance-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    opacity: .72;
    margin-bottom: 8px;
}
.sbd-pc-balance-amt {
    display: block;
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1;
    margin-bottom: 5px;
}
.sbd-pc-balance-cur {
    font-size: 0.72rem;
    opacity: .6;
}

/* ── WALLET: top-up ────────────────────────────────────── */
.sbd-pc-topup { display: flex; flex-direction: column; gap: 10px; }

.sbd-pc-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.sbd-pc-preset-btn {
    padding: 6px 14px;
    background: #f7f7fb;
    border: 1.5px solid #e4e5ec;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 500;
    color: #0f1117;
    cursor: pointer;
    transition: border-color .16s, background .16s, color .16s;
}
.sbd-pc-preset-btn:hover,
.sbd-pc-preset-btn.selected { border-color: #3b5bdb; background: #eef2ff; color: #3b5bdb; }

.sbd-pc-amount-row {
    display: flex;
    gap: 8px;
}
.sbd-pc-amount-input {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1.5px solid #e4e5ec;
    border-radius: 9px;
    overflow: hidden;
    background: #fff;
}
.sbd-pc-amount-input span {
    padding: 0 10px;
    background: #f7f7fb;
    border-right: 1.5px solid #e4e5ec;
    color: #9398a5;
    font-weight: 600;
    font-size: 0.9rem;
    height: 40px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}
.sbd-pc-amount-input input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 10px;
    font-size: 0.9rem;
    height: 40px;
    background: transparent;
    color: #0f1117;
    min-width: 0;
}

.sbd-pc-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 18px;
    height: 40px;
    background: #3b5bdb;
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .16s, transform .1s;
    flex-shrink: 0;
}
.sbd-pc-btn-primary:hover  { background: #2f4cbf; }
.sbd-pc-btn-primary:active { transform: scale(.97); }
.sbd-pc-btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.sbd-pc-topup-note {
    font-size: 0.74rem;
    color: #9398a5;
    margin: 0;
    text-align: center;
}

.sbd-pc-info-note {
    font-size: 0.84rem;
    color: #9398a5;
    background: #f7f7fb;
    padding: 10px 14px;
    border-radius: 8px;
    margin: 0;
}

/* ── WALLET: alerts ────────────────────────────────────── */
.sbd-pc-alert {
    padding: 10px 14px;
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 500;
}
.sbd-pc-alert.success { background: #d3f9d8; color: #2b8a3e; }
.sbd-pc-alert.error   { background: #ffe3e3; color: #c92a2a; }
.sbd-pc-alert.info    { background: #dbe4ff; color: #364fc7; }

/* ── WALLET: transactions toggle ───────────────────────── */
.sbd-pc-txn-wrap { border-top: 1px solid #f0f1f8; padding-top: 12px; margin-top: 4px; }

.sbd-pc-txn-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: none;
    color: #3b5bdb;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.sbd-pc-chevron { transition: transform .2s; flex-shrink: 0; }
.sbd-pc-chevron.open { transform: rotate(180deg); }

.sbd-pc-txn-list { margin-top: 12px; }

.sbd-pc-txn-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #f5f5fa;
}
.sbd-pc-txn-row:last-child { border-bottom: none; }

.sbd-pc-txn-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.sbd-pc-txn-dot.credit { background: #d3f9d8; }
.sbd-pc-txn-dot.debit  { background: #ffe3e3; }

.sbd-pc-txn-meta { flex: 1; min-width: 0; }
.sbd-pc-txn-note { font-size: 0.82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbd-pc-txn-date { font-size: 0.7rem; color: #9398a5; margin-top: 1px; }

.sbd-pc-txn-right { text-align: right; flex-shrink: 0; }
.sbd-pc-txn-amount { font-size: 0.88rem; font-weight: 700; }
.sbd-pc-txn-amount.credit { color: #2b8a3e; }
.sbd-pc-txn-amount.debit  { color: #c92a2a; }
.sbd-pc-txn-badge {
    display: inline-block;
    font-size: 0.66rem; font-weight: 600;
    padding: 1px 7px; border-radius: 20px; margin-top: 2px;
}
.sbd-pc-txn-badge.success { background: #d3f9d8; color: #2b8a3e; }
.sbd-pc-txn-badge.pending { background: #fff3bf; color: #e67700; }
.sbd-pc-txn-badge.failed  { background: #ffe3e3; color: #c92a2a; }
.sbd-pc-txn-empty { text-align: center; padding: 18px; color: #9398a5; font-size: 0.84rem; }
.sbd-pc-loading   { text-align: center; padding: 16px; color: #9398a5; font-size: 0.84rem; }

/* ── PEDIGUIDE ─────────────────────────────────────────── */
.sbd-pc-pediguide-desc {
    font-size: 0.86rem;
    color: #4a4f5e;
    line-height: 1.65;
    margin: 0;
}
.sbd-pc-pediguide-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #4a4f5e;
}
.sbd-pc-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sbd-pc-dot.on  { background: #2f9e44; box-shadow: 0 0 0 3px rgba(47,158,68,.18); }
.sbd-pc-dot.off { background: #adb5bd; }

.sbd-pc-launch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    background: linear-gradient(135deg, #2f9e44 0%, #1a7431 100%);
    color: #fff !important;
    border: none;
    border-radius: 11px;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    margin-top: auto;
    box-shadow: 0 4px 14px rgba(47,158,68,.28);
    transition: opacity .16s, transform .1s;
}
.sbd-pc-launch-btn:hover  { opacity: .91; }
.sbd-pc-launch-btn:active { transform: scale(.97); }

/* ── CLOUD CONNECT ─────────────────────────────────────── */
.sbd-pc-provider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid #f0f1f8;
}
.sbd-pc-provider:last-of-type { border-bottom: none; padding-bottom: 0; }

.sbd-pc-provider-logo {
    width: 40px; height: 40px;
    background: #f7f7fb;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sbd-pc-provider-info { flex: 1; min-width: 0; }
.sbd-pc-provider-info strong { display: block; font-size: 0.88rem; font-weight: 600; color: #0f1117; }
.sbd-pc-conn-status { font-size: 0.74rem; color: #9398a5; margin-top: 2px; display: block; }
.sbd-pc-conn-status.connected { color: #2f9e44; }

.sbd-pc-provider-actions { flex-shrink: 0; }

.sbd-pc-btn-connect {
    padding: 6px 14px;
    background: #3b5bdb;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .16s;
    white-space: nowrap;
}
.sbd-pc-btn-connect:hover    { background: #2f4cbf; }
.sbd-pc-btn-connect:disabled { opacity: .55; cursor: not-allowed; }

.sbd-pc-btn-disconnect {
    padding: 6px 14px;
    background: transparent;
    color: #e03131;
    border: 1.5px solid #ffc9c9;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .16s;
    white-space: nowrap;
}
.sbd-pc-btn-disconnect:hover    { background: #fff5f5; }
.sbd-pc-btn-disconnect:disabled { opacity: .55; cursor: not-allowed; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 700px) {
    .sbd-pc-combined {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .sbd-pc-combined > .sbd-pc-single:nth-child(1),
    .sbd-pc-combined > .sbd-pc-single:nth-child(2),
    .sbd-pc-combined > .sbd-pc-single:nth-child(3) {
        grid-column: 1;
        grid-row: auto;
    }
    .sbd-pc-balance-amt { font-size: 1.7rem; }
    .sbd-pc-amount-row  { flex-direction: column; }
    .sbd-pc-btn-primary { width: 100%; }
}

/* ── PediGuide single-tab layout ───────────────────────── */
.sbd-pc-single #sbd-pc-pediguide .sbd-pc-pediguide-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.sbd-pc-single .sbd-pc-launch-btn {
    align-self: flex-start;
    padding: 14px 32px;
    font-size: 1rem;
}
