/**
 * GiveWP Iyzico Gateway Frontend Styles
 */

/* Iyzico Fields */
.give-iyzico-fields {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

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

.give-iyzico-test-notice p {
    margin: 0;
    font-size: 14px;
}

.give-iyzico-test-notice strong {
    color: #b45309;
}

/* Loading Indicator */
.give-iyzico-loading {
    display: inline-block;
    margin-left: 10px;
    padding: 5px 10px;
    background-color: #f0f0f0;
    border-radius: 3px;
    font-size: 14px;
    color: #666;
}

.give-iyzico-loading:before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid #ddd;
    border-left-color: #666;
    border-radius: 50%;
    animation: give-iyzico-spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes give-iyzico-spin {
    to { transform: rotate(360deg); }
}

/* Popup Styles */
.give-iyzico-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: none;
}

.give-iyzico-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    min-width: 600px;
}

.give-iyzico-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.give-iyzico-popup-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.give-iyzico-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.give-iyzico-popup-close:hover {
    background-color: #e9ecef;
    color: #333;
}

.give-iyzico-popup-content {
    padding: 20px;
    min-height: 400px;
}

/* Prevent body scrolling when popup is open */
body.give-iyzico-popup-open {
    overflow: hidden;
}

/* Error Messages */
.give-iyzico-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.give-iyzico-error p {
    margin: 0;
}

/* Success Messages */
.give-iyzico-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.give-iyzico-success p {
    margin: 0;
}

/* Gateway Selection */
.give-gateway-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 15px;
    border: 2px solid #e5e5e5;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

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

.give-gateway-option:hover label {
    border-color: #007cba;
    background-color: #f8f9fa;
}

.give-gateway-option-selected label {
    border-color: #007cba;
    background-color: #e7f3ff;
}

/* Iyzico Logo */
.give-gateway-option[data-gateway="iyzico"] label:after {
    content: "";
    display: inline-block;
    width: 60px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 60"><text x="10" y="35" font-family="Arial, sans-serif" font-size="28" font-weight="bold" fill="%23007cba">iyzico</text></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    margin-left: auto;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .give-iyzico-popup {
        min-width: auto;
        width: 95%;
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .give-iyzico-popup-header {
        padding: 15px;
    }
    
    .give-iyzico-popup-content {
        padding: 15px;
        min-height: 300px;
    }
    
    .give-iyzico-test-notice {
        padding: 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .give-gateway-option[data-gateway="iyzico"] label:after {
        display: none;
    }
    
    .give-iyzico-popup {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        margin: 0;
        border-radius: 0;
    }
    
    .give-iyzico-popup-header {
        border-radius: 0;
    }
}

/* Form Field Errors */
.give-form input.give-error,
.give-form select.give-error,
.give-form textarea.give-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Disabled State */
.give-form input[type="submit"]:disabled,
.give-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Custom Iyzico Button Styling */
.give-btn[data-gateway="iyzico"] {
    background-color: #007cba;
    border-color: #007cba;
    color: #fff;
}

.give-btn[data-gateway="iyzico"]:hover {
    background-color: #005a87;
    border-color: #005a87;
}

/* Payment Icons */
.give-iyzico-payment-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 0;
}

.give-iyzico-payment-icons img {
    height: 24px;
    width: auto;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 2px;
}

/* Security Badge */
.give-iyzico-security {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
    margin-top: 10px;
}

.give-iyzico-security:before {
    content: "🔒";
    margin-right: 5px;
    font-size: 14px;
}

/* Processing Animation */
.give-iyzico-processing {
    text-align: center;
    padding: 40px 20px;
}

.give-iyzico-processing-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: give-iyzico-spin 1s linear infinite;
    margin: 0 auto 20px;
}

.give-iyzico-processing-text {
    font-size: 16px;
    color: #666;
    margin: 0;
}
