/* Sarea Wallet Frontend Styles */

/* Header Wallet Balance */
.sarea-wallet-header-balance {
    display: inline-flex;
    align-items: center;
    margin: 0 10px;
    padding: 8px 15px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    vertical-align: middle;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sarea-wallet-header-balance:hover {
    background: linear-gradient(135deg, #005a87 0%, #004666 100%);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.sarea-wallet-header-balance .wallet-icon {
    margin-left: 8px;
    font-size: 16px;
}

/* My Account Wallet Page */
.sarea-wallet-account-page {
    max-width: 100%;
}

.wallet-balance-section {
    /*background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);*/
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: center;
}

.wallet-balance-section h2 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.current-balance {
    font-size: 1.8em;
    font-weight: bold;
}

.balance-label {
    color: #6c757d;
    margin-left: 10px;
}

.balance-amount {
    color: #0073aa;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Wallet Actions Section */
.wallet-actions-section {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.wallet-actions-section h3 {
    color: #495057;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.wallet-actions-section .description {
    color: #6c757d;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Charge Request Form */
.charge-request-form {
    max-width: 600px;
}

.charge-request-form .form-row {
    margin-bottom: 20px;
}

.charge-request-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.charge-request-form input[type="number"],
.charge-request-form select,
.charge-request-form input[type="text"],
.charge-request-form textarea {
    width: 100% !important;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.charge-request-form input:focus,
.charge-request-form select:focus,
.charge-request-form textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.charge-request-form small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 14px;
}

.charge-request-form .button {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.charge-request-form .button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004666 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Transactions Section */
.wallet-transactions-section {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 25px;
}

.wallet-transactions-section h3 {
    color: #495057;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.no-transactions {
    text-align: center;
    color: #6c757d;
    padding: 40px;
    font-style: italic;
}

/* Transactions Table */
.transactions-table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.transactions-table thead {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
}

.transactions-table th,
.transactions-table td {
    padding: 15px 12px;
    text-align: right;
    border-bottom: 1px solid #dee2e6;
}

.transactions-table th {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

.transactions-table tbody tr:hover {
    background: #f8f9fa;
}

.transactions-table .voucher-number {
    font-weight: bold;
    color: #0073aa;
    font-family: monospace;
}

/* Transaction Type Badges */
.type-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-badge.type-credit {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.type-badge.type-debit {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Amount Styling */
.amount.credit {
    color: #198754;
    font-weight: bold;
}

.amount.debit {
    color: #dc3545;
    font-weight: bold;
}

.balance-after {
    font-weight: 600;
    color: #495057;
}

.transaction-date {
    color: #6c757d;
    font-size: 14px;
}

.description {
    color: #6c757d;
    font-size: 14px;
}

/* Payment Gateway Styles */
.sarea-wallet-payment-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid #dee2e6;
}

.wallet-balance-info {
    margin-top: 15px;
}

.wallet-balance-info p {
    margin: 12px 0;
    font-size: 16px;
}

.wallet-sufficient {
    color: #198754;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.wallet-insufficient {
    color: #dc3545;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.wallet-balance-info .dashicons {
    font-size: 18px;
    line-height: 1;
    vertical-align: middle;
    margin-left: 8px;
}

/* Order Details Wallet Info */
.wallet-payment-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.wallet-payment-info h2 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.wallet-payment-info .woocommerce-table {
    margin: 0;
}

.wallet-payment-info .woocommerce-table th {
    background: #e9ecef;
    font-weight: 600;
}

/* Loading States */
.form-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.form-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 50%;
    width: 24px;
    height: 24px;
    margin: -12px -12px 0 0;
    border: 3px solid #dee2e6;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: wallet-spin 1s linear infinite;
}

@keyframes wallet-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success/Error Messages */
.wallet-message {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 600;
}

.wallet-message.success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.wallet-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sarea-wallet-header-balance {
        font-size: 12px;
        padding: 6px 12px;
        margin: 0 5px;
    }

    .sarea-wallet-header-balance .wallet-icon {
        margin-left: 6px;
        font-size: 14px;
    }

    .current-balance {
        font-size: 1.5em;
    }

    .transactions-table-wrapper {
        margin: 0 -25px;
    }

    .transactions-table th,
    .transactions-table td {
        padding: 12px 8px;
        font-size: 14px;
    }

    .wallet-balance-section,
    .wallet-actions-section,
    .wallet-transactions-section {
        padding: 20px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .type-badge {
        padding: 3px 8px;
        font-size: 11px;
    }

    .charge-request-form .button {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
}

/* RTL Support */
body.rtl .sarea-wallet-header-balance .wallet-icon {
    margin-right: 8px;
    margin-left: 0;
}

body.rtl .balance-label {
    margin-right: 10px;
    margin-left: 0;
}

body.rtl .wallet-balance-info .dashicons {
    margin-right: 8px;
    margin-left: 0;
}

body.rtl .transactions-table th,
body.rtl .transactions-table td {
    text-align: left;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .sarea-wallet-header-balance {
        background: #000;
        border: 2px solid #fff;
    }

    .wallet-balance-section,
    .wallet-actions-section,
    .wallet-transactions-section {
        border: 2px solid #000;
    }

    .type-badge {
        border: 2px solid #000;
    }
}

/* Print Styles */
@media print {
    .sarea-wallet-header-balance,
    .charge-request-form,
    .wallet-actions-section {
        display: none;
    }

    .transactions-table {
        border: 1px solid #000;
    }

    .transactions-table th,
    .transactions-table td {
        border: 1px solid #000;
        color: #000;
        background: #fff;
    }

    .wallet-balance-section {
        border: 2px solid #000;
        background: #fff !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: Dark) {
    .wallet-balance-section {
        background:#FFFFFF !important;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .wallet-actions-section,
    .wallet-transactions-section {
       background: #fff !important;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .transactions-table {
       background: #fff !important;
        color: #e2e8f0;
    }

    .transactions-table thead {
        background: #1a202c;
    }

    .transactions-table tbody tr:hover {
        background: #4a5568;
    }
}


.wallet-transactions-section {
    overflow-x: auto;
    padding-bottom: 10px;
}

.transactions-table {
    min-width: 700px; /* أو حسب ما يناسبك */
    width: max-content;
}

.transactions-table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    display: block;
}


.transactions-table-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 10px;
    background: linear-gradient(to right, rgba(0,0,0,0.1), transparent);
    pointer-events: none;
}


.transactions-table-wrapper {
    overflow-x: auto;
    width: 100%;
}
.transactions-table-wrapper table {
    min-width: 800px; /* أو أكثر حسب عدد الأعمدة */
}



