/**
 * WooCommerce 9Pay Gateway Frontend Styles
 *
 * @package WooCommerce_Gateway_9Pay
 * @since 1.0.0
 */

/* 9Pay Payment Method Styles */
.payment_method_9pay {
    position: relative;
}

.payment_method_9pay .payment_box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    margin-top: 10px;
}

.payment_method_9pay .payment_box p {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
}

.payment_method_9pay .payment_box p:last-child {
    margin-bottom: 0;
}

/* 9Pay Payment Methods Radio Buttons */
.ninepay-payment-methods {
    margin-top: 15px;
}

.ninepay-methods-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.ninepay-methods-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ninepay-method-option {
    position: relative;
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    background-color: #fff;
}

.ninepay-method-option:hover {
    background-color: #f9f9f9;
    border-color: #ccc;
}

.ninepay-method-option.selected {
    background-color: #f0f7ff;
    border-color: #4a90e2;
}

.ninepay-method-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
    margin: 0;
}

.ninepay-method-option input[type="radio"] {
    margin-right: 10px;
}

.ninepay-method-info {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
    border-left: 3px solid #4a90e2;
    animation: fadeIn 0.3s ease;
}

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

/* 9Pay Logo/Icon */
.payment_method_9pay label img {
    max-height: 24px;
    margin-left: 10px;
    vertical-align: middle;
}

/* Loading State */
.payment_method_9pay.processing {
    opacity: 0.6;
    pointer-events: none;
}

.payment_method_9pay .blockUI.blockOverlay {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
}

/* Success/Error Messages */
.woocommerce-message.ninepay-success {
    border-left-color: #28a745;
    background-color: #d4edda;
    color: #155724;
}

.woocommerce-error.ninepay-error {
    border-left-color: #dc3545;
    background-color: #f8d7da;
    color: #721c24;
}

/* Currency Conversion Notice */
.wc-ninepay-currency-notice {
    margin: 15px 0;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    animation: slideDown 0.3s ease;
}

.wc-ninepay-currency-notice.woocommerce-info {
    background-color: #d1ecf1;
    border-left: 4px solid #bee5eb;
    color: #0c5460;
}

.wc-ninepay-currency-notice.woocommerce-message {
    background-color: #d4edda;
    border-left: 4px solid #c3e6cb;
    color: #155724;
}

.wc-ninepay-currency-notice.woocommerce-error {
    background-color: #f8d7da;
    border-left: 4px solid #f5c6cb;
    color: #721c24;
}

/* Payment Validation Error */
.wc-ninepay-validation-error {
    margin-top: 10px;
    padding: 10px 12px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    font-size: 13px;
    animation: slideDown 0.3s ease;
}

.wc-9pay-validation-error::before {
    content: "⚠ ";
    font-weight: bold;
    margin-right: 5px;
}

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

/* Blocks-specific styles */
.ninepay-payment-method-content {
    margin-top: 10px;
}

.ninepay-description {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .payment_method_9pay .payment_box {
        padding: 12px;
        font-size: 13px;
    }

    .payment_method_9pay label img {
        max-height: 20px;
        margin-left: 8px;
    }

    .ninepay-methods-container {
        gap: 8px;
    }

    .ninepay-method-option {
        padding: 10px 12px;
        font-size: 14px;
    }

    .ninepay-method-option label {
        font-size: 14px;
    }
}

/* Admin Styles */
.woocommerce_page_wc-settings .payment_method_9pay_settings {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.woocommerce_page_wc-settings .payment_method_9pay_settings h3 {
    margin-top: 0;
    color: #333;
}

.woocommerce_page_wc-settings .payment_method_9pay_settings .form-table th {
    width: 200px;
    padding: 15px 10px 15px 0;
}

.woocommerce_page_wc-settings .payment_method_9pay_settings .form-table td {
    padding: 15px 0;
}

/* Test Mode Notice */
.ninepay-test-mode-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 10px 15px;
    margin: 10px 0;
    color: #856404;
}

.ninepay-test-mode-notice .dashicons {
    color: #f39c12;
    margin-right: 5px;
}

/* Connection Status */
.ninepay-connection-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.ninepay-connection-status.connected {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ninepay-connection-status.disconnected {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ninepay-connection-status.testing {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Fee Preview Styles */
.wc-ninepay-fee-preview {
    margin-top: 12px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    animation: slideDown 0.3s ease;
}

.wc-ninepay-fee-preview strong {
    color: #856404;
    font-weight: 600;
}

.wc-ninepay-fee-preview small {
    color: #6c757d;
    font-size: 11px;
    margin-top: 4px;
    display: block;
}

/* Fee Display in Order Summary */
.woocommerce-checkout-review-order-table .cart-subtotal + tr.fee {
    border-top: 1px solid #e9ecef;
}

.woocommerce-checkout-review-order-table .fee th {
    color: #e74c3c;
    font-weight: 500;
    font-size: 14px;
}

.woocommerce-checkout-review-order-table .fee td {
    color: #e74c3c;
    font-weight: 600;
    font-size: 14px;
}

/* Fee Information in Method Selection */
.ninepay-method-option .fee-info {
    display: block;
    font-size: 11px;
    color: #e74c3c;
    margin-top: 4px;
    font-weight: 500;
}

.ninepay-method-option .fee-info .fee-amount {
    font-weight: 600;
}

/* Enhanced Method Info with Fee */
.wc-ninepay-method-info .fee-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
}

.wc-ninepay-method-info .fee-section .fee-label {
    font-weight: 600;
    color: #e74c3c;
    font-size: 12px;
}

.wc-ninepay-method-info .fee-section .fee-details {
    font-size: 11px;
    color: #6c757d;
    margin-top: 2px;
}

/* Blocks Fee Preview */
.wp-block-woocommerce-checkout .wc-ninepay-fee-preview {
    margin: 12px 0;
}

/* Blocks Method Options Styling */
.wp-block-woocommerce-checkout .ninepay-method-option {
    margin-bottom: 12px !important;
    padding: 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background: #f9f9f9 !important;
}

.wp-block-woocommerce-checkout .ninepay-method-option.selected {
    border-color: #007cba !important;
    background: #f0f8ff !important;
}

.wp-block-woocommerce-checkout .ninepay-method-option .fee-info {
    color: #e74c3c !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

/* Mobile Responsive Fee Styles */
@media (max-width: 768px) {
    .wc-ninepay-fee-preview {
        padding: 10px 12px;
        font-size: 12px;
    }

    .wc-ninepay-fee-preview small {
        font-size: 10px;
    }

    .ninepay-method-option .fee-info {
        font-size: 10px;
    }

    .woocommerce-checkout-review-order-table .fee th,
    .woocommerce-checkout-review-order-table .fee td {
        font-size: 13px;
    }
}
