/* Overlay */
.contact-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(0px);
}



.contact-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Sidebar */
.contact-sidebar {
    position: fixed;
    right: -500px;
    top: 0;
    width: 500px;
    height: 100%;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 999999;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.contact-sidebar.active {
    transform: translateX(-500px);
}


.custom-submit button {
    background: yellow !important;
    color: #333 !important;
    width: 100% !important;
    display: flex !important;
    height: 60px !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    font-weight: 500 !important;
    font-family: "Montserrat", sans-serif !important;
    font-size: 17px !important;
}

/* Close button */
.contact-sidebar-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.contact-sidebar-close:hover {
    background: rgb(83, 165, 220);
    color: white;
    transform: rotate(90deg);
}

/* Header */
.contact-sidebar-header {
    padding: 40px 30px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.contact-sidebar-header h3 {
    color: #1a1a1a;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.contact-sidebar-header p {
    color: #666;
    font-size: 15px;
    margin: 0;
    line-height: 1.5;
}

/* Content */
.contact-sidebar-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Voorkom scroll jump bij form submit */
    overflow-anchor: auto;
}

/* Gravity Forms styling - MobileXL style */
.contact-sidebar-content .gform_wrapper {
    margin: 0;
    font-family: "Montserrat", sans-serif;
}

.contact-sidebar-content .gform_wrapper .gform_fields {
    grid-gap: 20px;
}

.contact-sidebar-content .gform_wrapper .gfield {
    margin-bottom: 20px;
}

/* Labels - MobileXL purple style */
.contact-sidebar-content .gform_wrapper .gfield_label {
    display: inline-block;
    padding-bottom: 5px;
    font-family: "Montserrat", sans-serif !important;
    font-size: 17px;
    font-weight: 700 !important;
    line-height: 26px;
    color: rgb(103, 44, 145) !important;
    margin-bottom: 8px;
}

/* Hide the (Required) text and show red asterisk instead */
.contact-sidebar-content .gform_wrapper .gfield_required.gfield_required_text {
    /* Hide the text completely */
    display: none;
}

.contact-sidebar-content .gform_wrapper .gfield_required {
    color: #dc3545;
    font-weight: 700;
    margin-left: 4px;
}

/* Add red asterisk after required labels */
.contact-sidebar-content .gform_wrapper .gfield_contains_required .gfield_label::after {
    content: ' *';
    color: #dc3545;
    font-weight: 700;
    font-size: 16px;
}

/* Input fields - MobileXL style */
.contact-sidebar-content .gform_wrapper input[type="text"],
.contact-sidebar-content .gform_wrapper input[type="email"],
.contact-sidebar-content .gform_wrapper input[type="tel"],
.contact-sidebar-content .gform_wrapper input[type="url"],
.contact-sidebar-content .gform_wrapper select {
    width: 100%;
    height: 48px;
    line-height: 48px;
    padding: 0 20px;
    border-radius: 8px;
    border: 1px solid rgb(212, 211, 211);
    font-family: "Montserrat", sans-serif !important;
    font-size: 17px;
    font-weight: 500;
    line-height: 26px;
    color: rgb(54, 50, 51);
    background: white;
    transition: all 0.2s ease;
}

/* Textarea - MobileXL style */
.contact-sidebar-content .gform_wrapper textarea {
    width: 100%;
    min-height: 160px;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid rgb(212, 211, 211);
    font-family: "Montserrat", sans-serif !important;
    font-size: 17px;
    font-weight: 500;
    line-height: 26px;
    color: rgb(54, 50, 51);
    background: white;
    transition: all 0.2s ease;
    resize: none;
}

/* Placeholder styling */
.contact-sidebar-content .gform_wrapper input::-webkit-input-placeholder,
.contact-sidebar-content .gform_wrapper textarea::-webkit-input-placeholder {
    color: rgb(212, 211, 211);
    font-family: "Montserrat", sans-serif;
}

.contact-sidebar-content .gform_wrapper input::-moz-placeholder,
.contact-sidebar-content .gform_wrapper textarea::-moz-placeholder {
    color: rgb(212, 211, 211);
    font-family: "Montserrat", sans-serif;
}

.contact-sidebar-content .gform_wrapper input:-ms-input-placeholder,
.contact-sidebar-content .gform_wrapper textarea:-ms-input-placeholder {
    color: rgb(212, 211, 211);
    font-family: "Montserrat", sans-serif;
}

/* Focus states - MobileXL blue */
.contact-sidebar-content .gform_wrapper input:focus,
.contact-sidebar-content .gform_wrapper textarea:focus,
.contact-sidebar-content .gform_wrapper select:focus {
    outline: none;
    border: 1px solid rgb(83, 165, 220);
    box-shadow: 0 0 0 3px rgba(83, 165, 220, 0.1);
}

/* Reset ALL Gravity Forms button styling */
.contact-sidebar-content .gform_wrapper .gform_button,
.contact-sidebar-content .gform_wrapper input[type="submit"],
.contact-sidebar-content .gform_wrapper .button,
.contact-sidebar-content .gform_wrapper button {
    all: unset !important;
    /* Reset everything, then apply our styles */
}

/* MobileXL Button Base Styles */
.contact-sidebar-content .wp-block-button {
    display: block;
    width: 100%;
    margin-top: 20px;
}

.contact-sidebar-content .wp-block-button.has-custom-width.wp-block-button__width-100 {
    width: 100%;
}

/* MobileXL Button Styling - Exact copy from your website */
.contact-sidebar-content .button.button--yellow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
    padding: 16px 32px;
    background-color: rgb(255, 205, 0);
    border: none;
    border-radius: 8px;
    font-family: "Montserrat", sans-serif !important;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: rgb(54, 50, 51);
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.contact-sidebar-content .button.button--yellow:hover {
    background-color: rgb(255, 215, 50);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 205, 0, 0.4);
}

