/**
 * assets/css/wallet.css
 * VexMov Theme - Wallet & Top-Up Styling
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Kantumruy+Pro:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Noto+Sans+Khmer:wght@400;500;600;700&display=swap');

.vexmov-header-wallet,
.profile-dropdown-wallet,
.vexmov-wallet-modal,
.vexmov-wallet-dialog,
.page-template-page-topup {
    font-family: 'Kantumruy Pro', 'Noto Sans Khmer', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* =======================================================
   1. HEADER BALANCE BADGE
   ======================================================= */
.vexmov-header-wallet {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
}

.vexmov-wallet-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    background: color-mix(in srgb, var(--bg-button, #10b981) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--bg-button, #10b981) 35%, transparent);
    border-radius: 20px;
    color: var(--bg-button, #10b981);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1;
}

.vexmov-wallet-pill:hover {
    background: color-mix(in srgb, var(--bg-button, #10b981) 24%, transparent);
    border-color: var(--bg-button, #10b981);
    color: var(--bg-button, #10b981);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--bg-button, #10b981) 25%, transparent);
}

.vexmov-wallet-pill-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.vexmov-wallet-pill-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.vexmov-wallet-pill-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-button, #10b981);
    color: var(--text-muted, #0f172a);
    font-size: 11px;
    font-weight: 800;
    margin-left: 2px;
}

/* =======================================================
   2. PROFILE DROPDOWN WALLET CARD
   ======================================================= */
.profile-dropdown-wallet {
    padding: 12px 14px;
    margin: 8px 12px 12px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--bg-button, #10b981) 12%, transparent), color-mix(in srgb, var(--bg-hover, #059669) 20%, transparent));
    border: 1px solid color-mix(in srgb, var(--bg-button, #10b981) 30%, transparent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.profile-dropdown-wallet-info {
    display: flex;
    flex-direction: column;
}

.profile-dropdown-wallet-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.profile-dropdown-wallet-val {
    font-size: 16px;
    font-weight: 800;
    color: var(--bg-button, #10b981);
    margin-top: 1px;
}

.profile-dropdown-wallet-khr {
    font-size: 11px;
    color: #cbd5e1;
}

.profile-dropdown-wallet-btn {
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--bg-button, #10b981);
    color: var(--text-muted, #fff);
    font-size: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.profile-dropdown-wallet-btn:hover {
    background: var(--bg-hover, #059669);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--bg-button, #10b981) 40%, transparent);
    color: var(--text-muted, #fff);
}

/* =======================================================
   3. WALLET TOP-UP MODAL DIALOG
   ======================================================= */
.vexmov-wallet-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.vexmov-wallet-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.vexmov-wallet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 23, 0.85);
    backdrop-filter: blur(6px);
}

.vexmov-wallet-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(145deg, var(--bg-card, #1f2733), var(--bg-dark, #121720));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    color: var(--text-main, #fff);
    font-family: 'Kantumruy Pro', 'Noto Sans Khmer', 'Inter', sans-serif;
    line-height: 1.65;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s ease;
}

.vexmov-wallet-modal.is-open .vexmov-wallet-dialog {
    transform: translateY(0) scale(1);
}

.vexmov-wallet-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vexmov-wallet-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: #ef4444;
}

.vexmov-wallet-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-right: 32px;
}

.vexmov-wallet-header-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--bg-button, #10b981) 20%, transparent), color-mix(in srgb, var(--bg-button, #10b981) 5%, transparent));
    border: 1px solid color-mix(in srgb, var(--bg-button, #10b981) 35%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-button, #10b981);
    font-size: 24px;
    flex-shrink: 0;
}

.vexmov-wallet-header-icon svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.vexmov-wallet-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.vexmov-wallet-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}

/* Balance Status Card */
.vexmov-wallet-balance-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 20px;
    gap: 14px;
    flex-wrap: wrap;
}

.vexmov-wallet-balance-label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
}

.vexmov-wallet-balance-amount {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 2px;
}

.vexmov-wallet-balance-amount strong {
    font-size: 24px;
    font-weight: 800;
    color: var(--bg-button, #10b981);
}

.vexmov-wallet-balance-amount small {
    font-size: 13px;
    color: #cbd5e1;
}

.vexmov-wallet-tabs {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.25);
    padding: 4px;
    border-radius: 10px;
}

.vexmov-wallet-tab {
    padding: 6px 14px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vexmov-wallet-tab svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.vexmov-wallet-tab.is-active {
    background: var(--bg-button, #10b981);
    color: var(--text-muted, #fff);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--bg-button, #10b981) 35%, transparent);
}

/* Preset Buttons */
.vexmov-wallet-section {
    margin-bottom: 20px;
}

.vexmov-wallet-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 10px;
}

.vexmov-wallet-presets {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

@media (max-width: 480px) {
    .vexmov-wallet-presets {
        grid-template-columns: repeat(3, 1fr);
    }
}

.vexmov-wallet-preset-btn {
    padding: 10px 6px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-card, #232529) 60%, transparent);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    color: var(--text-main, #fff);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.vexmov-wallet-preset-btn:hover {
    background: color-mix(in srgb, var(--bg-button, #10b981) 15%, transparent);
    border-color: color-mix(in srgb, var(--bg-button, #10b981) 40%, transparent);
    color: var(--bg-button, #34d399);
}

.vexmov-wallet-preset-btn.is-active {
    background: var(--bg-button, #10b981);
    color: var(--text-muted, #fff);
    border-color: var(--bg-button, #10b981);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--bg-button, #10b981) 40%, transparent);
}

.vexmov-wallet-custom-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.vexmov-currency-prefix {
    position: absolute;
    left: 14px;
    color: var(--bg-button, #10b981);
    font-size: 16px;
    font-weight: 700;
}

.vexmov-wallet-input {
    width: 100%;
    padding: 12px 14px 12px 30px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s ease;
}

.vexmov-wallet-input:focus {
    border-color: var(--bg-button, #10b981);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--bg-button, #10b981) 20%, transparent);
}

.vexmov-khr-preview {
    position: absolute;
    right: 14px;
    font-size: 12px;
    color: #94a3b8;
    pointer-events: none;
}

/* Payment Method Choices */
.vexmov-wallet-methods {
    margin-bottom: 20px;
}

.vexmov-method-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .vexmov-method-choices {
        grid-template-columns: 1fr;
    }
}

.vexmov-method-choice {
    position: relative;
    cursor: pointer;
}

.vexmov-method-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.vexmov-method-card {
    padding: 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    height: 100%;
    box-sizing: border-box;
}

.vexmov-method-choice.is-selected .vexmov-method-card {
    background: color-mix(in srgb, var(--bg-button, #10b981) 10%, transparent);
    border-color: var(--bg-button, #10b981);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--bg-button, #10b981) 18%, transparent);
}

.vexmov-method-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--bg-button, #10b981);
    color: var(--text-muted, #fff);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.vexmov-method-badge-aba {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    background: #005f88;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.vexmov-method-card strong {
    display: block;
    font-size: 14px;
    color: #fff;
    margin-bottom: 4px;
}

.vexmov-method-card small {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.35;
}

/* Submit & QR views */
.vexmov-wallet-submit-btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--bg-button, #10b981), var(--bg-hover, #059669));
    border: none;
    color: var(--text-muted, #fff);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 20px color-mix(in srgb, var(--bg-button, #10b981) 35%, transparent);
}

.vexmov-wallet-submit-btn:hover {
    background: linear-gradient(135deg, var(--bg-hover, #059669), color-mix(in srgb, var(--bg-hover, #059669) 80%, black));
    box-shadow: 0 8px 24px color-mix(in srgb, var(--bg-button, #10b981) 45%, transparent);
    transform: translateY(-1px);
}

.vexmov-wallet-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.vexmov-wallet-qr-box {
    margin-top: 18px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.vexmov-wallet-qr-wrapper {
    display: inline-block;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    margin-bottom: 12px;
}

.vexmov-wallet-qr-wrapper img {
    display: block;
    width: 190px;
    height: 190px;
    object-fit: contain;
}

.vexmov-wallet-qr-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--bg-button, #10b981);
    font-weight: 600;
    background: color-mix(in srgb, var(--bg-button, #10b981) 12%, transparent);
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.anc-pulsing-dot {
    width: 8px;
    height: 8px;
    background: var(--bg-button, #10b981);
    border-radius: 50%;
    animation: ancPulse 1.4s infinite;
}

@keyframes ancPulse {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 color-mix(in srgb, var(--bg-button, #10b981) 70%, transparent); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px transparent; }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 transparent; }
}

.vexmov-wallet-qr-hint {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.45;
}

/* Subview Controls (Bakong KHQR vs ABA/Receipt) */
.vexmov-wallet-subview {
    display: none;
}

.vexmov-wallet-subview.is-active {
    display: block !important;
}

.vexmov-wallet-subview[hidden] {
    display: none !important;
}

/* ABA Section */
.vexmov-wallet-aba-qr-frame {
    text-align: center;
    margin-bottom: 16px;
}

.vexmov-wallet-aba-qr-frame img {
    max-width: 180px;
    border-radius: 12px;
    background: #fff;
    padding: 8px;
    margin: 0 auto;
}

.vexmov-wallet-aba-amount-badge {
    margin: 10px 0 6px;
    font-size: 14px;
    color: #cbd5e1;
    font-weight: 500;
}

.vexmov-wallet-aba-amount-badge strong {
    color: var(--bg-button, #10b981);
    font-size: 16px;
    font-weight: 700;
}

.vexmov-wallet-aba-note {
    font-size: 12px;
    color: #94a3b8;
    margin: 6px 0 0;
}

.vexmov-wallet-receipt-upload,
.vexmov-wallet-txnid-group {
    margin-bottom: 14px;
}

.vexmov-wallet-receipt-upload label,
.vexmov-wallet-txnid-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.vexmov-wallet-receipt-upload input[type="file"] {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 12px;
}

/* Alerts & Messages */
.vexmov-wallet-msg {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.vexmov-wallet-msg.is-success {
    background: color-mix(in srgb, var(--bg-button, #10b981) 15%, transparent);
    color: var(--bg-button, #10b981);
    border: 1px solid color-mix(in srgb, var(--bg-button, #10b981) 35%, transparent);
}

.vexmov-wallet-msg.is-error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

/* History List */
.vexmov-wallet-history-container {
    max-height: 380px;
    overflow-y: auto;
}

.vexmov-wallet-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    margin-bottom: 8px;
    gap: 10px;
}

.vexmov-history-left {
    display: flex;
    flex-direction: column;
}

.vexmov-history-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.vexmov-history-meta {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.vexmov-history-right {
    text-align: right;
}

.vexmov-history-amount {
    font-size: 14px;
    font-weight: 700;
}

.vexmov-history-amount.is-plus {
    color: var(--bg-button, #10b981);
}

.vexmov-history-amount.is-minus {
    color: #f43f5e;
}

.vexmov-history-balance {
    font-size: 11px;
    color: #94a3b8;
}

.vexmov-wallet-loading,
.vexmov-wallet-empty {
    text-align: center;
    padding: 30px;
    color: #94a3b8;
    font-size: 13px;
}

.vexmov-wallet-guest-alert {
    text-align: center;
    padding: 24px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.vexmov-wallet-guest-alert p {
    font-size: 14px;
    color: #cbd5e1;
    margin: 0 0 16px;
    line-height: 1.5;
}

.vexmov-wallet-auth-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}
