:root {
    --bg-main: #0a0a0c;
    --bg-card: #111115;
    --bg-card-child: #16161c;
    --bg-pill: #1a1a24;
    --accent-purple: #7933ff;
    --accent-purple-hover: #8f54ff;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border-color: rgba(255, 255, 255, 0.05);
    --success-green: #34d399;
    --danger-red: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    user-select: none;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* ==================== HEADER ==================== */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: 0.2s;
}

.nav-btn.active {
    color: #fff;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
}

.balance-pill {
    display: flex;
    align-items: center;
    background-color: var(--bg-card);
    border-radius: 20px;
    padding: 4px 4px 4px 14px;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.currency {
    font-weight: 500;
    margin-right: 2px;
    font-size: 14px;
}

.amount {
    font-weight: 600;
    font-size: 14px;
    margin-right: 12px;
}

.add-btn {
    background-color: var(--accent-purple);
    color: white;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    pointer-events: none;
    /* Let parent handle click */
}

/* ==================== MAIN CARDS & TABS ==================== */
.main-content {
    flex: 1;
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 24px;
}

.hero {
    text-align: center;
    margin: 20px 0 40px;
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.brand-logo {
    height: 32px;
    width: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    display: inline-block;
    vertical-align: middle;
}


/* Filter Container */
.filters-container {
    margin-bottom: 24px;
    display: flex;
    gap: 10px;
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

/* CARDS */
.section-header {
    display: flex;
    margin-bottom: 16px;
    gap: 8px;
    align-items: center;
}

.section-title {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
}

.item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.price-tag {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--border-color);
    padding: 4px 8px;
    border-radius: 6px;
}

.card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.detail-row {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    gap: 4px;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
}

.detail-val {
    color: #fff;
    font-weight: 500;
}

.card-actions {
    margin-top: 20px;
}

.btn-buy {
    width: 100%;
    background: var(--accent-purple);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

/* ==================== ACCOUNT TAB ==================== */
.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.acc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: 1px;
}

.refresh-icon {
    cursor: pointer;
}

.acc-balance {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 20px;
}

.btn-primary {
    background: var(--accent-purple);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.w-100 {
    width: 100%;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mt-3 {
    margin-top: 16px;
}

.info-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-card-child);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.info-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.info-val {
    font-size: 14px;
    font-weight: 500;
}

.tx-item {
    background: var(--bg-card-child);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tx-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tx-title {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tx-title.purchase {
    color: var(--text-primary);
}

.tx-title.deposit {
    color: var(--text-primary);
}

.tx-icon-purchase {
    color: var(--danger-red);
    font-size: 12px;
}

.tx-icon-deposit {
    color: var(--success-green);
    font-size: 12px;
}

.tx-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.tx-amount {
    font-size: 14px;
    font-weight: 600;
}

.tx-amount.neg {
    color: var(--danger-red);
}

.tx-amount.pos {
    color: var(--success-green);
}

.badge {
    background: var(--bg-card-child);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.inventory-empty {
    color: var(--text-secondary);
    padding: 20px;
}

.text-center {
    text-align: center;
}

/* ==================== MODALS & CART ==================== */
.floating-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--accent-purple);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 14px rgba(121, 51, 255, 0.4);
    cursor: pointer;
    z-index: 100;
    transition: 0.2s;
}

.floating-btn:active {
    transform: scale(0.9);
}

.floating-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-red);
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: flex-end;
    /* Mobile friendly slide-up */
}

#topup-modal {
    align-items: center !important;
    justify-content: center !important;
}

#topup-modal .modal-content {
    border-radius: 20px;
    margin: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-main);
    width: 100%;
    max-width: 600px;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    border-top: 1px solid var(--border-color);
    animation: slideUp 0.3s ease-out;
    max-height: 85vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 20px;
    font-family: 'Outfit', sans-serif;
}

.close-icon {
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
}

.form-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-family: inherit;
    outline: none;
}

.filter-body label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.cart-item-title {
    font-weight: bold;
    font-size: 14px;
}

.cart-item-price {
    color: var(--success-green);
    font-size: 14px;
}

.cart-item-remove {
    color: var(--danger-red);
    cursor: pointer;
    padding: 5px;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .main-content {
        padding: 16px;
    }

    .top-header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
    }

    .logo {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .brand-logo {
        height: 24px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
        gap: 4px;
    }

    .nav-btn {
        padding: 8px;
        font-size: 12px;
        flex: 1;
        justify-content: center;
    }

    .nav-btn i {
        display: none;
    }

    .balance-pill {
        padding: 4px 4px 4px 10px;
    }

    .card-top {
        flex-direction: column;
        gap: 8px;
    }

    .card-details {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 16px;
    }

    .hero-title {
        font-size: 22px;
    }
}