/* ============================
   TNBH Wallet Styles
   ============================ */

/* Header Balance Widget */
.tnbh-header-balance {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff !important;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none !important;
    transition: all 0.3s ease;
}
.tnbh-header-balance:hover {
    background: linear-gradient(135deg, #e55a25, #e8840f);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}
.tnbh-wallet-balance {
    font-weight: 600;
}

/* ============================
   Deposit Page
   ============================ */
.tnbh-deposit-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Balance Card */
.tnbh-deposit-header {
    margin-bottom: 24px;
}
.tnbh-balance-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 16px;
    padding: 24px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tnbh-balance-label {
    font-size: 15px;
    opacity: 0.9;
}
.tnbh-balance-amount {
    font-size: 28px;
    font-weight: 700;
}

/* Step titles */
.tnbh-step-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}

/* Preset grid */
.tnbh-preset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
@media (max-width: 600px) {
    .tnbh-preset-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.tnbh-preset-btn {
    position: relative;
    padding: 16px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.tnbh-preset-btn:hover {
    border-color: #ff6b35;
    background: #fff8f5;
}
.tnbh-preset-btn.active {
    border-color: #ff6b35;
    background: #ff6b35;
    color: #fff;
}
.tnbh-preset-btn.active .tnbh-preset-bonus {
    color: #ffe0cc;
}
.tnbh-preset-amount {
    font-size: 16px;
    font-weight: 700;
}
.tnbh-preset-bonus {
    font-size: 11px;
    color: #ff6b35;
    font-weight: 600;
    background: #fff3ed;
    padding: 2px 8px;
    border-radius: 10px;
}
.tnbh-preset-btn.active .tnbh-preset-bonus {
    background: rgba(255,255,255,0.2);
}

/* Custom input */
.tnbh-custom-input {
    margin-bottom: 16px;
}
.tnbh-custom-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}
.tnbh-input-group {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}
.tnbh-input-group input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-size: 18px;
    font-weight: 600;
    outline: none;
}
.tnbh-input-suffix {
    padding: 12px 16px;
    background: #f5f5f5;
    font-weight: 600;
    color: #888;
}

/* Bonus info */
.tnbh-bonus-info {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.tnbh-bonus-detail {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 15px;
}
.tnbh-bonus-highlight {
    color: #16a34a;
}
.tnbh-bonus-total {
    display: flex;
    justify-content: space-between;
    padding: 10px 0 4px;
    font-size: 17px;
    border-top: 1px solid #bbf7d0;
    margin-top: 6px;
}
.tnbh-bonus-total strong {
    color: #ff6b35;
    font-size: 18px;
}

/* Submit button */
.tnbh-deposit-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}
.tnbh-deposit-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}
.tnbh-deposit-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Back button */
.tnbh-back-btn {
    margin-top: 16px;
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    color: #666;
}

/* Payment Info Section */
.tnbh-payment-info {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
}
.tnbh-qr-section {
    text-align: center;
    margin-bottom: 20px;
}
#tnbh-qr-image {
    max-width: 240px;
    border-radius: 8px;
    border: 1px solid #eee;
}
.tnbh-checkout-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 24px;
    background: #0073aa;
    color: #fff !important;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 600;
}

