/* ── AI Wallet – Public Styles ───────────────────────────────────────────── */

/* ── Balance card ─────────────────────────────────────────────────────────── */
.aiw-dashboard { max-width: 100%; }

.aiw-balance-card {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(74,144,226,.25);
}

.aiw-balance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.aiw-balance-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1.25rem;
}

.aiw-balance-amount {
    display: flex;
    flex-direction: column;
}

.aiw-balance-amount .woocommerce-Price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
}

.aiw-balance-label {
    font-size: .85rem;
    opacity: .85;
    margin-top: 4px;
}

/* ── Stats row ────────────────────────────────────────────────────────────── */
.aiw-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.aiw-stat-box {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
}

.aiw-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
}

.aiw-stat-label {
    font-size: .78rem;
    color: #888;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── Section ──────────────────────────────────────────────────────────────── */
.aiw-section {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
    margin-bottom: 24px;
}

.aiw-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.aiw-section-header h3 { margin: 0; font-size: 1rem; }

.aiw-link { font-size: .875rem; color: #4a90e2; text-decoration: none; }
.aiw-link:hover { text-decoration: underline; }

/* ── Transaction items ────────────────────────────────────────────────────── */
.aiw-transactions-list { display: flex; flex-direction: column; gap: 10px; }

.aiw-transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}
.aiw-transaction-item:last-child { border-bottom: none; }

.aiw-txn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.aiw-txn-credit  { background: #e8f5e9; color: #27ae60; }
.aiw-txn-debit   { background: #fdecea; color: #e74c3c; }
.aiw-txn-refund  { background: #e3f2fd; color: #2196f3; }

.aiw-txn-details { flex: 1; min-width: 0; }
.aiw-txn-title   { font-weight: 600; font-size: .9rem; color: #2c3e50; }
.aiw-txn-meta    { font-size: .78rem; color: #999; margin-top: 2px; }

.aiw-txn-amount {
    font-weight: 700;
    font-size: .95rem;
    white-space: nowrap;
}
.aiw-txn-amount.aiw-txn-credit { color: #27ae60; }
.aiw-txn-amount.aiw-txn-debit  { color: #e74c3c; }
.aiw-txn-amount.aiw-txn-refund { color: #2196f3; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.aiw-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.aiw-badge-completed { background: #e8f5e9; color: #27ae60; }
.aiw-badge-pending   { background: #fff8e1; color: #f39c12; }
.aiw-badge-failed    { background: #fdecea; color: #e74c3c; }
.aiw-badge-credit    { background: #e8f5e9; color: #27ae60; }
.aiw-badge-debit     { background: #fdecea; color: #e74c3c; }
.aiw-badge-refund    { background: #e3f2fd; color: #2196f3; }

/* ── Transactions table ───────────────────────────────────────────────────── */
.aiw-transactions-table-wrapper { overflow-x: auto; }

.aiw-transactions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.aiw-transactions-table th,
.aiw-transactions-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}
.aiw-transactions-table th {
    background: #f9f9f9;
    font-weight: 600;
    color: #555;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.aiw-transactions-table .aiw-amount.aiw-credit { color: #27ae60; font-weight: 700; }
.aiw-transactions-table .aiw-amount.aiw-debit  { color: #e74c3c; font-weight: 700; }
.aiw-transactions-table .aiw-amount.aiw-refund { color: #2196f3; font-weight: 700; }

/* ── Top-up form ──────────────────────────────────────────────────────────── */
.aiw-topup-page h2 { margin-bottom: 8px; }
.aiw-current-balance { margin-bottom: 20px; color: #555; }

.aiw-form-group { margin-bottom: 20px; }
.aiw-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}
.aiw-form-group input[type="number"] {
    width: 100%;
    max-width: 320px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: .95rem;
}
.aiw-hint { font-size: .8rem; color: #999; margin-top: 4px; }

/* ── Crypto selector ─────────────────────────────────────────────────────── */
.aiw-crypto-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.aiw-crypto-option input[type="radio"] { display: none; }

.aiw-crypto-option .aiw-crypto-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    min-width: 90px;
    text-align: center;
    background: #fff;
}

.aiw-crypto-option input:checked + .aiw-crypto-label {
    border-color: #4a90e2;
    background: #f0f7ff;
}

.aiw-crypto-icon { font-size: .75rem; font-weight: 700; color: #4a90e2; letter-spacing: .05em; }
.aiw-crypto-name { font-size: .8rem; color: #555; margin-top: 4px; }

/* ── Bonus notice ─────────────────────────────────────────────────────────── */
.aiw-bonus-notice {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #856404;
    font-size: .9rem;
}
.aiw-bonus-notice .dashicons { margin-right: 6px; vertical-align: middle; }

/* ── Payment instructions ─────────────────────────────────────────────────── */
.aiw-payment-instructions {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 24px;
    margin-top: 16px;
}
.aiw-payment-instructions h3 { margin-top: 0; }

.aiw-payment-details {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.aiw-qr-code img {
    width: 160px;
    height: 160px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    padding: 6px;
}

.aiw-payment-info { flex: 1; min-width: 220px; }

.aiw-info-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}
.aiw-info-row label { font-weight: 600; font-size: .85rem; color: #555; margin-bottom: 4px; }

.aiw-copy-field {
    display: flex;
    gap: 8px;
    align-items: center;
}
.aiw-copy-field input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: .85rem;
    background: #fff;
}
.aiw-copy-btn {
    padding: 8px 14px;
    background: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: .8rem;
    white-space: nowrap;
}
.aiw-copy-btn:hover { background: #357abd; }

.aiw-payment-notice {
    background: #fff8e1;
    border-left: 4px solid #f39c12;
    padding: 12px 16px;
    border-radius: 4px;
    margin-top: 16px;
    font-size: .875rem;
}
.aiw-payment-notice ul { margin: 8px 0 0 18px; padding: 0; }
.aiw-payment-notice li { margin-bottom: 4px; }

.aiw-payment-status {
    text-align: center;
    padding: 16px;
    color: #555;
}

.aiw-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #4a90e2;
    border-radius: 50%;
    margin: 10px auto 0;
    animation: aiw-spin .8s linear infinite;
}
@keyframes aiw-spin { to { transform: rotate(360deg); } }

/* ── Checkout balance display ─────────────────────────────────────────────── */
.aiw-checkout-balance {
    background: #e8f5e9;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 8px 0 4px;
    font-size: .9rem;
    color: #2c3e50;
}

.aiw-partial-notice {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 8px;
    font-size: .875rem;
    color: #5d4037;
    line-height: 1.6;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.aiw-btn-primary {
    background: #4a90e2 !important;
    color: #fff !important;
    border-color: #357abd !important;
    border-radius: 6px !important;
}
.aiw-btn-primary:hover {
    background: #357abd !important;
    border-color: #2a6099 !important;
}

.aiw-btn-large { padding: 12px 28px !important; font-size: 1rem !important; }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.aiw-empty-state {
    text-align: center;
    padding: 32px 20px;
    color: #999;
}
.aiw-empty-state p { margin-bottom: 12px; }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.aiw-pagination {
    margin-top: 20px;
    text-align: center;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .aiw-stats-row { grid-template-columns: 1fr 1fr; }
    .aiw-balance-card { padding: 20px; }
    .aiw-payment-details { flex-direction: column; }
    .aiw-qr-code img { width: 120px; height: 120px; }
}
