/* Base form styles - shared between both types */
.wk-form {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    overflow: visible;
}

.wk-form-grid {
    display: grid;
    gap: 15px;
    width: 100%;
}

.wk-form-field-container {
    position: relative;
    min-width: 0; /* Prevent grid blowout */
}

.wk-form-field-container.wk-full-width {
    grid-column: 1 / -1;
}

.wk-form-field {
    width: 100%;
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

/* Regular Contact Form Styles */
.wk-form.wk-contact-form {
    max-width: 800px !important; /* Force specificity */
    padding: 30px !important;
}

.wk-form.wk-contact-form .wk-form-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr)) !important;
    gap: 20px !important;
}

.wk-form.wk-contact-form .wk-form-field {
    padding: 12px 15px !important;
    font-size: 16px !important;
}

.wk-form.wk-contact-form .wk-form-field:focus {
    border-color: #007bff !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) !important;
}

.wk-form.wk-contact-form textarea.wk-form-field {
    min-height: 150px !important;
    resize: vertical !important;
}

.wk-form.wk-contact-form .wk-submit-button {
    background-color: #007bff !important;
    color: white !important;
    border: none !important;
    padding: 12px 25px !important;
    border-radius: 4px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.wk-form.wk-contact-form .wk-submit-button:hover {
    background-color: #0069d9 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Demo Form Styles */
.wk-form.wk-demo-form {
    max-width: 400px !important; /* Force specificity */
    padding: 20px !important;
}

.wk-form.wk-demo-form .wk-form-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)) !important;
    gap: 15px !important;
}

.wk-form.wk-demo-form .wk-form-field {
    padding: 10px 12px !important;
    font-size: 14px !important;
    border-radius: 6px !important;
}

.wk-form.wk-demo-form .wk-form-field:focus {
    transform: scale(1.02) !important;
    border-color: #2196F3 !important;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15) !important;
}

.wk-form.wk-demo-form textarea.wk-form-field {
    min-height: 100px !important;
    resize: vertical !important;
}

.wk-form.wk-demo-form .wk-submit-button {
    background: linear-gradient(45deg, #2196F3, #1976D2) !important;
    color: white !important;
    border: none !important;
    padding: 12px 30px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
}

.wk-form.wk-demo-form .wk-submit-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(33, 150, 243, 0.3) !important;
}

/* Shared form elements styling */
.wk-form-submit {
    margin-top: 20px;
    text-align: center;
}

select.wk-form-field {
    appearance: none;
    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 8.825L1.175 4 2.825 2.35 6 5.525 9.175 2.35 10.825 4 6 8.825z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px !important;
    max-width: 100%;
}

/* Chosen dropdown styling fixes for responsive */
.wk-form .chosen-container {
    width: 100% !important;
    max-width: 100% !important;
}

