/* Isoleer AI widget van andere scripts */
[data-ai-widget] * {
    box-sizing: border-box;
}

/* Voorkom interferentie met search highlighting */
.ai-help-widget {
    position: fixed !important;
    bottom: 100px !important;
    right: 20px !important;
    z-index: 2147483647 !important;  /* hoogste veilige waarde */
}

.ai-help-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.help-button {
    z-index: 2147483647 !important;  /* hoogste veilige waarde */
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.help-button:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.chat-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 350px;
    height: 400px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.chat-panel.hidden {
    display: none;
}

.chat-header {
    background: #007bff;
    color: white;
    padding: 15px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-chat:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.chat-input {
    padding: 15px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #eee;
    background: white;
    border-radius: 0 0 10px 10px;
}

.chat-input input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

.chat-input input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.chat-input button {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.chat-input button:hover {
    background: #005a87;
}

.chat-input button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.message {
    margin-bottom: 15px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    max-width: 85%;
    word-wrap: break-word;
}

.user-message {
    background: #007bff;
    color: white;
    margin-left: auto;
    margin-right: 0;
    border-bottom-right-radius: 4px;
}

.ai-message {
    background: white;
    border: 1px solid #e1e5e9;
    margin-left: 0;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.message.typing {
    opacity: 0.7;
    font-style: italic;
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #007bff;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .ai-help-widget {
        bottom: 10px;
        right: 10px;
    }
    
    .chat-panel {
        width: calc(100vw - 20px);
        max-width: 350px;
        height: 350px;
    }
    
    .help-button {
        padding: 10px 16px;
        font-size: 13px;
    }
}
