/**
 * Contact Form 7 - Vietnamese Styles
 * Styles for Vietnamese contact form
 */

/* ============================================================================
   DEFENSE-IN-DEPTH: Hide CF7 hidden-fields-container
   Multiple layers to ensure element stays hidden
   ============================================================================ */

/* Layer 1: Base rule */
.wpcf7 .hidden-fields-container {
    display: none !important;
}

/* Layer 2: Specific to vidieu forms */
.vidieu-contact-form .hidden-fields-container,
.vidieu-contact-form .wpcf7 .hidden-fields-container {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Layer 3: Any fieldset with hidden class */
fieldset.hidden-fields-container {
    display: none !important;
}

/* ============================================================================
   2-SECTION LAYOUT: Contact Info + Form
   ============================================================================ */

/* Section 1: Contact Info Cards */
.vidieu-contact-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.vidieu-contact-header {
    text-align: center;
    margin-bottom: 40px;
}

.vidieu-contact-header h2 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 15px;
}

.vidieu-contact-header p {
    font-size: 1.1em;
    color: #666;
}

.vidieu-contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.vidieu-contact-card {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.vidieu-contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.vidieu-contact-card .icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.vidieu-contact-card h3 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 10px;
}

.vidieu-contact-card p {
    margin: 0;
    color: #666;
}

.vidieu-contact-card a {
    color: #F76B6A;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
}

.vidieu-contact-card a:hover {
    color: #e55a5a;
    text-decoration: underline;
}

/* Section 2: Form with Clear Header */
.vidieu-form-section {
    background: #ffffff;
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.vidieu-form-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 3px solid #F76B6A;
}

.vidieu-form-header h2 {
    font-size: 2em;
    color: #333;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.vidieu-form-header h2::before {
    content: "✉️";
    font-size: 1.2em;
}

.vidieu-form-header p {
    color: #666;
    font-size: 1em;
    margin: 0;
}

/* Contact Form Container */
.vidieu-contact-form {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

/* Form Row */
.vidieu-contact-form .form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

/* Form Group */
.vidieu-contact-form .form-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

.vidieu-contact-form .col-md-6 {
    padding-right: 15px;
    padding-left: 15px;
}

@media (min-width: 768px) {
    .vidieu-contact-form .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Labels */
.vidieu-contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.vidieu-contact-form label .required {
    color: #e74c3c;
}

/* Form Controls */
.vidieu-contact-form .form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.vidieu-contact-form .form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #F76B6A;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(247, 107, 106, 0.25);
}

/* Textarea */
.vidieu-contact-form textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* ============================================================================
   ROOT CAUSE FIX: Override Elessi theme footer CSS

   Problem: Elessi theme style.css line 11259-11263
   #nasa-footer .wpcf7 .wpcf7-form-control-wrap {
       display: block;
       width: 100%;
   }

   This rule applies to ALL .wpcf7-form-control-wrap on page (not just footer)

   Solution: Use higher specificity WITHOUT !important
   ============================================================================ */

/* Checkbox label container */
.vidieu-contact-form .checkbox-label {
    display: block;
    font-weight: normal;
    margin-bottom: 0;
    line-height: 1.8;
}

/* Override Elessi footer CSS with higher specificity
   Elessi: #nasa-footer .wpcf7 .wpcf7-form-control-wrap (1,2,0)
   Ours: body .vidieu-contact-form .checkbox-label .wpcf7-form-control-wrap (1,3,0)
   Higher specificity = Wins without !important
*/
body .vidieu-contact-form .checkbox-label .wpcf7-form-control-wrap {
    display: inline;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    float: none;
}

/* Nested CF7 spans - higher specificity */
body .vidieu-contact-form .checkbox-label .wpcf7-form-control,
body .vidieu-contact-form .checkbox-label .wpcf7-acceptance,
body .vidieu-contact-form .checkbox-label .wpcf7-list-item {
    display: inline;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    float: none;
}

/* List item specific margin */
body .vidieu-contact-form .checkbox-label .wpcf7-list-item {
    margin-right: 8px;
}

/* Checkbox input */
body .vidieu-contact-form .checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    margin-left: 0;
    vertical-align: middle;
    display: inline-block;
    width: auto;
    float: none;
}

/* Link styling */
.vidieu-contact-form .checkbox-label a {
    color: #F76B6A;
    text-decoration: underline;
    white-space: nowrap;
}

/* Submit Button - Defense-in-Depth: Proper sizing */
.vidieu-contact-form .form-submit {
    margin-top: 2rem;
    text-align: center;
}

.vidieu-contact-form .btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    padding: 0.875rem 3rem;
    font-size: 1.1rem;
    line-height: 1.5;
    border-radius: 8px;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    border: none;
    min-width: 200px;
}

.vidieu-contact-form .btn-primary {
    color: #fff;
    background-color: #F76B6A;
    border-color: #F76B6A;
}

.vidieu-contact-form .btn-primary:hover {
    color: #fff;
    background-color: #e55a5a;
    border-color: #e55a5a;
    box-shadow: 0 5px 15px rgba(247, 107, 106, 0.3);
    transform: translateY(-2px);
}

.vidieu-contact-form .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(247, 107, 106, 0.3);
}

/* Override btn-block class if present */
.vidieu-contact-form .btn-block {
    display: inline-block !important;
    width: auto !important;
    min-width: 200px !important;
}

/* Mobile: Full width button */
@media (max-width: 576px) {
    .vidieu-contact-form .btn {
        display: block;
        width: 100%;
        min-width: unset;
    }

    .vidieu-contact-form .btn-block {
        display: block !important;
        width: 100% !important;
        min-width: unset !important;
    }
}

/* Contact Form 7 Response */
.wpcf7-response-output {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
}

.wpcf7-mail-sent-ok {
    border: 1px solid #28a745;
    background-color: #d4edda;
    color: #155724;
}

.wpcf7-mail-sent-ng,
.wpcf7-spam-blocked {
    border: 1px solid #dc3545;
    background-color: #f8d7da;
    color: #721c24;
}

.wpcf7-acceptance-missing {
    border: 1px solid #ffc107;
    background-color: #fff3cd;
    color: #856404;
}

/* Validation Errors */
.wpcf7-not-valid-tip {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.wpcf7-not-valid {
    border-color: #dc3545 !important;
}

/* Loading Spinner */
.wpcf7-spinner {
    visibility: hidden;
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #F76B6A;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

.wpcf7-spinner.is-active {
    visibility: visible;
}

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

/* Mobile Responsive */
@media (max-width: 767px) {
    .vidieu-contact-section {
        padding: 30px 15px;
    }

    .vidieu-contact-header h2 {
        font-size: 1.8em;
    }

    .vidieu-contact-cards {
        gap: 20px;
        margin-bottom: 40px;
    }

    .vidieu-contact-card {
        padding: 25px 15px;
    }

    .vidieu-form-section {
        padding: 30px 20px;
        border-radius: 15px;
    }

    .vidieu-form-header h2 {
        font-size: 1.5em;
    }

    .vidieu-contact-form {
        padding: 15px;
    }

    .vidieu-contact-form .form-group {
        margin-bottom: 1rem;
    }

    .vidieu-contact-form .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}