/* =====================
   TRADING APP THEME
   Binance / Bybit inspired
===================== */
:root {
    --bg-body: #0b0e11;
    --bg-app: #0b0e11;

    --surface-1: #1e2329;
    --surface-2: #2b3139;
    --surface-3: #363c45;
    --surface-card: #1e2329;

    --accent: #fcd535;
    --accent-primary: #fcd535;
    --accent-hover: #f0b90b;
    --gold: #fcd535;
    --gold-light: #fde68a;
    --gold-dark: #ca8a04;

    --primary: #fcd535;
    --primary-dark: #eaecef;

    --green: #0ecb81;
    --red: #f6465d;

    --text: #eaecef;
    --text-primary: #eaecef;
    --text-secondary: #848e9c;
    --muted: #848e9c;

    --border: rgba(234, 236, 239, 0.08);
    --border-gold: rgba(252, 213, 53, 0.28);
    --glass-border: rgba(234, 236, 239, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);

    --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --shadow-accent: 0 8px 28px rgba(252, 213, 53, 0.12);

    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;

    --gold-gradient: linear-gradient(135deg, #fcd535 0%, #f0b90b 100%);
    --gold-gradient-rev: linear-gradient(135deg, #fde68a 0%, #fcd535 100%);
}

/* =====================
   BODY
===================== */
body {
    background: var(--bg-body);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* =====================
   APP WRAPPER
===================== */
.phone-wrapper {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    background: var(--bg-app);
    padding: 24px 16px 110px;
    position: relative;
}

/* =====================
   HEADER
===================== */
.custom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.user-meta small {
    color: var(--muted);
    font-size: .62rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    font-weight: 700;
}

.user-meta h4 {
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 800;
    margin: 4px 0 0;
    letter-spacing: -.3px;
}

/* =====================
   PROFILE AVATAR / SETTINGS
===================== */
.profile-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--accent);
    font-size: .95rem;
    transition: .2s ease;
    cursor: pointer;
}

.profile-avatar:hover {
    background: var(--surface-3);
    border-color: var(--border-gold);
}

/* =====================
   WALLET HERO CARD
===================== */
.wallet-hero {
    position: relative;
    overflow: hidden;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 11px 10px;
    margin-bottom: 16px;
    box-shadow: var(--glass-shadow);
}

.wallet-hero > * {
    position: relative;
    z-index: 1;
}

.wallet-hero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--gold-gradient);
    pointer-events: none;
}

.wallet-hero::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -60px;
    top: -60px;
    border-radius: 50%;
    background: radial-gradient(rgba(252, 213, 53, 0.08), transparent 70%);
    pointer-events: none;
}

.balance-title {
    font-size: .62rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.6px;
    font-weight: 700;
}

.balance-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text);
    margin: 6px 0 4px;
    line-height: 1;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
}

.wallet-hero p {
    margin-bottom: 14px;
    color: var(--muted);
    font-weight: 500;
    font-size: .78rem;
}

.ref-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(252, 213, 53, 0.08);
    border: 1px solid rgba(252, 213, 53, 0.18);
    color: var(--gold-light);
    font-size: .68rem;
    font-weight: 700;
}

