/**
 * İyzico Frontend CSS
 * 
 * @package Iyzico_WooCommerce
 */

/* Ödeme Formu Container */
.iyzico-payment-form {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Form Satırları */
.iyzico-payment-form .form-row {
    margin-bottom: 15px;
}

.iyzico-payment-form .form-row-wide {
    width: 100%;
}

/* Form Row Düzeni - Yan Yana Alanlar */
.iyzico-payment-form .form-row-first {
    float: left;
    width: 48%;
    margin-right: 2%;
}

.iyzico-payment-form .form-row-second {
    float: left;
    width: 48%;
    margin-left: 2%;
}

.iyzico-payment-form .form-row-last {
    float: left;
    width: 48%;
    margin-right: 2%;
}

/* Clearfix */
.iyzico-payment-form .form-row:after {
    content: "";
    display: table;
    clear: both;
}

/* Responsive Tasarım */
@media (max-width: 768px) {
    .iyzico-payment-form .form-row-first,
    .iyzico-payment-form .form-row-second,
    .iyzico-payment-form .form-row-last {
        float: none;
        width: 100%;
        margin: 0 0 15px 0;
    }
}

.iyzico-payment-form .form-row:after {
    content: "";
    display: table;
    clear: both;
}

/* Label Stilleri */
.iyzico-payment-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.iyzico-payment-form label .required {
    color: #e2401c;
}

/* Input Stilleri */
.iyzico-payment-form input[type="text"],
.iyzico-payment-form select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.iyzico-payment-form input[type="text"]:focus,
.iyzico-payment-form select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

/* Kart Input Wrapper */
.card-input-wrapper {
    position: relative;
}

.card-input-wrapper .input-text {
    padding-right: 120px; /* Kart ikonları için yer bırak */
}

/* Kart İkonları */
.card-icons {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 6px;
    align-items: center;
}

.card-icon {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    border-radius: 3px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
    color: #333;
    background: #f0f0f0;
    border: 1px solid #ddd;
}

.visa-icon {
    color: #1a1f71;
    background: #f8f9fa;
}

.mastercard-icon {
    color: #eb001b;
    background: #f8f9fa;
}

.amex-icon {
    color: #006fcf;
    background: #f8f9fa;
}

.card-icon.active {
    opacity: 1;
    box-shadow: 0 0 0 1px var(--em-color__primary, #DB1215);
}

/* CVC Input */
.cvc-input {
    width: 100% !important;
    text-align: center;
}

/* Taksit Display */
.installment-display {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
    color: #666;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
    line-height: 1.4;
}

/* CVC Yardım Metni */
.cvc-help {
    display: block;
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    text-align: center;
    line-height: 1.3;
}

/* Taksit Hesaplama */
.installment-calc {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.installment-details h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.installment-summary {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.installment-summary span {
    font-size: 14px;
    color: #555;
}

.installment-amount {
    font-weight: 600;
    color: #007cba !important;
}

.installment-total {
    font-weight: 600;
    color: #28a745 !important;
    font-size: 16px !important;
}

/* Güvenlik Bilgisi */
.security-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #e8f5e8;
    border: 1px solid #c3e6c3;
    border-radius: 6px;
    padding: 12px;
    margin: 15px 0;
}

.security-icon {
    font-size: 20px;
}

.security-text {
    font-size: 13px;
    color: #2d5a2d;
    font-weight: 500;
}

/* Hata Mesajları */
.error-messages {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 12px;
    margin: 15px 0;
    color: #721c24;
}

.error-messages ul {
    margin: 0;
    padding-left: 20px;
}

.error-messages li {
    margin-bottom: 5px;
}

/* Yükleniyor Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

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

/* Test Kartları kısmı kaldırıldı */

/* 3DS Container */
.iyzico-3ds-container {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
}

.iyzico-3ds-header {
    background: #007cba;
    color: white;
    padding: 20px;
    text-align: center;
}

.iyzico-3ds-header h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.iyzico-3ds-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.iyzico-3ds-content {
    padding: 20px;
    min-height: 300px;
}

.iyzico-3ds-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.iyzico-3ds-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.iyzico-3ds-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive Tasarım */
@media (max-width: 768px) {
    .iyzico-payment-form .form-row-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .iyzico-payment-form .form-row-first,
    .iyzico-payment-form .form-row-second,
    .iyzico-payment-form .form-row-last {
        flex: none;
        width: 100%;
    }
    
    .iyzico-payment-form {
        padding: 15px;
    }
    
    .card-input-wrapper .input-text {
        padding-right: 100px;
    }
    
    .card-icons {
        right: 8px;
        gap: 4px;
    }
    
    .card-icon {
        width: 24px;
        height: 16px;
    }
    
    .cvc-input {
        text-align: left;
    }
    
    .cvc-help {
        text-align: left;
        font-size: 10px;
    }
    
    .debug-section {
        max-height: 200px;
    }
}

/* Ecomus Tema Uyumluluğu */
.woocommerce-checkout .iyzico-payment-form {
    border-color: var(--em-border-color, #EBEBEB);
}

.iyzico-payment-form input[type="text"]:focus,
.iyzico-payment-form select:focus {
    border-color: var(--em-color__primary, #DB1215);
    box-shadow: 0 0 0 1px var(--em-color__primary, #DB1215);
}

.installment-amount {
    color: var(--em-color__primary, #DB1215) !important;
}

.loading-spinner {
    border-top-color: var(--em-color__primary, #DB1215);
}

.iyzico-3ds-header {
    background: var(--em-color__primary, #DB1215);
}

/* Debug Bölümü */
.debug-section {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    max-height: 300px;
    overflow-y: auto;
}

.debug-section h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

#iyzico-debug-content {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
}

.debug-item {
    margin-bottom: 5px;
    padding: 3px 0;
}

.debug-time {
    color: #6c757d;
    font-weight: bold;
}

.debug-text {
    color: #212529;
}

.debug-item.success .debug-text {
    color: #28a745;
}

.debug-item.error .debug-text {
    color: #dc3545;
}

.debug-item.info .debug-text {
    color: #17a2b8;
}

.debug-item.warning .debug-text {
    color: #ffc107;
}

/* Test kartları CSS'i kaldırıldı */