/* Bank info */
.tnbh-bank-info {
    margin-top: 16px;
}
.tnbh-bank-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    gap: 8px;
}
.tnbh-bank-label {
    min-width: 120px;
    color: #666;
    font-size: 14px;
}
.tnbh-bank-value {
    font-weight: 600;
    color: #333;
    flex: 1;
}
.tnbh-amount-highlight {
    color: #ff6b35;
    font-size: 18px;
}
.tnbh-copy-btn {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.tnbh-copy-btn:hover {
    background: #f0f0f0;
}
.tnbh-copy-btn.copied {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}

/* Countdown */
.tnbh-countdown-section {
    text-align: center;
    margin-top: 16px;
    padding: 12px;
    background: #fef3cd;
    border-radius: 10px;
}
.tnbh-countdown-label {
    font-size: 14px;
    color: #856404;
}
.tnbh-countdown-value {
    font-size: 22px;
    font-weight: 700;
    color: #dc3545;
    margin-left: 8px;
    font-family: monospace;
}

/* Payment status */
.tnbh-payment-status {
    margin-top: 20px;
    text-align: center;
    padding: 20px;
}
.tnbh-status-pending {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #f59e0b;
    font-weight: 600;
}
.tnbh-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #f59e0b;
    border-radius: 50%;
    animation: tnbh-spin 1s linear infinite;
}
@keyframes tnbh-spin {
    to { transform: rotate(360deg); }
}
.tnbh-status-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.tnbh-success-icon {
    font-size: 48px;
}
.tnbh-new-balance {
    font-size: 18px;
    color: #333;
    margin-top: 8px;
}
.tnbh-new-balance strong {
    color: #ff6b35;
}

/* Loading indicator */
.tnbh-loading {
    padding: 40px;
    text-align: center;
    color: #999;
}

/* ============================
   Sidebar: Recent Deposits
   ============================ */
