/**
 * Chatbot Styling voor BesteDomeinen.nl
 * Oranje thema passend bij de huisstijl
 */

/* CSS Variables */
.chatbot-container {
    --cb-primary: #f97316;
    --cb-primary-dark: #ea580c;
    --cb-primary-light: #fb923c;
    --cb-white: #ffffff;
    --cb-gray-50: #f9fafb;
    --cb-gray-100: #f3f4f6;
    --cb-gray-200: #e5e7eb;
    --cb-gray-300: #d1d5db;
    --cb-gray-500: #6b7280;
    --cb-gray-700: #374151;
    --cb-gray-800: #1f2937;
    --cb-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    --cb-radius: 16px;
    --cb-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Chat Button */
.chatbot-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cb-primary) 0%, var(--cb-primary-dark) 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(249, 115, 22, 0.5);
}

.chatbot-button svg {
    width: 28px;
    height: 28px;
    fill: var(--cb-white);
    transition: transform 0.3s ease;
}

.chatbot-button.open svg {
    transform: rotate(90deg);
}

/* Notification Badge */
.chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--cb-white);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 550px;
    max-height: calc(100vh - 140px);
    background: var(--cb-white);
    border-radius: var(--cb-radius);
    box-shadow: var(--cb-shadow);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    font-family: var(--cb-font);
    overflow: hidden;
}

.chatbot-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--cb-primary) 0%, var(--cb-primary-dark) 100%);
    color: var(--cb-white);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chatbot-info {
    flex: 1;
}

.chatbot-name {
    font-weight: 600;
    font-size: 16px;
    margin: 0;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-close svg {
    width: 16px;
    height: 16px;
    fill: var(--cb-white);
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--cb-gray-50);
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--cb-gray-300);
    border-radius: 3px;
}

/* Message Bubbles */
.chatbot-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.bot {
    align-self: flex-start;
}

.chatbot-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cb-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.chatbot-message.user .chatbot-message-avatar {
    background: var(--cb-gray-700);
}

.chatbot-message-content {
    background: var(--cb-white);
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    line-height: 1.5;
    font-size: 14px;
    color: var(--cb-gray-800);
}

.chatbot-message.user .chatbot-message-content {
    background: var(--cb-primary);
    color: var(--cb-white);
}

.chatbot-message.bot .chatbot-message-content {
    border-bottom-left-radius: 4px;
}

.chatbot-message.user .chatbot-message-content {
    border-bottom-right-radius: 4px;
}

/* Links in messages */
.chatbot-message-content a {
    color: var(--cb-primary);
    text-decoration: underline;
}

.chatbot-message.user .chatbot-message-content a {
    color: var(--cb-white);
}

/* Typing Indicator - Zwarte bewegende puntjes */
.chatbot-typing {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    background: var(--cb-white);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chatbot-typing span {
    width: 10px;
    height: 10px;
    background: #1f2937;
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.chatbot-typing span:nth-child(1) {
    animation-delay: 0s;
}

.chatbot-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.chatbot-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0) scale(1);
        background: #1f2937;
    }
    30% {
        transform: translateY(-8px) scale(1.1);
        background: #374151;
    }
}


/* Quick Questions */
.chatbot-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    background: var(--cb-white);
    border-top: 1px solid var(--cb-gray-200);
}

.chatbot-quick-btn {
    background: var(--cb-gray-100);
    border: 1px solid var(--cb-gray-200);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--cb-gray-700);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--cb-font);
}

.chatbot-quick-btn:hover {
    background: var(--cb-primary);
    border-color: var(--cb-primary);
    color: var(--cb-white);
}

/* Input Area */
.chatbot-input-area {
    padding: 16px 20px;
    background: var(--cb-white);
    border-top: 1px solid var(--cb-gray-200);
    display: flex;
    gap: 12px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    border: 1px solid var(--cb-gray-300);
    border-radius: 24px;
    padding: 12px 18px;
    font-size: 14px;
    font-family: var(--cb-font);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chatbot-input:focus {
    border-color: var(--cb-primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.chatbot-input::placeholder {
    color: var(--cb-gray-500);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--cb-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background: var(--cb-primary-dark);
    transform: scale(1.05);
}

.chatbot-send:disabled {
    background: var(--cb-gray-300);
    cursor: not-allowed;
    transform: none;
}

.chatbot-send svg {
    width: 20px;
    height: 20px;
    fill: var(--cb-white);
}

/* Footer/Branding */
.chatbot-footer {
    padding: 8px;
    text-align: center;
    font-size: 11px;
    color: var(--cb-gray-500);
    background: var(--cb-gray-50);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .chatbot-button {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }

    .chatbot-quick-questions {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .chatbot-quick-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chatbot-window {
        background: var(--cb-gray-800);
    }

    .chatbot-messages {
        background: var(--cb-gray-700);
    }

    .chatbot-message.bot .chatbot-message-content {
        background: var(--cb-gray-800);
        color: var(--cb-gray-100);
    }

    .chatbot-input-area {
        background: var(--cb-gray-800);
        border-color: var(--cb-gray-700);
    }

    .chatbot-input {
        background: var(--cb-gray-700);
        border-color: var(--cb-gray-600);
        color: var(--cb-white);
    }

    .chatbot-quick-questions {
        background: var(--cb-gray-800);
        border-color: var(--cb-gray-700);
    }

    .chatbot-quick-btn {
        background: var(--cb-gray-700);
        border-color: var(--cb-gray-600);
        color: var(--cb-gray-200);
    }
}
