/**
 * Popup Webhook Form Styles
 */

/* Overlay */
.wp-popup-webhook-form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100vh; /* iOS Safari için */
    height: -webkit-fill-available; /* iOS Safari için */
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: wp-popup-fade-in 0.3s ease-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
}

@keyframes wp-popup-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal */
.wp-popup-webhook-form-modal {
    background: #ffffff;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: wp-popup-slide-up 0.3s ease-out;
    -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
    overscroll-behavior: contain; /* Scroll chaining önleme */
}

@keyframes wp-popup-slide-up {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Close Button */
.wp-popup-webhook-form-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: color 0.2s ease;
}

.wp-popup-webhook-form-close:hover {
    color: #000;
}

.wp-popup-webhook-form-close:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Content */
.wp-popup-webhook-form-content {
    padding: 40px 30px 30px;
}

.wp-popup-webhook-form-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.wp-popup-webhook-form-description {
    margin: 0 0 25px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* Form */
.wp-popup-webhook-form-form {
    margin: 0;
}

.wp-popup-webhook-form-field {
    margin-bottom: 20px;
}

.wp-popup-webhook-form-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.wp-popup-webhook-form-field .required {
    color: #d63638;
    margin-left: 3px;
}

.wp-popup-webhook-form-field input[type="text"],
.wp-popup-webhook-form-field input[type="email"],
.wp-popup-webhook-form-field input[type="tel"],
.wp-popup-webhook-form-field input[type="number"],
.wp-popup-webhook-form-field input[type="date"],
.wp-popup-webhook-form-field input[type="url"],
.wp-popup-webhook-form-field textarea,
.wp-popup-webhook-form-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.wp-popup-webhook-form-field input[type="text"]:focus,
.wp-popup-webhook-form-field input[type="email"]:focus,
.wp-popup-webhook-form-field input[type="tel"]:focus,
.wp-popup-webhook-form-field input[type="number"]:focus,
.wp-popup-webhook-form-field input[type="date"]:focus,
.wp-popup-webhook-form-field input[type="url"]:focus,
.wp-popup-webhook-form-field textarea:focus,
.wp-popup-webhook-form-field select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.wp-popup-webhook-form-field textarea {
    resize: vertical;
    min-height: 100px;
}

/* Checkbox Label */
.wp-popup-webhook-form-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal;
}

.wp-popup-webhook-form-checkbox-label input[type="checkbox"] {
    margin: 3px 10px 0 0;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.wp-popup-webhook-form-checkbox-label span {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* Radio Group */
.wp-popup-webhook-form-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wp-popup-webhook-form-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.wp-popup-webhook-form-radio-label input[type="radio"] {
    margin: 0 10px 0 0;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.wp-popup-webhook-form-radio-label span {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* Select - Stil zaten yukarıda tanımlı, sadece özel özellikler */
.wp-popup-webhook-form-field select {
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 35px;
    cursor: pointer;
}

/* Messages */
#wp-popup-webhook-form-messages {
    margin-bottom: 20px;
}

.wp-popup-webhook-form-message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.wp-popup-webhook-form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wp-popup-webhook-form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Actions */
.wp-popup-webhook-form-actions {
    margin-top: 25px;
    text-align: right;
}

.wp-popup-webhook-form-submit {
    background-color: #0073aa;
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 120px;
}

.wp-popup-webhook-form-submit:hover:not(:disabled) {
    background-color: #005a87;
}

.wp-popup-webhook-form-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.wp-popup-webhook-form-submit:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Loading State */
.wp-popup-webhook-form-submit .submit-loading {
    display: inline-block;
}

.wp-popup-webhook-form-submit .submit-text {
    display: inline-block;
}

/* Responsive - Tablet ve Mobil */
@media (max-width: 768px) {
    .wp-popup-webhook-form-overlay {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .wp-popup-webhook-form-modal {
        max-width: 100%;
        max-height: calc(100vh - 20px);
        border-radius: 8px 8px 0 0;
        margin-top: auto;
    }
    
    .wp-popup-webhook-form-content {
        padding: 30px 20px 20px;
    }
    
    .wp-popup-webhook-form-title {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .wp-popup-webhook-form-description {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .wp-popup-webhook-form-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
    
    .wp-popup-webhook-form-field {
        margin-bottom: 18px;
    }
    
    .wp-popup-webhook-form-field input[type="text"],
    .wp-popup-webhook-form-field input[type="email"],
    .wp-popup-webhook-form-field input[type="tel"],
    .wp-popup-webhook-form-field input[type="number"],
    .wp-popup-webhook-form-field input[type="date"],
    .wp-popup-webhook-form-field input[type="url"],
    .wp-popup-webhook-form-field textarea,
    .wp-popup-webhook-form-field select {
        font-size: 16px; /* iOS zoom önleme için */
        padding: 12px;
    }
    
    .wp-popup-webhook-form-submit {
        padding: 14px 24px;
        font-size: 16px;
        min-height: 48px; /* Touch-friendly */
    }
    
    .wp-popup-webhook-form-radio-group {
        gap: 12px;
    }
    
    .wp-popup-webhook-form-radio-label {
        padding: 12px;
        font-size: 14px;
    }
    
    .wp-popup-webhook-form-checkbox-label {
        padding: 12px;
        font-size: 14px;
    }
    
    .wp-popup-webhook-form-checkbox-label input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-right: 10px;
    }
    
    .wp-popup-webhook-form-radio-label input[type="radio"] {
        width: 20px;
        height: 20px;
        margin-right: 10px;
    }
    
    .wp-popup-webhook-form-image {
        margin: 0 -20px 20px -20px;
    }
    
    .wp-popup-webhook-form-actions {
        margin-top: 25px;
    }
}

/* Küçük Mobil Ekranlar */
@media (max-width: 480px) {
    .wp-popup-webhook-form-overlay {
        padding: 10px;
    }
    
    .wp-popup-webhook-form-modal {
        max-height: 95vh;
    }
    
    .wp-popup-webhook-form-content {
        padding: 30px 20px 20px;
    }
    
    .wp-popup-webhook-form-title {
        font-size: 20px;
        padding-right: 30px;
    }
    
    .wp-popup-webhook-form-actions {
        text-align: center;
    }
    
    .wp-popup-webhook-form-submit {
        width: 100%;
    }
}

/* Hide scrollbar on modal but keep functionality */
.wp-popup-webhook-form-modal::-webkit-scrollbar {
    width: 8px;
}

.wp-popup-webhook-form-modal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.wp-popup-webhook-form-modal::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.wp-popup-webhook-form-modal::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Popup Görseli */
.wp-popup-webhook-form-image {
    margin: 0 0 20px 0;
    text-align: center;
    border-radius: 6px;
    overflow: hidden;
}

.wp-popup-webhook-form-image-top {
    margin-bottom: 25px;
}

.wp-popup-webhook-form-image-bottom {
    margin-top: 25px;
    margin-bottom: 0;
}

.wp-popup-webhook-form-image img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wp-popup-image-small {
    max-width: 300px !important;
    margin: 0 auto;
}

.wp-popup-image-medium {
    max-width: 600px !important;
    margin: 0 auto;
}

.wp-popup-image-large {
    max-width: 900px !important;
    margin: 0 auto;
}

.wp-popup-image-full {
    width: 100% !important;
    max-width: 100% !important;
}

/* Honeypot field - tamamen gizli */
#wp-popup-website {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}