.wk-form .chosen-container-multi .chosen-choices,
.wk-form .chosen-container-single .chosen-single {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.wk-form .chosen-drop {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.wk-form .chosen-container .chosen-results {
    max-height: 200px;
    overflow-y: auto;
}

/* Mobile: gebruik native dropdowns in plaats van Chosen */
@media (max-width: 768px) {
    /* Verberg Chosen containers op mobiel */
    .wk-form .chosen-container {
        display: none !important;
    }
    
    /* Toon native select op mobiel */
    .wk-form select.wk-form-field[multiple] {
        display: block !important;
        padding: 12px 16px;
        font-size: 16px; /* Voorkomt zoom op iOS */
        min-height: 120px;
    }
    
    .wk-form select.wk-form-field:not([multiple]) {
        font-size: 16px; /* Voorkomt zoom op iOS */
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wk-form.wk-contact-form,
    .wk-form.wk-demo-form {
        padding: 15px !important;
        max-width: 100% !important;
    }
    
    .wk-form.wk-contact-form .wk-form-grid,
    .wk-form.wk-demo-form .wk-form-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .wk-form-field {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .wk-form.wk-contact-form,
    .wk-form.wk-demo-form {
        padding: 10px !important;
    }
    
    .wk-form.wk-contact-form .wk-form-grid,
    .wk-form.wk-demo-form .wk-form-grid {
        gap: 12px !important;
    }
    
    .wk-form-submit {
        margin-top: 15px;
    }
    
    .wk-submit-button {
        width: 100%;
        padding: 14px !important;
    }
}

/* Form validation and feedback styles */
.wk-form-feedback {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.wk-form-feedback.wk-error {
    background-color: #fff2f0;
    border-left: 4px solid #ff4d4f;
    color: #cf1322;
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.wk-form-feedback.wk-success {
    background-color: #f6ffed;
    border-left: 4px solid #52c41a;
    color: #389e0d;
    padding: 20px;
    margin-bottom: 25px;
    font-size: 16px;
    display: flex;
    align-items: center;
    animation: fadeIn 0.5s ease forwards;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

.wk-form-message {
    flex: 1;
}

.wk-form-message-icon {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    position: relative;
    margin-top: 2px;
}

.wk-form-feedback.wk-error .wk-form-message-icon:before {
    content: "!";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #ff4d4f;
    color: white;
    border-radius: 50%;
    font-weight: bold;
}

.wk-form-feedback.wk-success .wk-form-message-icon:before {
    content: "✓";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #52c41a;
    color: white;
    border-radius: 50%;
    font-weight: bold;
}

/* Field error states */
.wk-form-field-error {
    border-color: #ff4d4f !important;
    background-color: #fff2f0;
    box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2);
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
}

.wk-field-error-message {
    color: #ff4d4f;
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
    display: flex;
    padding: 5px 8px;
    align-items: center;
    background-color: #fff2f0;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-2px, 0, 0); }
    40%, 60% { transform: translate3d(2px, 0, 0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Telefoonnummer formaat helptext */
.wk-phone-format {
    display: block;
    color: #666;
    font-size: 11px;
    margin-top: 4px;
    margin-left: 2px;
    line-height: 1.2;
}

/* Calendly Scheduler Modal - verplaatst naar aparte CSS voor het toevoegen aan de body */
.wk-calendly-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wk-calendly-modal.active {
    opacity: 1;
    visibility: visible;
}

.wk-calendly-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 96%;
    max-width: 1100px;
    height: 90vh; /* Vaste hoogte voor betere responsiviteit */
    max-height: 800px; /* Maximum hoogte op grote schermen */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Belangrijk om overloop van iframe te voorkomen */
    padding: 30px;
    position: relative;
}

.wk-calendly-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: #f1f1f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;
    color: #333;
    transition: background-color 0.2s;
    border: none;
    z-index: 10;
}

.wk-calendly-close:hover {
    background-color: #e0e0e0;
}

.wk-calendly-header {
    text-align: center;
    margin-bottom: 25px;
    flex-shrink: 0;
}

.wk-calendly-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.wk-calendly-subtitle {
    font-size: 18px;
    color: #666;
    margin-bottom: 15px;
}

.wk-calendly-iframe-container {
    flex: 1;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.wk-calendly-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Tablet aanpassingen */
@media (max-width: 992px) {
    .wk-calendly-container {
        width: 95%;
        padding: 20px;
        height: 95vh;
        max-height: none; /* Geen maximale hoogte op tablet */
    }
    
    .wk-calendly-title {
        font-size: 24px;
    }
    
    .wk-calendly-subtitle {
        font-size: 16px;
        margin-bottom: 10px;
    }
}

/* Mobiele aanpassingen */
@media (max-width: 576px) {
    .wk-calendly-container {
        width: 100%;
        height: 100%; /* Volledig schermvullend */
        padding: 15px;
        border-radius: 0; /* Geen afgeronde hoeken op mobiel */
        max-height: none; /* Geen maximale hoogte op mobiel */
    }
    
    .wk-calendly-header {
        margin-bottom: 15px;
    }
    
    .wk-calendly-title {
        font-size: 20px;
        margin-bottom: 5px;
    }
    
    .wk-calendly-subtitle {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .wk-calendly-close {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
}

/* Test button styles */
.wk-calendly-test-wrapper {
    margin-top: 20px;
    text-align: center;
}

.wk-calendly-test-button {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.wk-calendly-test-button:hover {
    background-color: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.wk-test-note {
    margin-top: 5px;
    font-size: 11px;
    color: #666;
    font-style: italic;
}

/* Loading indicator voor Calendly iframe */
.wk-calendly-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 5;
}

.wk-calendly-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 4px solid rgba(0, 123, 255, 0.3);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: calendly-spinner 1s ease-in-out infinite;
}

.wk-calendly-loader-text {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

@keyframes calendly-spinner {
    to { transform: rotate(360deg); }
}

/* Verberg loader nadat iframe is geladen */
.wk-calendly-iframe-loaded .wk-calendly-loader {
    display: none;
}

/* Privacy notice styling */
.wk-privacy-notice {
    font-size: 12px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
    text-align: center;
}

.wk-privacy-notice a {
    color: #007bff;
    text-decoration: underline;
}

.wk-privacy-notice a:hover {
    color: #0056b3;
}