.contact-sidebar-content .button.button--yellow:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(255, 205, 0, 0.3);
}

.contact-sidebar-content .button.button--yellow:focus {
    outline: 2px solid rgb(83, 165, 220);
    outline-offset: 2px;
}

/* Arrow styling if present */
.contact-sidebar-content .button.button--arrow::after {
    content: url('/wp-content/themes/mxl2/assets/images/button-arrow-white.svg');
    margin-left: 8px;
    font-size: 20px;
    font-weight: 400;
    position: relative;
    top: 3px;
}

/* Fallback for original Gravity Forms button if PHP filter doesn't work */
.contact-sidebar-content .gform_wrapper .gform_button:not(.button) {
    /* Apply same styling to original button as fallback */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 56px !important;
    padding: 16px 32px !important;
    background-color: rgb(255, 205, 0) !important;
    border: none !important;
    border-radius: 8px !important;
    font-family: "Montserrat", sans-serif !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: rgb(54, 50, 51) !important;
    text-align: center !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    margin-top: 20px !important;
}

.contact-sidebar-content .gform_wrapper .gform_button:not(.button):hover {
    background-color: rgb(255, 215, 50) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(255, 205, 0, 0.4) !important;
}

/* Validation errors */
.contact-sidebar-content .gform_wrapper .gfield_error {
    border-radius: 8px;
    margin-bottom: 20px;
}

.contact-sidebar-content .gform_wrapper .validation_message {
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    color: #dc3545;
    margin-top: 5px;
    font-weight: 500;
}

.gform_validation_errors {
    display: none !important;
}

.gform_wrapper.gravity-theme .gfield_validation_message, .gform_wrapper.gravity-theme .validation_message {
    border-radius: 10px !important;
}

.contact-sidebar-content .gform_wrapper .gfield_error input,
.contact-sidebar-content .gform_wrapper .gfield_error textarea {
    border-color: #dc3545;
}

/* Success message */
.contact-sidebar-content .gform_confirmation_message {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    padding: 20px;
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    color: rgb(54, 50, 51);
    line-height: 1.6;
    text-align: center;
    margin-top: 20px;
}

/* Ajax spinner */
.contact-sidebar-content .gform_ajax_spinner {
    margin-left: 20px;
}

/* Sticky button */
.contact-sidebar-sticky-btn {
    position: fixed;
    left: 30px;
    bottom: 30px;
    background: rgb(83, 165, 220);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 15px 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(83, 165, 220, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999997;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.contact-sidebar-sticky-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(83, 165, 220, 0.4);
    background: #4a94c4;
}

.contact-sidebar-sticky-btn.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-100px);
}

.contact-sidebar-sticky-btn svg {
    width: 24px;
    height: 24px;
}

/* Pulse animation for attention */
.contact-sidebar-sticky-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 30px;
    background: rgb(83, 165, 220);
    transform: translate(-50%, -50%);
    animation: pulse 2s infinite;
    z-index: -1;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
}

/* Body scroll lock when sidebar is active - ALLEEN als sidebar echt open is */
body.contact-sidebar-open {
    overflow: hidden;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .contact-sidebar {
        width: 100%;
        right: -100%;
    }

    .contact-sidebar.active {
        transform: translateX(-100%);
    }

    .contact-sidebar-header {
        padding: 30px 20px 15px;
    }

    .contact-sidebar-content {
        padding: 20px;
    }

    .contact-sidebar-sticky-btn {
        right: 20px;
        bottom: 20px;
        padding: 12px 20px;
        font-size: 14px;
    }

    .contact-sidebar-sticky-btn span {
        display: none;
    }

    .contact-sidebar-sticky-btn {
        width: 56px;
        height: 56px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }
}

/* Smooth entrance animations */
.contact-sidebar.active .contact-sidebar-header {
    animation: fadeInUp 0.5s ease-out 0.2s both;
}

.contact-sidebar.active .contact-sidebar-content {
    animation: fadeInUp 0.5s ease-out 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form placeholder voor development */
.form-placeholder {
    padding: 20px;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 8px;
    text-align: center;
    color: #666;
    font-size: 14px;
}