/**
 * WP Advanced Wallet Styles
 * Complete styling for all wallet components with Modern Modal System
 */

/* ==========================================================================
   Base Wallet Styles
   ========================================================================== */

.wallet-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================================================
   Modern Modal System
   ========================================================================== */

/* Modern Modal Overlay */
.wallet-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wallet-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modern Modal Container */
.wallet-modal {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 440px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wallet-modal-overlay.active .wallet-modal {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.wallet-modal-header {
    padding: 32px 32px 24px;
    text-align: center;
    position: relative;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.wallet-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
    font-size: 18px;
}

.wallet-modal-close:hover {
    background: rgba(0, 0, 0, 0.15);
    transform: scale(1.1);
}

/* Icon Container */
.modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    position: relative;
    animation: iconPulse 2s infinite ease-in-out;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.modal-icon.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.modal-icon.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.modal-icon.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.modal-icon.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.modal-icon.loading {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    animation: spin 1s linear infinite;
}

.modal-icon.transfer {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.modal-icon.deposit {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.modal-icon.withdraw {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Modal Title */
.wallet-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    line-height: 1.2;
}

/* Modal Content */
.wallet-modal-content {
    padding: 0 32px 32px;
    text-align: center;
}

.wallet-modal-message {
    font-size: 16px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Progress Bar for Loading */
.progress-container {
    width: 100%;
    height: 4px;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
    border-radius: 2px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Modal Details */
.wallet-details {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    text-align: left;
}

.wallet-details-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    padding: 4px 0;
    border-bottom: 1px solid #e2e8f0;
}

.wallet-details-item:last-child {
    border-bottom: none;
}

.wallet-details-label {
    color: #64748b;
    font-size: 14px;
}

.wallet-details-value {
    color: #1e293b;
    font-weight: 600;
}

/* Action Buttons */
.wallet-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Auto-hide animation for success messages */
.auto-hide {
    animation: autoHideSlide 4s ease-in-out forwards;
}

@keyframes autoHideSlide {
    0%, 70% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    85% {
        opacity: 0.7;
        transform: scale(0.95) translateY(-10px);
    }
    100% {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.wallet-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 5px;
    line-height: 1.4;
    border: none;
    min-width: 100px;
    position: relative;
    overflow: hidden;
}

.wallet-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.wallet-btn:hover:before {
    left: 100%;
}

.wallet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.wallet-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* Button Variants */
.wallet-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.wallet-btn-primary:hover {
    color: white;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.wallet-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.wallet-btn-secondary:hover {
    background: #e2e8f0;
    color: #475569;
}

.wallet-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.wallet-btn-success:hover {
    color: white;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.wallet-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.wallet-btn-danger:hover {
    color: white;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.wallet-btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.wallet-btn-info:hover {
    color: white;
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4);
}

.wallet-btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.wallet-btn-warning:hover {
    color: white;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

/* ==========================================================================
   Balance Display
   ========================================================================== */

.wallet-balance {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.balance-label {
    font-size: 16px;
    opacity: 0.9;
    display: block;
    margin-bottom: 10px;
}

.balance-amount {
    font-size: 32px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.balance-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.balance-card h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 18px;
}

.balance-card .balance-amount {
    font-size: 36px;
    color: #28a745;
    font-weight: 700;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.wallet-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin: 20px 0;
    border: 1px solid #e1e5e9;
}

.wallet-form h3 {
    color: #343a40;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Form validation styles */
.form-group input.valid {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group input.invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group input.checking {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Validation messages */
.amount-validation-message,
.recipient-validation-message {
    font-size: 12px;
    margin-top: 5px;
    padding: 5px 10px;
    border-radius: 4px;
}

.error-message {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.success-message {
    color: #059669;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.info-message {
    color: #0369a1;
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
}

/* Form Variants */
.wallet-deposit-form,
.wallet-withdraw-form,
.wallet-transfer-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin: 20px 0;
    border: 1px solid #e1e5e9;
}

/* QR Code Image Display Fix */
.qr-code-container img {
    display: block !important;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: none;
    box-shadow: none;
}

.qr-code-container {
    text-align: center;
    background: white;
    padding: 10px;
    border-radius: 12px;
}

/* ==========================================================================
   Dashboard
   ========================================================================== */

.wallet-dashboard {
    max-width: 1200px;
    margin: 0 auto;
}

.wallet-overview {
    margin-bottom: 40px;
}

.wallet-overview h2 {
    color: #343a40;
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.wallet-actions {
    margin-bottom: 40px;
}

.action-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.action-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.recent-transactions h3 {
    color: #343a40;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* ==========================================================================
   Transaction History
   ========================================================================== */

.wallet-history {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
}

.wallet-transactions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

.wallet-transactions-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-top: 2px solid #007cba;
}

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

.wallet-transactions-table .amount {
    font-weight: 600;
}

.wallet-transactions-table .amount.positive {
    color: #28a745;
}

.wallet-transactions-table .amount.negative {
    color: #dc3545;
}

.wallet-transactions-table .status-completed {
    color: #28a745;
    font-weight: 600;
}

.wallet-transactions-table .status-pending {
    color: #ffc107;
    font-weight: 600;
}

.wallet-transactions-table .status-failed {
    color: #dc3545;
    font-weight: 600;
}

/* Transaction Types */
.transaction-type-deposit {
    color: #28a745;
    font-weight: 600;
}

.transaction-type-withdrawal {
    color: #dc3545;
    font-weight: 600;
}

.transaction-type-transfer {
    color: #17a2b8;
    font-weight: 600;
}

.transaction-type-qr_payment {
    color: #6f42c1;
    font-weight: 600;
}

/* ==========================================================================
   Top-up Component
   ========================================================================== */

.wallet-topup {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
}

.topup-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
    justify-content: center;
}

.topup-amount-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.topup-amount-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.custom-amount {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #e9ecef;
}

.custom-amount label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #495057;
}

.custom-amount input {
    max-width: 200px;
    margin: 0 10px;
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
}

/* ==========================================================================
   QR Code Components
   ========================================================================== */

.wallet-qr-generator,
.wallet-qr-scanner {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin: 20px 0;
    border: 1px solid #e1e5e9;
}

.qr-form {
    margin-bottom: 25px;
}

.qr-display {
    text-align: center;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

.qr-code-container {
    margin-bottom: 20px;
}

.qr-code-container #qr-code {
    margin: 0 auto 20px;
    display: inline-block;
}

.qr-info p {
    margin: 8px 0;
    color: #495057;
}

.qr-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.qr-code-simple {
    text-align: center;
    margin: 20px 0;
}

/* QR Scanner Specific */
.scanner-container {
    text-align: center;
}

#qr-scanner {
    margin: 20px auto;
    border: 3px solid #007cba;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.scanner-controls {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.manual-entry {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-top: 25px;
    border: 1px solid #dee2e6;
}

.manual-entry h4 {
    color: #495057;
    margin-bottom: 20px;
    text-align: center;
}

#qr-scan-result {
    background: #e8f5e8;
    border: 2px solid #28a745;
    border-radius: 10px;
    padding: 25px;
    margin-top: 25px;
}

.payment-details p {
    margin: 10px 0;
    font-size: 16px;
    color: #495057;
}

.payment-actions {
    text-align: center;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* QR Receive Component */
.wallet-receive-qr,
.wallet-pay-qr {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin: 15px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
}

.qr-info {
    color: #6c757d;
    font-size: 14px;
    margin-top: 15px;
}

.qr-tabs {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.qr-tab-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
}

/* ==========================================================================
   WooCommerce Integration
   ========================================================================== */

.woocommerce-wallet-balance {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #007cba;
}

.woocommerce-wallet-balance p {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #495057;
}

.woocommerce-wallet-balance strong {
    color: #28a745;
    font-size: 18px;
}

#apply-wallet-balance {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#apply-wallet-balance:hover {
    background: #1e7e34;
}

#apply-wallet-balance:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.remove-wallet-discount {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 10px;
}

.remove-wallet-discount:hover {
    background: #bd2130;
}

/* WooCommerce Cart Enhancements */
.cart-wallet-options {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px solid #dee2e6;
}

.cart-wallet-options h3 {
    color: #343a40;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
}

.wallet-balance-info {
    margin-bottom: 20px;
}

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

.wallet-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* WooCommerce Account Page */
.woocommerce-MyAccount-navigation-link--wallet a {
    color: #007cba;
    text-decoration: none;
    font-weight: 600;
}

.woocommerce-MyAccount-navigation-link--wallet.is-active a {
    background: #007cba;
    color: white;
}

.wallet-tab-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #e1e5e9;
}

.wallet-balance-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
}

.wallet-balance-card h4 {
    margin: 0 0 15px 0;
    opacity: 0.9;
}

.wallet-balance-card .balance-amount {
    font-size: 36px;
    font-weight: 700;
    margin: 0;
}

.wallet-quick-actions {
    margin: 30px 0;
}

.wallet-quick-actions h4 {
    color: #343a40;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.wallet-recent-transactions {
    margin: 30px 0;
}

.wallet-recent-transactions h4 {
    color: #343a40;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* Product Page Wallet Option */
.wallet-pay-option {
    background: #e8f5e8;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 2px solid #28a745;
}

.wallet-pay-option h4 {
    color: #155724;
    margin: 0 0 15px 0;
}

.wallet-pay-option p {
    color: #155724;
    margin: 10px 0;
}

#product-wallet-balance {
    font-weight: 700;
    color: #28a745;
}

/* ==========================================================================
   Messages and Notifications (Legacy - for fallback)
   ========================================================================== */

.wallet-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.wallet-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

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

.wallet-message-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.wallet-message-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Trial and License Messages */
.wallet-trial-notice {
    background: #fff3cd;
    color: #856404;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #ffc107;
}

.wallet-expired-notice {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #dc3545;
}

/* ==========================================================================
   Admin Styles
   ========================================================================== */

.wallet-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-box {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #007cba;
}

.stat-box h3 {
    font-size: 32px;
    font-weight: 700;
    color: #007cba;
    margin: 0 0 10px 0;
}

.stat-box p {
    color: #6c757d;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.license-status {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   QR Payment Page
   ========================================================================== */

.wallet-qr-payment-page {
    max-width: 600px;
    margin: 50px auto;
    padding: 20px;
}

.payment-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.payment-container h2 {
    color: #343a40;
    margin-bottom: 30px;
    font-size: 24px;
}

.payment-details {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin: 25px 0;
    border-left: 4px solid #007cba;
}

.payment-details p {
    margin: 12px 0;
    font-size: 16px;
    color: #495057;
}

.payment-form {
    margin-top: 30px;
}

.login-required {
    background: #fff3cd;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #ffeaa7;
    margin-top: 25px;
}

.login-required p {
    color: #856404;
    margin: 0 0 20px 0;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.wallet-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

.wallet-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: wallet-spin 1s linear infinite;
    margin-right: 8px;
}

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

.wallet-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: wallet-spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .wallet-container {
        padding: 15px;
    }
    
    .wallet-dashboard {
        padding: 15px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .wallet-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .topup-amounts {
        justify-content: center;
    }
    
    .topup-amount-btn {
        flex: 1;
        min-width: 80px;
        margin: 5px;
    }
    
    .wallet-form {
        padding: 20px;
        margin: 15px 0;
    }
    
    .balance-card {
        padding: 25px 20px;
    }
    
    .balance-amount {
        font-size: 28px;
    }
    
    .wallet-transactions-table {
        font-size: 14px;
    }
    
    .wallet-transactions-table th,
    .wallet-transactions-table td {
        padding: 10px 8px;
    }
    
    #qr-scanner {
        width: 250px;
        height: 250px;
    }
    
    .scanner-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .qr-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .payment-actions {
        flex-direction: column;
    }
    
    .wallet-modal {
        margin: 10px;
        max-height: 95vh;
        border-radius: 20px;
    }
    
    .wallet-modal-header,
    .wallet-modal-content {
        padding: 24px;
    }
    
    .modal-icon {
        width: 64px;
        height: 64px;
        font-size: 24px;
    }
    
    .wallet-modal-title {
        font-size: 20px;
    }
    
    .wallet-modal-actions {
        flex-direction: column;
    }
    
    .wallet-message {
        position: relative;
        top: auto;
        right: auto;
        margin: 15px;
        min-width: auto;
    }
    
    .stat-box {
        padding: 20px;
    }
    
    .stat-box h3 {
        font-size: 24px;
    }
    
    .payment-container {
        padding: 25px 20px;
    }
    
    .wallet-actions {
        flex-direction: column;
    }
    
    .qr-tab-content {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .balance-card .balance-amount {
        font-size: 28px;
    }
    
    .wallet-transactions-table {
        font-size: 12px;
    }
    
    .wallet-transactions-table th,
    .wallet-transactions-table td {
        padding: 8px 5px;
    }
    
    .topup-amount-btn {
        font-size: 14px;
        padding: 12px 20px;
        min-width: 70px;
    }
    
    #qr-scanner {
        width: 200px;
        height: 200px;
    }
    
    .stat-box h3 {
        font-size: 20px;
    }
    
    .wallet-modal {
        max-width: 95%;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.wallet-btn:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Modal accessibility */
.wallet-modal[aria-modal="true"] {
    outline: none;
}

.wallet-modal-overlay[aria-hidden="true"] {
    display: none;
}

/* Focus management */
.wallet-modal:focus-within {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wallet-btn {
        border: 2px solid currentColor;
    }
    
    .wallet-modal {
        border: 2px solid #000;
    }
    
    .modal-icon {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .wallet-modal-overlay,
    .wallet-modal,
    .modal-icon,
    .wallet-btn,
    .progress-bar {
        animation: none;
        transition: none;
    }
    
    .wallet-btn:hover {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wallet-modal {
        background: #1e293b;
        color: #e2e8f0;
    }
    
    .wallet-modal-header {
        background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    }
    
    .wallet-modal-title {
        color: #e2e8f0;
    }
    
    .wallet-modal-message {
        color: #94a3b8;
    }
    
    .wallet-details {
        background: #334155;
        border-color: #475569;
    }
    
    .wallet-details-label {
        color: #94a3b8;
    }
    
    .wallet-details-value {
        color: #e2e8f0;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .wallet-btn,
    .scanner-controls,
    .qr-actions,
    .payment-actions,
    .wallet-modal-overlay {
        display: none;
    }
    
    .wallet-qr-payment-page,
    .wallet-form,
    .wallet-dashboard {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .wallet-message {
        position: static;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .wallet-modal {
        position: static;
        box-shadow: none;
        border: 2px solid #000;
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   Custom Properties for Theming
   ========================================================================== */

:root {
    --wallet-primary-color: #3b82f6;
    --wallet-success-color: #10b981;
    --wallet-error-color: #ef4444;
    --wallet-warning-color: #f59e0b;
    --wallet-info-color: #06b6d4;
    --wallet-background: #ffffff;
    --wallet-text-color: #1e293b;
    --wallet-border-radius: 12px;
    --wallet-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    --wallet-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Apply custom properties */
.wallet-btn-primary {
    background: linear-gradient(135deg, var(--wallet-primary-color), #2563eb);
}

.wallet-btn-success {
    background: linear-gradient(135deg, var(--wallet-success-color), #059669);
}

.wallet-btn-danger {
    background: linear-gradient(135deg, var(--wallet-error-color), #dc2626);
}

.wallet-btn-warning {
    background: linear-gradient(135deg, var(--wallet-warning-color), #d97706);
}

.wallet-btn-info {
    background: linear-gradient(135deg, var(--wallet-info-color), #0891b2);
}

.wallet-form,
.wallet-modal,
.balance-card {
    border-radius: var(--wallet-border-radius);
    box-shadow: var(--wallet-shadow);
    transition: var(--wallet-transition);
}

/* ==========================================================================
   Animation Utilities
   ========================================================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Utility classes for animations */
.fade-in { animation: fadeIn 0.3s ease-out; }
.slide-up { animation: slideUp 0.3s ease-out; }
.slide-down { animation: slideDown 0.3s ease-out; }
.pulse { animation: pulse 2s infinite; }
.shake { animation: shake 0.5s ease-in-out; }

/* ==========================================================================
   Error Handling Styles
   ========================================================================== */

.wallet-error-boundary {
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: var(--wallet-border-radius);
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.wallet-error-boundary h3 {
    color: #dc2626;
    margin-bottom: 10px;
}

.wallet-error-boundary p {
    color: #991b1b;
    margin-bottom: 15px;
}

.wallet-offline-notice {
    background: #fef3c7;
    border: 2px solid #fcd34d;
    border-radius: var(--wallet-border-radius);
    padding: 15px;
    margin: 15px 0;
    text-align: center;
    color: #92400e;
}

/* ==========================================================================
   Performance Optimizations
   ========================================================================== */

/* GPU acceleration for animations */
.wallet-modal,
.modal-icon,
.wallet-btn {
    transform: translateZ(0);
    will-change: transform;
}

/* Optimize repaints */
.wallet-modal-overlay {
    contain: strict;
}

.wallet-modal {
    contain: layout style paint;
}

/* ==========================================================================
   Browser-specific Fixes
   ========================================================================== */

/* Safari iOS fixes */
@supports (-webkit-appearance: none) {
    .wallet-modal {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}

/* Firefox fixes */
@-moz-document url-prefix() {
    .wallet-btn {
        -moz-appearance: none;
    }
}

/* Edge/IE fixes */
@supports (-ms-ime-align: auto) {
    .wallet-modal-overlay {
        display: -ms-flexbox;
        -ms-flex-align: center;
        -ms-flex-pack: center;
    }
}

/**
 * Enhanced WP Advanced Wallet CSS
 * Additional styles for PIN interface, Wallet ID display, and AJAX components
 */

/* ==========================================================================
   Wallet ID Display
   ========================================================================== */

.wallet-id-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.wallet-id-display label {
    display: block;
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 15px;
    color: white;
}

.wallet-id-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.wallet-id-text {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 8px;
    user-select: all;
}

.copy-wallet-id {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    transition: all 0.3s ease;
}

.copy-wallet-id:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-1px);
}

.wallet-id-help {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 10px;
    display: block;
}

/* ==========================================================================
   PIN Setup and Input System
   ========================================================================== */

.wallet-pin-setup {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 20px auto;
    text-align: center;
}

.wallet-pin-setup h3 {
    color: #343a40;
    margin-bottom: 15px;
    font-size: 24px;
}

.wallet-pin-setup p {
    color: #6c757d;
    margin-bottom: 25px;
    line-height: 1.6;
}

.pin-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 600;
}

.pin-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.pin-status .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.pin-input-container {
    margin-bottom: 30px;
}

.pin-input-container label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
    font-size: 16px;
}

.pin-display {
    position: relative;
    display: inline-block;
}

.pin-hidden-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

.pin-circles {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
}

.pin-circle {
    width: 20px;
    height: 20px;
    border: 3px solid #dee2e6;
    border-radius: 50%;
    background: transparent;
    transition: all 0.3s ease;
    position: relative;
}

.pin-circle.filled {
    background: #007cba;
    border-color: #007cba;
    transform: scale(1.1);
}

.pin-circle.filled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* PIN Keypad */
.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 240px;
    margin: 0 auto 30px;
}

.pin-key {
    width: 60px;
    height: 60px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    background: white;
    font-size: 24px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-key:hover {
    background: #f8f9fa;
    border-color: #007cba;
    transform: scale(1.05);
}

.pin-key:active {
    background: #007cba;
    color: white;
    transform: scale(0.95);
}

.pin-key.pin-clear,
.pin-key.pin-backspace {
    font-size: 14px;
    font-weight: 500;
}

.pin-actions {
    margin-top: 30px;
}

/* ==========================================================================
   PIN Modal for Transfer
   ========================================================================== */

.pin-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.pin-modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    animation: pinModalSlideIn 0.3s ease-out;
}

@keyframes pinModalSlideIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.pin-modal-content h4 {
    color: #343a40;
    margin-bottom: 25px;
    font-size: 20px;
}

.pin-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* ==========================================================================
   Enhanced Transfer Form
   ========================================================================== */

.wallet-transfer-disabled {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    margin: 20px 0;
}

.wallet-transfer-disabled p {
    color: #856404;
    margin: 0 0 20px 0;
    font-size: 16px;
}

.setup-pin-link {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white !important;
    text-decoration: none;
}

.setup-pin-link:hover {
    color: white !important;
    transform: translateY(-2px);
}

/* Enhanced wallet ID input */
#transfer-wallet-id {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    padding: 15px;
    border: 3px solid #e1e5e9;
    border-radius: 10px;
    transition: all 0.3s ease;
}

#transfer-wallet-id:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
    outline: none;
}

#transfer-wallet-id.valid {
    border-color: #28a745;
    background: #f8fff9;
}

#transfer-wallet-id.invalid {
    border-color: #dc3545;
    background: #fff5f5;
}

#transfer-wallet-id.checking {
    border-color: #007cba;
    background: #f0f9ff;
}

/* ==========================================================================
   Enhanced Transaction History with AJAX
   ========================================================================== */

.wallet-history {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.transaction-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.filter-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-row input,
.filter-row select {
    min-width: 150px;
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
}

.filter-row input:focus,
.filter-row select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

#transactions-container {
    position: relative;
    min-height: 300px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    color: #6c757d;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.transactions-table-container {
    overflow-x: auto;
    margin: 20px 0;
}

.wallet-transactions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.wallet-transactions-table th,
.wallet-transactions-table td {
    padding: 15px 10px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.wallet-transactions-table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    color: #495057;
    border-top: 3px solid #007cba;
    position: sticky;
    top: 0;
    z-index: 10;
}

.wallet-transactions-table tbody tr {
    transition: background-color 0.2s ease;
}

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

.wallet-transactions-table .transaction-id {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
}

.wallet-transactions-table .amount {
    font-weight: 700;
    font-size: 16px;
    position: relative;
    padding-right: 25px;
}

.wallet-transactions-table .amount.positive {
    color: #28a745;
}

.wallet-transactions-table .amount.negative {
    color: #dc3545;
}

.wallet-transactions-table .amount-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
}

.wallet-transactions-table .transaction-note {
    max-width: 200px;
    word-wrap: break-word;
    font-size: 13px;
    color: #6c757d;
}

/* Enhanced Pagination */
.wallet-pagination {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.pagination-links {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-links a,
.pagination-links .current-page {
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    transition: all 0.2s ease;
    font-weight: 500;
    min-width: 44px;
    text-align: center;
}

.pagination-links a:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
    transform: translateY(-1px);
}

.pagination-links .current-page {
    background: #007cba;
    color: white;
    border-color: #007cba;
    font-weight: 700;
}

.pagination-ellipsis {
    padding: 10px 5px;
    color: #6c757d;
}

.pagination-info {
    font-size: 14px;
    color: #6c757d;
    text-align: center;
}

/* No transactions state */
.no-transactions {
    text-align: center;
    padding: 50px 20px;
    color: #6c757d;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

/* ==========================================================================
   Responsive Design Enhancements
   ========================================================================== */

@media (max-width: 768px) {
    .wallet-id-value {
        flex-direction: column;
        gap: 10px;
    }
    
    .wallet-id-text {
        font-size: 18px;
        letter-spacing: 1px;
    }
    
    .pin-keypad {
        max-width: 200px;
        gap: 10px;
    }
    
    .pin-key {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .pin-modal-content {
        margin: 10px;
        padding: 30px 20px;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-row input,
    .filter-row select {
        min-width: auto;
        width: 100%;
    }
    
    .wallet-transactions-table {
        font-size: 12px;
    }
    
    .wallet-transactions-table th,
    .wallet-transactions-table td {
        padding: 10px 5px;
    }
    
    .wallet-transactions-table .transaction-id {
        font-size: 10px;
    }
    
    .wallet-transactions-table .amount {
        font-size: 14px;
    }
    
    .wallet-transactions-table .transaction-note {
        max-width: 120px;
        font-size: 11px;
    }
    
    .pagination-links {
        gap: 4px;
    }
    
    .pagination-links a,
    .pagination-links .current-page {
        padding: 8px 10px;
        font-size: 14px;
        min-width: 36px;
    }
}

@media (max-width: 480px) {
    .wallet-pin-setup {
        padding: 20px;
        margin: 10px;
    }
    
    .pin-circles {
        gap: 10px;
    }
    
    .pin-circle {
        width: 16px;
        height: 16px;
        border-width: 2px;
    }
    
    .pin-circle.filled::after {
        width: 6px;
        height: 6px;
    }
    
    .pin-keypad {
        max-width: 180px;
        gap: 8px;
    }
    
    .pin-key {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    /*.wallet-transactions-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .wallet-transactions-table thead,
    .wallet-transactions-table tbody,
    .wallet-transactions-table th,
    .wallet-transactions-table td,
    .wallet-transactions-table tr {
        display: block;
    }
    
    .wallet-transactions-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .wallet-transactions-table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 15px;
        border-radius: 8px;
        background: white;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    
    .wallet-transactions-table td {
        border: none !important;
        position: relative;
        padding: 8px 0 8px 120px !important;
        white-space: normal;
        text-align: left;
    }
    
    .wallet-transactions-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 0;
        width: 110px;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: #495057;
    }
}

/* ==========================================================================
   Loading States and Animations
   ========================================================================== */

.checking {
    position: relative;
    overflow: hidden;
}

.checking::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 124, 186, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

.pin-key:focus,
.copy-wallet-id:focus,
#transfer-wallet-id:focus {
    outline: 3px solid #007cba;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Screen reader announcements */
.sr-announcement {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pin-circle {
        border-width: 4px;
    }
    
    .pin-key {
        border-width: 3px;
    }
    
    .wallet-id-text {
        border: 2px solid currentColor;
    }
    
    .transaction-id {
        border: 1px solid currentColor !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .pin-circle,
    .pin-key,
    .wallet-transactions-table tbody tr,
    .pagination-links a {
        transition: none;
    }
    
    .pin-key:hover {
        transform: none;
    }
    
    .pinModalSlideIn,
    .shimmer,
    .fadeIn,
    .spin {
        animation: none;
    }
    
    .checking::after {
        display: none;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .wallet-pin-setup,
    .pin-modal-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .wallet-pin-setup h3,
    .pin-modal-content h4 {
        color: #e2e8f0;
    }
    
    .wallet-pin-setup p {
        color: #a0aec0;
    }
    
    .pin-circle {
        border-color: #4a5568;
        background: transparent;
    }
    
    .pin-circle.filled {
        background: #4299e1;
        border-color: #4299e1;
    }
    
    .pin-key {
        background: #4a5568;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .pin-key:hover {
        background: #2d3748;
        border-color: #4299e1;
    }
    
    .transaction-filters {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .filter-row input,
    .filter-row select {
        background: #4a5568;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .wallet-transactions-table th {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
        color: #e2e8f0;
    }
    
    .wallet-transactions-table tbody tr:hover {
        background: #2d3748;
    }
    
    .transaction-id {
        background: #4a5568 !important;
        color: #e2e8f0 !important;
    }
    
    .no-transactions {
        background: #2d3748;
        color: #a0aec0;
        border-color: #4a5568;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .wallet-pin-setup,
    .pin-modal,
    .transaction-filters,
    .pagination-links {
        display: none !important;
    }
    
    .wallet-id-display {
        background: white !important;
        color: black !important;
        border: 2px solid #000;
    }
    
    .wallet-id-text {
        background: #f0f0f0 !important;
        color: black !important;
    }
    
    .wallet-transactions-table {
        border-collapse: collapse;
        width: 100%;
    }
    
    .wallet-transactions-table th,
    .wallet-transactions-table td {
        border: 1px solid #000 !important;
        background: white !important;
        color: black !important;
    }
    
    .transaction-id {
        background: #f0f0f0 !important;
        color: black !important;
    }
}

/* ==========================================================================
   Error States and Validation
   ========================================================================== */

.wallet-error-state {
    padding: 20px;
    background: #fff5f5;
    border: 2px solid #fed7d7;
    border-radius: 8px;
    color: #742a2a;
    text-align: center;
    margin: 20px 0;
}

.wallet-error-state h4 {
    margin: 0 0 10px 0;
    color: #c53030;
}

.wallet-success-state {
    padding: 20px;
    background: #f0fff4;
    border: 2px solid #c6f6d5;
    border-radius: 8px;
    color: #22543d;
    text-align: center;
    margin: 20px 0;
}

.wallet-success-state h4 {
    margin: 0 0 10px 0;
    color: #38a169;
}

.form-validation-message {
    font-size: 14px;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    display: block;
}

.form-validation-message.success {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #c6f6d5;
}

.form-validation-message.error {
    background: #fff5f5;
    color: #742a2a;
    border: 1px solid #fed7d7;
}

.form-validation-message.info {
    background: #ebf8ff;
    color: #2a4365;
    border: 1px solid #bee3f8;
}

/* ==========================================================================
   Custom Scrollbars
   ========================================================================== */

.transactions-table-container::-webkit-scrollbar {
    height: 8px;
}

.transactions-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.transactions-table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.transactions-table-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

.font-bold { font-weight: bold; }
.font-normal { font-weight: normal; }

.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

.select-none { user-select: none; }
.select-all { user-select: all; }

.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* ==========================================================================
   Component Variants
   ========================================================================== */

.wallet-pin-style-minimal .pin-keypad {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
}

.wallet-pin-style-modern .pin-key {
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e2e8f0 100%);
}

.wallet-pin-style-modern .pin-key:hover {
    background: linear-gradient(135deg, #007cba 0%, #0066a3 100%);
    color: white;
}

/* Compact transaction table */
.wallet-transactions-table.compact th,
.wallet-transactions-table.compact td {
    padding: 8px 6px;
    font-size: 12px;
}

.wallet-transactions-table.compact .transaction-id {
    font-size: 10px;
    padding: 2px 6px;
}

/* Enhanced status indicators */
.status-completed::before {
    content: "✓ ";
    color: #28a745;
    font-weight: bold;
}

.status-pending::before {
    content: "⏳ ";
    color: #ffc107;
    font-weight: bold;
}

.status-failed::before,
.status-rejected::before {
    content: "✗ ";
    color: #dc3545;
    font-weight: bold;
}

/* Transaction type icons */
.transaction-type-deposit::before {
    content: "↓ ";
    color: #28a745;
    font-weight: bold;
}

.transaction-type-withdrawal::before {
    content: "↑ ";
    color: #dc3545;
    font-weight: bold;
}

.transaction-type-transfer_sent::before {
    content: "→ ";
    color: #17a2b8;
    font-weight: bold;
}

.transaction-type-transfer_received::before {
    content: "← ";
    color: #17a2b8;
    font-weight: bold;
}

.transaction-type-qr_payment_sent::before,
.transaction-type-qr_payment_received::before {
    content: "📱 ";
    font-weight: bold;
}

/* Focus management for modals */
.pin-modal[aria-hidden="true"] {
    display: none;
}

.pin-modal[aria-hidden="false"] {
    display: flex;
}

.pin-modal-content:focus {
    outline: 3px solid #007cba;
    outline-offset: 2px;
}
/* Enhanced Mobile Responsive Transaction Table */
@media (max-width: 480px) {
    .wallet-transactions-table.mobile-responsive {
        border: 0;
        display: block;
        overflow-x: visible;
        white-space: normal;
    }
    
    .wallet-transactions-table.mobile-responsive thead {
        border: none;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }
    
    .wallet-transactions-table.mobile-responsive tbody,
    .wallet-transactions-table.mobile-responsive th,
    .wallet-transactions-table.mobile-responsive td,
    .wallet-transactions-table.mobile-responsive tr {
        display: block;
        border: none;
    }
    
    .wallet-transactions-table.mobile-responsive tr {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        margin: 0 0 15px 0;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        position: relative;
    }
    
    .wallet-transactions-table.mobile-responsive tr:hover {
        background: #f8f9fa;
        border-color: #007cba;
        box-shadow: 0 4px 8px rgba(0,124,186,0.1);
    }
    
    .wallet-transactions-table.mobile-responsive td {
        border: none !important;
        position: relative;
        padding: 8px 0 !important;
        text-align: left !important;
        white-space: normal;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        min-height: 24px;
    }
    
    .wallet-transactions-table.mobile-responsive td:before {
        content: attr(data-label) ":";
        font-weight: 600;
        color: #4a5568;
        flex-shrink: 0;
        width: 35%;
        padding-right: 10px;
        font-size: 13px;
    }
    
    .wallet-transactions-table.mobile-responsive td:after {
        content: "";
        flex-grow: 1;
    }
    
    .wallet-transactions-table.mobile-responsive .transaction-id {
        background: #e2e8f0 !important;
        color: #4a5568 !important;
        padding: 3px 6px !important;
        border-radius: 4px !important;
        font-size: 11px !important;
        font-family: 'Courier New', monospace;
        display: inline-block;
        margin: 0;
        flex-shrink: 0;
    }
    
    .wallet-transactions-table.mobile-responsive .amount {
        font-weight: 700 !important;
        font-size: 16px !important;
        display: flex !important;
        align-items: center;
        gap: 5px;
        flex-shrink: 0;
    }
    
    .wallet-transactions-table.mobile-responsive .amount.positive {
        color: #16a085 !important;
    }
    
    .wallet-transactions-table.mobile-responsive .amount.negative {
        color: #e74c3c !important;
    }
    
    .wallet-transactions-table.mobile-responsive .transaction-note {
        max-width: none !important;
        word-wrap: break-word;
        font-size: 13px !important;
        line-height: 1.4;
        color: #666;
        flex-grow: 1;
        text-align: right !important;
    }
    
    .wallet-transactions-table.mobile-responsive .transaction-note small {
        display: block;
        font-size: 11px;
        color: #999;
        margin-top: 2px;
    }
}

@media (max-width: 768px) and (min-width: 481px) {
    .wallet-transactions-table th,
    .wallet-transactions-table td {
        padding: 10px 6px;
        font-size: 13px;
    }
    
    .wallet-transactions-table .transaction-note {
        max-width: 150px;
        font-size: 12px !important;
    }
}

/* Enhanced PIN interface for mobile */
.pin-key {
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.pin-key:active,
.pin-key.active {
    transform: scale(0.95);
    background: #007cba !important;
    color: white !important;
}

.pin-hidden-input {
    opacity: 0;
    position: absolute;
    left: -9999px;
    pointer-events: none;
}

.copy-wallet-id {
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.copy-wallet-id.copied {
    background: rgba(40, 167, 69, 0.2) !important;
    color: #28a745 !important;
    border-color: #28a745 !important;
}

.pin-error-message,
.pin-success-message {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Improve touch targets on mobile */
@media (max-width: 768px) {
    .pin-key {
        min-height: 60px;
        font-size: 20px;
    }
    
    .copy-wallet-id {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 16px;
    }
}
/* Enhanced styles for sender name column */
.wallet-transactions-table .counterparty-info {
    font-size: 13px;
    color: #666;
}

.wallet-transactions-table .to-indicator {
    color: #dc3545;
    font-weight: 600;
}

.wallet-transactions-table .from-indicator {
    color: #28a745;
    font-weight: 600;
}

.wallet-transactions-table .no-counterparty {
    color: #999;
    font-style: italic;
}

.wallet-transactions-table .other-party {
    color: #666;
    font-size: 12px;
}

/* Mobile responsive updates for sender column */
@media (max-width: 480px) {
    .wallet-transactions-table.mobile-responsive .counterparty-info:before {
        content: "From/To:";
    }
}

/* PIN setup success/error message styles */
.pin-success-message {
    background: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
    padding: 10px 15px !important;
    border-radius: 5px !important;
    margin-bottom: 15px !important;
    text-align: center !important;
    font-weight: 600 !important;
}

.pin-error-message {
    background: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb !important;
    padding: 10px 15px !important;
    border-radius: 5px !important;
    margin-bottom: 15px !important;
    text-align: center !important;
    font-weight: 600 !important;
}

/* Enhanced PIN keypad active state */
.pin-key.active {
    background: #007cba !important;
    color: white !important;
    transform: scale(0.95) !important;
    transition: all 0.1s ease !important;
}

/* Copy button feedback styles */
.copy-wallet-id.copied {
    background: rgba(40, 167, 69, 0.8) !important;
    color: white !important;
    border-color: #28a745 !important;
    transform: scale(1.05) !important;
}


/* ADD these styles to your wallet.css file for the enhanced PIN setup */

/* Two-step PIN setup styles */
.pin-setup-step {
    transition: all 0.3s ease-in-out;
    opacity: 1;
    transform: translateX(0);
}

.pin-setup-step.sliding-out {
    opacity: 0;
    transform: translateX(-20px);
}

.pin-setup-step.sliding-in {
    opacity: 0;
    transform: translateX(20px);
    animation: slideInFromRight 0.3s ease-out forwards;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Enhanced PIN input container */
.pin-input-container {
    margin-bottom: 30px;
    text-align: center;
}

.pin-input-container label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 20px;
    font-size: 18px;
}

/* Enhanced PIN circles */
.pin-circles {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 20px 0;
}

.pin-circle {
    width: 24px;
    height: 24px;
    border: 3px solid #dee2e6;
    border-radius: 50%;
    background: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.pin-circle.filled {
    background: #007cba;
    border-color: #007cba;
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.pin-circle.filled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
}

/* Enhanced PIN keypad */
.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 280px;
    margin: 0 auto 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.pin-key {
    width: 70px;
    height: 70px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    background: white;
    font-size: 28px;
    font-weight: 700;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.pin-key:hover {
    background: #f8f9fa;
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.pin-key:active,
.pin-key.active {
    background: #007cba !important;
    color: white !important;
    transform: translateY(0) scale(0.95) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pin-key.pin-clear,
.pin-key.pin-backspace {
    font-size: 16px;
    font-weight: 600;
}

/* Enhanced action buttons */
.pin-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
}

.pin-actions .wallet-btn {
    min-width: 140px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.pin-actions .wallet-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.pin-actions .wallet-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Enhanced status messages */
.pin-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 25px;
    border-radius: 10px;
    margin: 20px 0;
    font-weight: 600;
    font-size: 16px;
}

.pin-status.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #28a745;
}

.pin-status .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
}

/* Error and success message animations */
.pin-error-message,
.pin-success-message {
    animation: messageSlideIn 0.3s ease-out;
    text-align: center;
    padding: 15px 25px;
    margin: 15px 0;
    border-radius: 10px;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pin-error-message {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid #dc3545;
}

.pin-success-message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #28a745;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .pin-keypad {
        max-width: 240px;
        gap: 12px;
        padding: 15px;
    }
    
    .pin-key {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .pin-circles {
        gap: 10px;
    }
    
    .pin-circle {
        width: 20px;
        height: 20px;
        border-width: 2px;
    }
    
    .pin-circle.filled::after {
        width: 8px;
        height: 8px;
    }
    
    .pin-actions {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .pin-actions .wallet-btn {
        width: 100%;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .wallet-pin-setup {
        padding: 20px 15px;
        margin: 10px;
    }
    
    .pin-input-container label {
        font-size: 16px;
    }
    
    .pin-keypad {
        max-width: 200px;
        gap: 10px;
        padding: 12px;
    }
    
    .pin-key {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .pin-key.pin-clear,
    .pin-key.pin-backspace {
        font-size: 14px;
    }
}


