/* Custom Payment Gateway Frontend Styles */

/* Payment form styles */
#custom-payment-gateway-cc-form {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin: 15px 0;
}

#custom-payment-gateway-cc-form .form-row {
    margin-bottom: 15px;
}

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

#custom-payment-gateway-cc-form input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

#custom-payment-gateway-cc-form input[type="text"]:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 124, 186, 0.3);
}

#custom-payment-gateway-cc-form .required {
    color: #d63638;
}

/* Payment method selection styles */
#custom-payment-methods {
    margin: 15px 0;
}

#custom-payment-methods h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.payment-method-option {
    display: block;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    position: relative;
}

.payment-method-option:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.1);
}

.payment-method-option input[type="radio"] {
    position: absolute;
    top: 10px;
    right: 10px;
    margin: 0;
}

.payment-method-option input[type="radio"]:checked + .payment-method-content {
    color: #007cba;
}

.payment-method-option input[type="radio"]:checked {
    accent-color: #007cba;
}

.payment-method-content {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}

.payment-method-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
}

.payment-method-title {
    font-weight: 600;
    font-size: 14px;
}

/* Card input formatting */
#custom_payment_gateway_card_number {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

#custom_payment_gateway_card_expiry {
    font-family: 'Courier New', monospace;
}

#custom_payment_gateway_card_cvc {
    font-family: 'Courier New', monospace;
}

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

.custom-payment-gateway-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error states */
.payment-method-error {
    border-color: #d63638 !important;
    background-color: #fcf2f2;
}

.payment-method-error input {
    border-color: #d63638;
}

/* Success states */
.payment-method-success {
    border-color: #00a32a !important;
    background-color: #f6fff6;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .payment-methods-grid {
        grid-template-columns: 1fr;
    }

    #custom-payment-gateway-cc-form .form-row-first,
    #custom-payment-gateway-cc-form .form-row-last {
        width: 100%;
        float: none;
        margin-right: 0;
    }

    .payment-method-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .payment-method-icon {
        width: 60px;
        height: 60px;
    }
}

/* Focus management for accessibility */
.payment-method-option:focus-within {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .payment-method-option {
        border-color: #000;
    }

    .payment-method-option:hover,
    .payment-method-option:focus-within {
        border-color: #0073aa;
        background-color: #f0f8ff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .payment-method-option,
    #custom-payment-gateway-cc-form input[type="text"] {
        transition: none;
    }

    .custom-payment-gateway-loading::after {
        animation: none;
    }
}

/* Print styles */
@media print {
    #custom-payment-gateway-cc-form,
    #custom-payment-methods {
        border: 1px solid #000;
        background: white !important;
    }

    .payment-method-option {
        border: 1px solid #000;
        break-inside: avoid;
    }
}