/**
 * QR Payment Gateway Frontend Styles
 */

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* QR Code Display */
.qr-code-container {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background-color: #fafafa;
    transition: border-color 0.3s ease;
}

.qr-code-container:hover {
    border-color: #0073aa;
}

.qr-code-container img {
    cursor: pointer !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    user-select: none;
}

.qr-code-container img:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

.qr-code-container img:after {
    content: "📱 Click to enlarge";
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #666;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.qr-code-container:hover img:after {
    opacity: 1;
}

/* Payment Proof Upload */
.payment-proof-upload {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.payment-proof-upload p {
    margin-bottom: 10px;
}

.payment-proof-upload strong {
    color: #333;
}

.payment-proof-upload input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ccc;
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.payment-proof-upload input[type="file"]:hover {
    border-color: #0073aa;
}

.payment-proof-upload.drag-over input[type="file"] {
    border-color: #0073aa;
    background-color: #f0f8ff;
}

.payment-proof-upload small {
    color: #666;
    font-size: 12px;
    display: block;
    margin-top: 5px;
}

/* File Preview */
#payment_proof_preview {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #f9f9f9;
}

#payment_proof_preview img {
    border: 1px solid #ccc;
    border-radius: 3px;
}

/* Error Messages */
.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* QR Payment Fields */
.qr-payment-field {
    display: none;
}

/* QR Modal */
.qr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    display: none;
    backdrop-filter: blur(5px);
}

.qr-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 15px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.qr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.qr-modal-header h3 {
    margin: 0;
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.qr-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 24px;
    cursor: pointer;
    color: white;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.qr-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

.qr-modal-body {
    padding: 30px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}

.qr-modal-body img {
    max-width: 100%;
    height: auto;
    border: 3px solid #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    background: white;
    padding: 15px;
}

.qr-modal-body p {
    margin-top: 20px;
    color: #555;
    font-size: 16px;
    line-height: 1.6;
}

.qr-modal-body .payment-instructions {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.qr-modal-body .step-indicator {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.qr-modal-body .step {
    background: #667eea;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Payment Proof Status */
.qr-payment-proof-status {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
}

.qr-payment-proof-status h3 {
    margin-top: 0;
    color: #333;
    font-size: 18px;
}

.status-info p {
    margin: 10px 0;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Admin Notes */
.admin-notes {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 10px;
    margin: 10px 0;
}

.admin-notes strong {
    color: #333;
}

/* Resubmit Section */
.resubmit-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 15px;
    margin: 15px 0;
}

.resubmit-section h4 {
    margin-top: 0;
    color: #333;
    font-size: 16px;
}

.resubmit-section input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
}

.resubmit-section textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    resize: vertical;
    font-family: inherit;
}

.resubmit-section button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.resubmit-section button:hover {
    background: #005a87;
}

.resubmit-section button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Copy Payment Details Button */
.copy-payment-details {
    background: #28a745;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    transition: background-color 0.3s ease;
}

.copy-payment-details:hover {
    background: #218838;
}

/* Responsive Design */
@media (max-width: 768px) {
    .qr-code-container {
        margin: 15px 0;
        padding: 15px;
    }
    
    .qr-code-container img {
        max-width: 200px;
    }
    
    .payment-proof-upload {
        margin: 15px 0;
        padding: 15px;
    }
    
    .qr-modal {
        max-width: 95%;
        max-height: 95%;
        margin: 20px;
    }
    
    .qr-modal-header {
        padding: 20px 15px;
    }
    
    .qr-modal-header h3 {
        font-size: 18px;
    }
    
    .qr-modal-body {
        padding: 20px 15px;
    }
    
    .qr-modal-body img {
        max-width: 100%;
        padding: 10px;
    }
    
    .qr-payment-proof-status {
        padding: 15px;
    }
    
    .resubmit-section {
        padding: 12px;
    }
    
    .step-indicator {
        gap: 10px !important;
    }
    
    .step {
        font-size: 10px !important;
        padding: 6px 10px !important;
    }
}

@media (max-width: 480px) {
    .qr-code-container img {
        max-width: 180px;
    }
    
    .qr-modal-header h3 {
        font-size: 16px;
    }
    
    .qr-modal-close {
        font-size: 20px;
        width: 35px;
        height: 35px;
    }
    
    #payment_proof_preview {
        padding: 8px;
    }
    
    #payment_proof_preview img {
        max-width: 80px;
    }
    
    .qr-modal-body .payment-instructions {
        padding: 15px;
    }
    
    .qr-modal-body p {
        font-size: 14px;
    }
    
    .step {
        font-size: 9px !important;
        padding: 5px 8px !important;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.qr-modal {
    animation: slideIn 0.3s ease-out;
}

.qr-modal-overlay {
    animation: fadeIn 0.3s ease-out;
}

/* Loading Spinner */
.loading-spinner {
    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: 5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Notices */
.woocommerce-message,
.woocommerce-error {
    margin: 15px 0;
    padding: 10px 15px;
    border-radius: 3px;
}

.woocommerce-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.woocommerce-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}
