/* Frontend Styles for MarkShop Store Wallets */

/* Shortcode Styles */
.wallet-lookup-form {
    max-width: 500px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wallet-lookup-input {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.wallet-lookup-input input[type="text"] {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.wallet-lookup-input input[type="text"]:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.wallet-lookup-input button {
    padding: 12px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.wallet-lookup-input button:hover {
    background: #005a87;
}

.wallet-lookup-input button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Wallet Balance Display */
.wallet-balance-display {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.wallet-code {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.wallet-balance {
    margin-bottom: 15px;
}

.balance-amount {
    font-size: 24px;
    font-weight: bold;
}

.balance-amount.positive {
    color: #00a32a;
}

.balance-amount.negative {
    color: #d63638;
}

.wallet-limit {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

/* Transaction History */
.wallet-transactions {
    margin-top: 20px;
}

.wallet-transactions h4 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 5px;
}

.wallet-transactions-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.wallet-transactions-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.wallet-transactions-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

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

.wallet-transactions-table .positive {
    color: #00a32a;
    font-weight: 600;
}

.wallet-transactions-table .negative {
    color: #d63638;
    font-weight: 600;
}

/* My Wallets Display */
.my-wallets-display {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.my-wallets-display h3 {
    color: #333;
    margin-bottom: 20px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.wallet-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s;
}

.wallet-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.wallet-header .wallet-code {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.wallet-header .balance-amount {
    font-size: 20px;
    font-weight: bold;
}

.wallet-limit {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.wallet-recent-transactions h5 {
    margin: 15px 0 10px 0;
    color: #333;
}

.transaction-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

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

.transaction-date {
    color: #666;
    font-size: 12px;
}

.transaction-amount {
    font-weight: 600;
}

.transaction-amount.positive {
    color: #00a32a;
}

.transaction-amount.negative {
    color: #d63638;
}

.transaction-description {
    flex: 1;
    margin-left: 10px;
    color: #666;
    font-size: 12px;
}

.no-transactions {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Error and Info Messages */
.wallet-error {
    background: #ffebee;
    border-left: 4px solid #d63638;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 4px;
    margin: 15px 0;
}

.wallet-info {
    background: #e3f2fd;
    border-left: 4px solid #1976d2;
    color: #0d47a1;
    padding: 12px 16px;
    border-radius: 4px;
    margin: 15px 0;
}

.wallet-success {
    background: #e8f5e8;
    border-left: 4px solid #4caf50;
    color: #1b5e20;
    padding: 12px 16px;
    border-radius: 4px;
    margin: 15px 0;
}

/* Loading States */
.wallet-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.wallet-loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* WooCommerce Account Integration */
.woocommerce-account .wallet-item {
    margin-bottom: 30px;
}

.woocommerce-account .wallet-header {
    background: #f8f9fa;
    margin: -20px -20px 20px -20px;
    padding: 20px;
    border-radius: 8px 8px 0 0;
}

/* Checkout Form Styles */
.wc-payment-form fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

.wc-payment-form .form-row {
    margin-bottom: 15px;
}

.wc-payment-form label {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.wc-payment-form select,
.wc-payment-form input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.wc-payment-form select:focus,
.wc-payment-form input[type="text"]:focus {
    border-color: #0073aa;
    outline: none;
}

#wallet_balance_info {
    background: #f0f8ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    padding: 15px;
    margin-top: 10px;
}

.wallet-balance-sufficient {
    color: #00a32a;
    font-weight: 600;
}

.wallet-balance-insufficient {
    color: #d63638;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wallet-lookup-input {
        flex-direction: column;
    }
    
    .wallet-lookup-input input[type="text"],
    .wallet-lookup-input button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .wallet-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .wallet-transactions-table {
        font-size: 14px;
    }
    
    .wallet-transactions-table th,
    .wallet-transactions-table td {
        padding: 8px;
    }
    
    .transaction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .transaction-description {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .wallet-transactions-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .balance-amount {
        font-size: 18px !important;
    }
    
    .wallet-code {
        font-size: 14px !important;
        word-break: break-all;
    }
}