.tnbh-deposit-sidebar {
    position: sticky;
    top: 20px;
}
.tnbh-recent-deposits {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
}
.tnbh-recent-deposits h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}
.tnbh-deposit-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.tnbh-history-item {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}
.tnbh-history-item:last-child {
    border-bottom: none;
}
.tnbh-history-amount {
    font-weight: 700;
    color: #16a34a;
    font-size: 15px;
}
.tnbh-history-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}
.tnbh-no-history {
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

/* ============================
   Transaction History
   ============================ */
.tnbh-transaction-history {
    max-width: 900px;
    margin: 0 auto;
}
.tnbh-txn-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.tnbh-txn-table thead {
    background: #f8fafc;
}
.tnbh-txn-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #666;
    border-bottom: 2px solid #e5e7eb;
}
.tnbh-txn-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}
.tnbh-positive {
    color: #16a34a;
    font-weight: 600;
}
.tnbh-negative {
    color: #dc2626;
    font-weight: 600;
}
.tnbh-txn-type {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.tnbh-txn-type.type-deposit { background: #dbeafe; color: #1e40af; }
.tnbh-txn-type.type-purchase { background: #fef3c7; color: #92400e; }
.tnbh-txn-type.type-refund { background: #fce7f3; color: #9d174d; }
.tnbh-txn-type.type-bonus { background: #d1fae5; color: #065f46; }
.tnbh-txn-type.type-admin_credit { background: #ede9fe; color: #5b21b6; }

.tnbh-status-badge {
    font-size: 12px;
    font-weight: 600;
}
.tnbh-status-badge.completed { color: #16a34a; }
.tnbh-status-badge.pending { color: #f59e0b; }
.tnbh-status-badge.failed { color: #dc2626; }

/* Pagination */
.tnbh-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}
.tnbh-page-link,
.tnbh-page-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.tnbh-page-link {
    border: 1px solid #ddd;
    color: #333;
}
.tnbh-page-link:hover {
    background: #f5f5f5;
}
.tnbh-page-current {
    background: #ff6b35;
    color: #fff;
}

.tnbh-no-data {
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

/* ============================
   Quick Buy Popup
   ============================ */
.tnbh-quickbuy-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.tnbh-quickbuy-popup {
    background: #fff;
    border-radius: 20px;
    max-width: 460px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: tnbh-popup-in 0.3s ease;
}
@keyframes tnbh-popup-in {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.tnbh-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    z-index: 1;
}
.tnbh-popup-content {
    padding: 30px;
}

/* Popup: Success */
.tnbh-popup-success {
    text-align: center;
}
.tnbh-popup-success-icon {
    font-size: 56px;
    margin-bottom: 12px;
}
.tnbh-popup-success h3 {
    font-size: 22px;
    color: #16a34a;
    margin-bottom: 20px;
}
.tnbh-popup-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.tnbh-popup-actions a,
.tnbh-popup-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-size: 14px;
}
.tnbh-popup-btn-primary {
    background: #ff6b35;
    color: #fff !important;
}
.tnbh-popup-btn-secondary {
    background: #f3f4f6;
    color: #333 !important;
}
.tnbh-popup-balance {
    margin-top: 16px;
    font-size: 14px;
    color: #666;
}

/* Popup: Insufficient */
.tnbh-popup-insufficient {
    text-align: center;
}
.tnbh-popup-insufficient h3 {
    color: #f59e0b;
    margin-bottom: 16px;
}
.tnbh-popup-balance-info {
    background: #fef3c7;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}
.tnbh-popup-balance-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 15px;
}
.tnbh-popup-shortage {
    color: #dc2626;
    font-weight: 700;
}

/* Popup: Loading */
.tnbh-popup-loading {
    text-align: center;
    padding: 40px 20px;
}
.tnbh-popup-loading .tnbh-spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 16px;
    border-top-color: #ff6b35;
}

/* ============================
   Wallet Checkout Info
   ============================ */
.tnbh-wallet-checkout-info {
    padding: 12px 0;
}
.tnbh-wallet-balance-display {
    font-size: 15px;
}
.tnbh-wallet-sufficient {
    color: #16a34a;
    font-weight: 500;
}
.tnbh-wallet-insufficient {
    color: #dc2626;
    font-weight: 500;
}

/* Quick Buy Button */
.tnbh-quick-buy-btn {
    background: linear-gradient(135deg, #ff6b35, #f7931e) !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    cursor: pointer;
    transition: all 0.3s ease;
}
.tnbh-quick-buy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

/* Copy tooltip */
.tnbh-copy-tooltip {
    position: fixed;
    background: #333;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 100000;
    pointer-events: none;
    animation: tnbh-tooltip-fade 1.5s ease forwards;
}
@keyframes tnbh-tooltip-fade {
    0% { opacity: 0; transform: translateY(5px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* PATCH 1: Single column deposit styles */
.tnbh-balance-card .label{font-size:14px;opacity:.9}
.tnbh-balance-card .value{font-size:28px;font-weight:bold}
.tnbh-amount-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:24px}
@media(max-width:600px){.tnbh-amount-grid{grid-template-columns:repeat(2,1fr)}}
.tnbh-btn-deposit{display:block;width:100%;padding:14px;background:linear-gradient(135deg,#ff9966,#ff5e62);color:#fff;border:none;border-radius:30px;font-size:16px;font-weight:bold;cursor:pointer;margin:20px 0}
.tnbh-btn-deposit:hover{opacity:.9}
.tnbh-btn-deposit:disabled{opacity:.5;cursor:not-allowed}
.tnbh-notice-box{background:#fff8dc;border:1px solid #f0e68c;border-left:4px solid #ffa500;padding:16px;border-radius:8px;margin:20px 0}
.tnbh-notice-box h4{margin:0 0 10px;color:#b8860b}
.tnbh-notice-box ul{list-style:none;padding:0;margin:0}
.tnbh-notice-box li{padding:6px 0;font-size:14px}
.tnbh-zalo-btn{display:inline-block;background:#0068ff;color:#fff;padding:4px 12px;border-radius:20px;text-decoration:none;font-size:13px;margin-left:8px}
.tnbh-zalo-btn:hover{background:#0052cc;color:#fff}
.tnbh-history-section{margin-top:40px;padding-top:24px;border-top:2px solid #eee}

/* PATCH 5: Pending banner + success alert */
.tnbh-pending-banner{background:#fff3cd;border:1px solid #ffc107;border-radius:8px;padding:14px;margin-bottom:20px;color:#856404}
.tnbh-success-alert{background:#d4edda;border:1px solid #28a745;color:#155724;padding:14px;border-radius:8px;margin-bottom:20px;font-weight:bold}
