/**
 * Public styles for Contact Form Popup
 */

/* Additional styles for contact form popup */
.ipb-contact-form-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ipb-contact-form .ipb-field-group {
    margin-bottom: 15px;
}

.ipb-contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.ipb-contact-form .required {
    color: #e74c3c;
}

.ipb-contact-form input,
.ipb-contact-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.ipb-contact-form input:focus,
.ipb-contact-form textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.ipb-submit-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

.ipb-submit-btn:hover {
    background: #2980b9;
}

.ipb-submit-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.ipb-form-messages .success {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
    margin-bottom: 15px;
}

.ipb-form-messages .error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    margin-bottom: 15px;
}

/**
 * Frontend Contact Form Popup Styles
 */

.instant_popup_wrapper.contact_form_popup {
    max-width: 500px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.instant_popup_content {
    padding: 30px;
}

.contact_form_header {
    text-align: center;
    margin-bottom: 25px;
}

.contact_form_header h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.contact_form_header p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.instant_contact_form {
    width: 100%;
}

.form_fields {
    margin-bottom: 20px;
}

.form_field {
    margin-bottom: 20px;
}

.form_field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form_field input[type="text"],
.form_field input[type="email"],
.form_field input[type="tel"],
.form_field input[type="file"],
.form_field textarea,
.form_field select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form_field input[type="text"]:focus,
.form_field input[type="email"]:focus,
.form_field input[type="tel"]:focus,
.form_field textarea:focus,
.form_field select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form_field textarea {
    resize: vertical;
    min-height: 100px;
}

.form_field select {
    cursor: pointer;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="m0 0l2 2l2-2z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.checkbox_options {
    margin-top: 5px;
}

.checkbox_option {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: normal !important;
    cursor: pointer;
}

.checkbox_option input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

.recaptcha_field {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.form_actions {
    text-align: center;
    margin-top: 25px;
}

.submit_btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    min-width: 120px;
}

.submit_btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.submit_btn:active {
    transform: translateY(0);
}

.submit_btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.form_loading {
    margin-top: 15px;
    text-align: center;
    color: #666;
}

.form_loading span {
    display: inline-flex;
    align-items: center;
}

.form_loading span:before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.form_response {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

.success_message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
}

.error_message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
}

/* Required field indicator */
.form_field label:has(.required) {
    position: relative;
}

/* File upload styling */
.form_field input[type="file"] {
    border: 2px dashed #ddd;
    background: #f9f9f9;
    cursor: pointer;
    padding: 20px;
    text-align: center;
}

.form_field input[type="file"]:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

/* Responsive design */
@media (max-width: 600px) {
    .instant_popup_wrapper.contact_form_popup {
        margin: 10px;
        max-width: none;
    }
    
    .instant_popup_content {
        padding: 20px;
    }
    
    .contact_form_header h3 {
        font-size: 20px;
    }
    
    .form_field input,
    .form_field textarea,
    .form_field select {
        padding: 10px 12px;
    }
    
    .submit_btn {
        width: 100%;
        padding: 15px;
    }
}

/**
 * Public-facing stylesheet for the plugin.
 */

.ipb-contact-form-container {
    padding: 20px;
    max-width: 100%;
}

.contact_form_header {
    text-align: center;
    margin-bottom: 20px;
}

.contact_form_header h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #333;
}

.contact_form_header p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.instant_contact_form {
    width: 100%;
}

.form_fields {
    margin-bottom: 20px;
}

.form_field {
    margin-bottom: 15px;
}

.form_field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form_field input[type="text"],
.form_field input[type="email"],
.form_field input[type="tel"],
.form_field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form_field input:focus,
.form_field textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.form_field textarea {
    resize: vertical;
    min-height: 80px;
}

.form_field.required label::after {
    content: " *";
    color: #e74c3c;
}

.submit_field {
    text-align: center;
    margin-top: 20px;
}

.ipb_submit_btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    min-width: 150px;
}

.ipb_submit_btn:hover {
    background: #2980b9;
}

.ipb_submit_btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.form_messages {
    margin-top: 15px;
}

.success_message {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
    font-size: 14px;
}

.error_message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    font-size: 14px;
}

.recaptcha_field {
    text-align: center;
    margin: 15px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ipb-contact-form-container {
        padding: 15px;
    }
    
    .contact_form_header h3 {
        font-size: 20px;
    }
    
    .form_field input,
    .form_field textarea {
        padding: 8px 10px;
    }
    
    .ipb_submit_btn {
        padding: 10px 25px;
        font-size: 14px;
    }
}

/* Integration with core popup styles */
.intant-popup-type-contact-form {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    margin: 0 auto;
    position: relative;
}

.intant-popup-type-contact-form .inner_content {
    border-radius: 8px;
    overflow: hidden;
}

/* Close button styling */
.intant-popup-type-contact-form .instant-cross {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    cursor: pointer;
}

.intant-popup-type-contact-form .instant-cross i {
    font-size: 20px;
    color: #666;
    transition: color 0.3s ease;
}

.intant-popup-type-contact-form .instant-cross i:hover {
    color: #333;
} 