/* ==========================================
   Reset & Base Variables (Mobile-First)
   ========================================== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #16a34a;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --nav-height: 68px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: calc(var(--nav-height) + 20px);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
}

.wallet-content {
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hidden {
    display: none !important;
}

/* ==========================================
   1. Balance Card
   ========================================== */
.balance-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.balance-label {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 500;
}

.currency-badge {
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 12px;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 18px;
    letter-spacing: -0.5px;
}

.wallet-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-wallet-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease, opacity 0.2s;
}

.btn-wallet-action:active {
    transform: scale(0.97);
}

.btn-light {
    background-color: #ffffff;
    color: var(--primary-dark);
}

.btn-outline-light {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* ==========================================
   2. Transaction History
   ========================================== */
.history-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.section-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

.filter-tabs {
    display: flex;
    background-color: #e5e7eb;
    padding: 3px;
    border-radius: 10px;
    gap: 2px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background-color: var(--card-bg);
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.transaction-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tx-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.tx-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.tx-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.tx-icon.credit {
    background-color: #dcfce7;
    color: var(--success-color);
}

.tx-icon.debit {
    background-color: #fee2e2;
    color: var(--danger-color);
}

.tx-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.tx-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tx-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.tx-amount {
    font-size: 0.95rem;
    font-weight: 700;
}

.tx-amount.credit {
    color: var(--success-color);
}

.tx-amount.debit {
    color: var(--danger-color);
}

.tx-status {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: uppercase;
}

.tx-status.completed {
    background-color: #dcfce7;
    color: var(--success-color);
}

.tx-status.pending {
    background-color: #fef3c7;
    color: var(--warning-color);
}

.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px dashed var(--border-color);
}

/* ==========================================
   3. Modal Overlay
   ========================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 600;
    padding: 16px;
}

.modal-card {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
}

.req {
    color: var(--danger-color);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    background-color: #fafafa;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #ffffff;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

/* ==========================================
   4. Fixed Bottom Navigation Bar
   ========================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    height: var(--nav-height);
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 500;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    gap: 3px;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 1.25rem;
}

.nav-center {
    margin-top: -18px;
}

.nav-icon-circle {
    width: 48px;
    height: 48px;
    background-color: var(--primary-color);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
    border: 3px solid var(--card-bg);
}