/* Frontend Styles for Bank Card Payment Plugin */

/* Bank Account Display on Checkout */
.woo-pay-cash-bank-accounts {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    position: relative;
    overflow: visible;
}

/* Receipt Upload Styles */
.woo-pay-cash-receipt-upload {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.woo-pay-cash-receipt-upload h4 {
    margin-top: 0;
    color: #0073aa;
    font-size: 18px;
}

.required-notice {
    color: #d94f4f;
    font-weight: bold;
    margin: 10px 0;
}

/* File Upload Container */
.receipt-upload-container {
    margin: 15px 0;
}

.receipt-upload-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.receipt-upload-container input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background: #fafafa;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.receipt-upload-container input[type="file"]:hover {
    border-color: #0073aa;
    background: #f0f6fc;
}

.receipt-upload-container input[type="file"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Upload Progress */
.upload-progress {
    margin: 15px 0;
    padding: 15px;
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #005a87);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    color: #0073aa;
    font-weight: bold;
    margin: 0;
}

/* Upload Result */
.upload-result {
    margin: 15px 0;
    padding: 15px;
    border-radius: 4px;
}

.upload-result.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.upload-result.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.upload-note {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 12px;
    font-style: italic;
}

/* Thank You Page Receipt Display */
.uploaded-receipt-display {
    margin: 20px 0;
    padding: 20px;
    background: #f0f8ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
}

.uploaded-receipt-display h3 {
    margin-top: 0;
    color: #0073aa;
}

.receipt-preview {
    margin: 15px 0;
    text-align: center;
}

.receipt-preview img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Upload Methods Tabs */
.upload-methods-tabs {
    margin-bottom: 20px;
}

.upload-tabs {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #ddd;
}

.upload-tabs .tab-item {
    padding: 12px 20px;
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-bottom: none;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-right: 5px;
    border-radius: 4px 4px 0 0;
}

.upload-tabs .tab-item:hover {
    background: #e9e9e9;
}

.upload-tabs .tab-item.active {
    background: #fff;
    border-bottom: 1px solid #fff;
    position: relative;
    z-index: 1;
}

.upload-methods-content {
    position: relative;
    z-index: 0;
}

.upload-method-content {
    display: none;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 4px 4px 4px;
}

.upload-method-content.active {
    display: block;
}

/* Upload section styles */
.upload-section {
    margin-bottom: 20px;
}

.upload-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.upload-section input[type="file"],
.upload-section input[type="url"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.file-requirements {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Upload progress */
.receipt-upload-progress {
    margin: 15px 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background-color: #4caf50;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    margin: 0;
    text-align: center;
    color: #666;
}

/* Upload messages */
.upload-message {
    padding: 12px;
    border-radius: 4px;
    margin: 15px 0;
    text-align: center;
    font-weight: bold;
}

.upload-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.upload-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Email upload styles */
.email-instructions {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.email-instructions h4 {
    margin-top: 0;
    color: #333;
}

.email-info {
    margin: 15px 0;
    padding: 15px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.copy-email-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.copy-email-btn:hover {
    background: #005a87;
}

/* Base64 preview */
#base64-preview {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    text-align: center;
}

#base64-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Debug info styles */
.debug-info {
    background: #f0f0f0;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid #ddd;
}

.debug-info strong {
    color: #333;
}

/* Responsive design */
@media (max-width: 768px) {
    .upload-tabs {
        flex-direction: column;
    }
    
    .upload-tabs .tab-item {
        margin-right: 0;
        margin-bottom: 5px;
        border-radius: 4px;
    }
    
    .upload-method-content {
        border-radius: 4px;
    }
    
    .upload-section input[type="file"],
    .upload-section input[type="url"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Order Total Section */
.woo-pay-cash-order-total-section {
    margin: 20px 0;
    padding: 15px;
    background: #e8f5e8;
    border: 2px solid #4caf50;
    border-radius: 8px;
}

.woo-pay-cash-order-total-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2e7d32;
    font-size: 18px;
    font-weight: bold;
}

.order-total-display {
    margin-bottom: 10px;
}

.amount-box, .rial-amount-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 8px;
}

.amount-label, .rial-label {
    font-weight: bold;
    color: #333;
    min-width: 120px;
}

.amount-value, .rial-value {
    font-size: 18px;
    font-weight: bold;
    color: #2e7d32;
    flex: 1;
}

.copy-amount-btn, .copy-rial-btn {
    background: #4caf50;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.copy-amount-btn:hover, .copy-rial-btn:hover {
    background: #45a049;
}

.copy-icon {
    margin-right: 5px;
}

.currency-conversion {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ccc;
}

.rial-amount-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-top: 10px;
}

.rial-label {
    font-weight: bold;
    color: #6c757d;
    min-width: 120px;
}

.rial-amount {
    font-size: 16px;
    font-weight: bold;
    color: #495057;
    flex: 1;
}

.copy-rial-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.copy-rial-btn:hover {
    background: #5a6268;
}

.woo-pay-cash-bank-accounts h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.bank-account-selector {
    margin-bottom: 20px;
}

.bank-account-selector select {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.woo-pay-cash-bank-details {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.woo-pay-cash-bank-details th,
.woo-pay-cash-bank-details td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.woo-pay-cash-bank-details th {
    background: #f5f5f5;
    font-weight: bold;
    width: 30%;
}

.woo-pay-cash-bank-details .card-number {
    font-family: monospace;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    background: #fff;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: inline-block;
    margin-right: 10px;
}

.copy-card-number {
    background: #0073aa;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.copy-card-number:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

/* Receipt Upload Section */
.woo-pay-cash-receipt-upload {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.woo-pay-cash-receipt-upload h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.receipt-upload-field {
    margin-bottom: 15px;
}

.receipt-upload-field input[type="file"] {
    width: 100%;
    max-width: 400px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.receipt-upload-progress {
    margin-top: 10px;
    width: 100%;
    max-width: 400px;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.receipt-upload-progress .progress-bar {
    height: 100%;
    background: #0073aa;
    width: 0%;
    transition: width 0.3s ease;
}

.receipt-upload-progress .progress-fill {
    height: 100%;
    background: #0073aa;
    width: 0%;
    transition: width 0.3s ease;
}

.upload-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.upload-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.upload-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.receipt-upload-requirements {
    font-size: 12px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* Thank You Page Receipt Upload */
.woo-pay-cash-receipt-upload-form {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.woo-pay-cash-receipt-upload-form h3 {
    margin-top: 0;
    color: #333;
}

.woo-pay-cash-receipt-upload-form form {
    max-width: 500px;
}

.woo-pay-cash-receipt-upload-form input[type="file"] {
    width: 100%;
    margin-bottom: 15px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.woo-pay-cash-receipt-upload-form .button {
    background: #0073aa;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.woo-pay-cash-receipt-upload-form .button:hover {
    background: #005a87;
}

.woo-pay-cash-receipt-upload-form .button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.upload-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
}

.upload-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.upload-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Receipt Details Display */
.woo-pay-cash-receipt-details {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.woo-pay-cash-receipt-details h3 {
    margin-top: 0;
    color: #333;
}

.woo-pay-cash-receipt-details .receipt-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}

.woo-pay-cash-receipt-details .receipt-file {
    margin-bottom: 15px;
}

.woo-pay-cash-receipt-details .receipt-file a {
    color: #0073aa;
    text-decoration: none;
}

.woo-pay-cash-receipt-details .receipt-file a:hover {
    text-decoration: underline;
}

/* Copy Animation */
.copy-success {
    color: #46b450;
    font-weight: bold;
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Loading States */
.woo-pay-cash-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Receipt Upload in Checkout */
.woo-pay-cash-receipt-upload-checkout {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.woo-pay-cash-receipt-upload-checkout h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #495057;
    font-size: 14px;
}

.woo-pay-cash-receipt-upload-checkout p {
    margin-bottom: 15px;
    color: #6c757d;
    font-size: 13px;
}

.woo-pay-cash-receipt-upload-checkout .receipt-upload-field {
    margin-bottom: 10px;
}

.woo-pay-cash-receipt-upload-checkout input[type="file"] {
    width: 100%;
    max-width: 400px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.woo-pay-cash-receipt-upload-checkout .receipt-upload-requirements {
    margin: 0;
    color: #868e96;
    font-size: 12px;
    font-style: italic;
}

.woo-pay-cash-receipt-upload-checkout .upload-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.woo-pay-cash-receipt-upload-checkout .upload-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.woo-pay-cash-receipt-upload-checkout .upload-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .woo-pay-cash-bank-details th,
    .woo-pay-cash-bank-details td {
        padding: 8px;
        font-size: 14px;
    }
    
    .woo-pay-cash-bank-details th {
        width: 40%;
    }
    
    .woo-pay-cash-bank-details .card-number {
        font-size: 14px;
        padding: 6px 10px;
    }
    
    .woo-pay-cash-receipt-upload,
    .woo-pay-cash-receipt-upload-form,
    .woo-pay-cash-receipt-details {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .woo-pay-cash-bank-details {
        font-size: 12px;
    }
    
    .woo-pay-cash-bank-details .card-number {
        font-size: 12px;
        padding: 4px 8px;
        display: block;
        margin-bottom: 5px;
    }
    
    .copy-card-number {
        font-size: 11px;
    }
}
