/**
 * JioPay Frontend Styles
 */

/* Payment method styles */
.wc_payment_method.payment_method_jiopay {
    margin-bottom: 20px;
}

.wc_payment_method.payment_method_jiopay label {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    padding: 10px 0;
}

.wc_payment_method.payment_method_jiopay label img {
    margin-right: 10px;
    max-height: 24px;
    width: auto;
}

/* Payment form styles */
.jiopay-payment-form {
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 15px;
}

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

.jiopay-payment-form .form-row:last-child {
    margin-bottom: 0;
}

.jiopay-payment-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.jiopay-payment-form .required {
    color: #dc3232;
}

.jiopay-payment-form .input-text {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.jiopay-payment-form .input-text:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.jiopay-payment-form .input-text:invalid {
    border-color: #dc3232;
}

.jiopay-payment-form .input-text:invalid:focus {
    box-shadow: 0 0 0 2px rgba(220, 50, 50, 0.2);
}

/* Test mode notice */
.jiopay-test-mode {
    background: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.jiopay-test-mode::before {
    content: "⚠️ ";
    margin-right: 5px;
}

/* Payment description */
.payment_box.payment_method_jiopay .jiopay-description {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Loading states */
.jiopay-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.jiopay-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ccc;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: jiopay-spin 1s linear infinite;
}

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

/* Error messages */
.jiopay-error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.jiopay-error::before {
    content: "❌ ";
    margin-right: 5px;
}

/* Success messages */
.jiopay-success {
    background: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.jiopay-success::before {
    content: "✅ ";
    margin-right: 5px;
}

/* Payment icons */
.jiopay-payment-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.jiopay-payment-icons img {
    height: 24px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.jiopay-payment-icons img:hover {
    opacity: 1;
}

/* Custom payment icon styles */
.jiopay-payment-icon {
    max-height: 24px;
    max-width: 100px;
    height: auto;
    width: auto;
    margin-left: 10px;
    vertical-align: middle;
    display: inline-block;
}

/* Payment method with icon */
.wc_payment_method.payment_method_jiopay label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.wc_payment_method.payment_method_jiopay label .jiopay-payment-icon {
    margin-left: auto;
    margin-right: 0;
}

/* Icon in payment method list */
.woocommerce .wc_payment_methods .payment_method_jiopay label::after {
    content: '';
    flex-grow: 1;
}

.woocommerce .wc_payment_methods .payment_method_jiopay .jiopay-payment-icon {
    margin-left: auto;
    margin-right: 0;
    max-height: 20px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.woocommerce .wc_payment_methods .payment_method_jiopay:hover .jiopay-payment-icon {
    opacity: 1;
}

/* Responsive styles */
@media (max-width: 768px) {
    .jiopay-payment-form {
        padding: 15px;
    }
    
    .jiopay-payment-form .form-row {
        margin-bottom: 12px;
    }
    
    .jiopay-payment-form .input-text {
        padding: 8px 10px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .jiopay-payment-icons {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .jiopay-payment-icons img {
        height: 20px;
    }
}

/* Checkout page specific styles */
.woocommerce-checkout .jiopay-payment-form {
    background: #fff;
    border: none;
    padding: 15px 0;
}

.woocommerce-checkout .jiopay-payment-form .form-row {
    margin-bottom: 20px;
}

.woocommerce-checkout .jiopay-payment-form .input-text {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.woocommerce-checkout .jiopay-payment-form .input-text:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Payment method selection */
.woocommerce-checkout .wc_payment_methods .wc_payment_method {
    border-bottom: 1px solid #eee;
}

.woocommerce-checkout .wc_payment_methods .wc_payment_method:last-child {
    border-bottom: none;
}

.woocommerce-checkout .wc_payment_methods .wc_payment_method label {
    padding: 15px 0;
    font-size: 16px;
}

.woocommerce-checkout .wc_payment_methods .wc_payment_method input[type="radio"] {
    margin-right: 10px;
}

/* Payment box animation */
.payment_box.payment_method_jiopay {
    animation: jiopay-slide-down 0.3s ease-out;
}

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

/* Order received page */
.woocommerce-order-received .jiopay-payment-summary {
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 20px 0;
}

.woocommerce-order-received .jiopay-payment-summary h3 {
    margin-top: 0;
    color: #333;
}

.woocommerce-order-received .jiopay-payment-summary .jiopay-transaction-id {
    font-family: monospace;
    background: #e9ecef;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

/* Security badges */
.jiopay-security-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.jiopay-security-badges .badge {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
}

.jiopay-security-badges .badge::before {
    content: "🔒";
    margin-right: 5px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .jiopay-payment-form {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .jiopay-payment-form label {
        color: #e2e8f0;
    }
    
    .jiopay-payment-form .input-text {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .jiopay-payment-form .input-text:focus {
        border-color: #63b3ed;
        box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.2);
    }
    
    .jiopay-test-mode {
        background: #2d3748;
        color: #fbb6ce;
        border-color: #4a5568;
    }
} 