/**
 * Helcim Payment Integration for Gravity Forms
 * Styles
 * 
 * @version 1.0.0
 * @author Ram Singh
 */

/* Payment Section Container */
.helcim-payment-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.helcim-payment-container {
    min-height: 50px;
}

/* Payment Status Messages */
.helcim-payment-status {
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
    background: #fff;
    border-left: 4px solid #46b450;
}

.helcim-payment-status.error {
    border-left-color: #dc3232;
    background: #ffebeb;
}

.helcim-payment-status.warning {
    border-left-color: #f0ad4e;
    background: #fff8e5;
}

.helcim-status-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Loading Indicator */
.helcim-payment-loading {
    text-align: center;
    padding: 30px 20px;
}

.helcim-payment-loading p {
    margin: 15px 0 0 0;
    font-size: 14px;
    color: #666;
}

/* Spinner Animation */
.helcim-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: helcim-spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Payment Button Styles */
.gform_wrapper .helcim-pay-button {
    background: #0073aa;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.gform_wrapper .helcim-pay-button:hover {
    background: #005177;
}

.gform_wrapper .helcim-pay-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* HelcimPay.js Modal Overrides */
#helcim-pay-js-modal {
    z-index: 999999 !important;
}

#helcim-pay-js-overlay {
    z-index: 999998 !important;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .helcim-payment-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .helcim-payment-loading {
        padding: 20px 15px;
    }
    
    .helcim-spinner {
        width: 30px;
        height: 30px;
    }
}

/* Gravity Forms Integration */
.gform_wrapper .helcim-payment-section {
    clear: both;
}

.gform_wrapper .gform_footer {
    clear: both;
    padding-top: 20px;
}

/* Success/Error States */
.helcim-payment-success {
    border-color: #46b450;
    background: #ecf7ed;
}

.helcim-payment-error {
    border-color: #dc3232;
    background: #ffebeb;
}

.helcim-payment-warning {
    border-color: #f0ad4e;
    background: #fff8e5;
}

/* Payment Information Display */
.helcim-payment-info {
    padding: 15px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    margin: 15px 0;
}

.helcim-payment-info h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.helcim-payment-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.helcim-payment-info strong {
    color: #333;
}

/* Hidden Elements */
.helcim-hidden {
    display: none !important;
}

/* Loading State for Submit Button */
.gform_wrapper .gform_button.helcim-processing {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.gform_wrapper .gform_button.helcim-processing:after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: helcim-spin 0.8s linear infinite;
}