/* =====================
   TRANSACTION BUTTONS
===================== */
.transaction-hub {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.tx-link {
    text-decoration: none;
}

.tx-card {
    height: 76px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: .2s ease;
    cursor: pointer;
}

.tx-card:hover {
    transform: translateY(-2px);
}

.tx-deposit {
    background: var(--gold-gradient);
    box-shadow: var(--shadow-accent);
}

.tx-history,
.tx-withdraw {
    background: var(--surface-1);
    border: 1px solid var(--border);
}

.tx-icon-wrap {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.tx-deposit .tx-icon-wrap { color: #0b0e11; }
.tx-history .tx-icon-wrap { color: var(--accent); }
.tx-withdraw .tx-icon-wrap { color: var(--green); }

.tx-title {
    font-size: .78rem;
    font-weight: 800;
    margin: 0;
}

.tx-deposit .tx-title { color: #0b0e11; }
.tx-history .tx-title,
.tx-withdraw .tx-title { color: var(--text); }

.tx-subtext {
    font-size: .58rem;
    margin-top: 2px;
    font-weight: 600;
}

.tx-deposit .tx-subtext { color: rgba(11, 14, 17, 0.55); }
.tx-history .tx-subtext,
.tx-withdraw .tx-subtext { color: var(--muted); }

/* =====================
   UTILITIES GRID
===================== */
.utilities-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.utility-box {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 4px;
    text-align: center;
    transition: .2s ease;
    cursor: pointer;
}

.utility-box:hover {
    border-color: var(--border-gold);
    background: var(--surface-2);
}

.utility-box i {
    font-size: 1.1rem;
    color: var(--accent);
    display: inline-block;
    margin-bottom: 4px;
}

.utility-box p {
    margin: 0;
    font-size: .62rem;
    font-weight: 700;
    color: var(--text-secondary);
}

/* =====================
   SECTION HEADER ROW
===================== */
.section-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.section-row h5 {
    margin: 0;
    font-size: .88rem;
    font-weight: 800;
    color: var(--text);
}

.section-row a {
    font-size: .68rem;
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

/* =====================
   MARKET / ASSET CARDS
===================== */
.app-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 8px;
    transition: .2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-card:hover {
    border-color: var(--border-gold);
    background: var(--surface-2);
}

.asset-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.asset-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .85rem;
}

.asset-name {
    color: var(--text);
    font-size: .88rem;
    font-weight: 800;
}

.asset-subtitle {
    color: var(--muted);
    font-size: .62rem;
    margin-top: 1px;
    display: block;
}

.trend-positive {
    color: var(--green) !important;
    font-weight: 700;
}

.trend-negative {
    color: var(--red) !important;
    font-weight: 700;
}

.text-success { color: var(--green) !important; }
.text-danger { color: var(--red) !important; }

/* =====================
   BOTTOM NAV
===================== */
.fixed-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 398px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 6px;
    z-index: 9999;
    box-shadow: var(--glass-shadow);
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.nav-anchor {
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--muted);
    font-size: .58rem;
    font-weight: 700;
    transition: .2s ease;
    padding: 4px 0;
    border-radius: 10px;
}

.nav-anchor i {
    font-size: 1.15rem;
    color: var(--muted);
    transition: .2s ease;
}

.nav-anchor.active-tab {
    color: var(--accent);
}

.nav-anchor.active-tab i {
    color: var(--accent);
}

/* =====================
   MOBILE ADJUSTMENTS
===================== */
@media (max-width: 380px) {
    .balance-value { font-size: 2rem; }
    .tx-card { height: 70px; }
    .utility-box { padding: 12px 4px; }
    .asset-name { font-size: .82rem; }
}

/* =====================
   LIGHT THEME
===================== */
[data-theme="light"] {
    --bg-body: #f5f5f5;
    --bg-app: #ffffff;

    --surface-1: #ffffff;
    --surface-2: #fafafa;
    --surface-3: #f0f0f0;
    --surface-card: #ffffff;

    --accent: #c99400;
    --accent-primary: #c99400;
    --accent-hover: #a67c00;
    --gold: #c99400;
    --gold-light: #d4a017;
    --gold-dark: #8a6500;

    --primary: #c99400;
    --primary-dark: #1e2329;

    --green: #0ecb81;
    --red: #f6465d;

    --text: #1e2329;
    --text-primary: #1e2329;
    --text-secondary: #707a8a;
    --muted: #707a8a;

    --border: rgba(30, 35, 41, 0.08);
    --border-gold: rgba(201, 148, 0, 0.25);
    --glass-border: rgba(30, 35, 41, 0.08);
    --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);

    --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-accent: 0 4px 16px rgba(201, 148, 0, 0.15);

    --gold-gradient: linear-gradient(135deg, #fcd535 0%, #f0b90b 100%);
    --gold-gradient-rev: linear-gradient(135deg, #fde68a 0%, #fcd535 100%);
}

[data-theme="light"] .wallet-hero::before {
    background: var(--gold-gradient);
}

[data-theme="light"] .fixed-bottom-nav {
    background: #ffffff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .profile-avatar {
    background: #fafafa;
}

[data-theme="light"] .utility-box {
    background: #ffffff;
}

[data-theme="light"] .app-card {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .tx-history,
[data-theme="light"] .tx-withdraw {
    background: #ffffff;
}

[data-theme="light"] .form-control,
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
    background-color: #fafafa !important;
    border-color: rgba(30, 35, 41, 0.1) !important;
    color: #1e2329 !important;
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] input:focus {
    background-color: #ffffff !important;
    border-color: rgba(201, 148, 0, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(252, 213, 53, 0.12) !important;
}

[data-theme="light"] .form-control::placeholder,
[data-theme="light"] input::placeholder {
    color: #707a8a !important;
}
