/* Effilution AI chatbot widget
   Branding: #22aeed accent, Inter, slate kleuren, cubic-bezier easing
   Geen emoji's, geen pill badges (uitz.: live-status indicator) */

.efb-root {
    --efb-blue: #22aeed;
    --efb-slate-900: #0f172a;
    --efb-slate-500: #64748b;
    --efb-slate-400: #94a3b8;
    --efb-slate-100: #f1f5f9;
    --efb-slate-50: #f8fafc;
    --efb-white: #ffffff;
    --efb-ease: cubic-bezier(0.22, 1, 0.36, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* === Bubble === */
.efb-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--efb-blue);
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(34, 174, 237, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483000;
    transition: transform 0.4s var(--efb-ease), box-shadow 0.4s var(--efb-ease);
    padding: 0;
}
.efb-bubble:hover {
    transform: scale(1.05);
    box-shadow: 0 14px 50px rgba(34, 174, 237, 0.45);
}
.efb-bubble:focus-visible {
    outline: 3px solid var(--efb-slate-900);
    outline-offset: 3px;
}
.efb-bubble svg { width: 28px; height: 28px; }

/* Engine-glow halo */
.efb-bubble::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: var(--efb-blue);
    opacity: 0.2;
    filter: blur(16px);
    z-index: -1;
    animation: efb-engine-glow 3s ease-in-out infinite;
}
@keyframes efb-engine-glow {
    0%, 100% { transform: scale(1); opacity: 0.2; }
    50%      { transform: scale(1.15); opacity: 0.4; }
}

.efb-bubble[data-open="true"] { transform: scale(0.9); }
.efb-bubble[data-open="true"]::before { animation: none; opacity: 0; }

/* === Panel === */
.efb-panel {
    position: fixed;
    bottom: 104px;
    right: 24px;
    width: 380px;
    height: 560px;
    max-height: calc(100vh - 128px);
    background: var(--efb-white);
    border: 1px solid var(--efb-slate-100);
    border-radius: 2rem;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
    z-index: 2147483000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.4s var(--efb-ease), transform 0.4s var(--efb-ease);
}
.efb-panel[data-open="true"] {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* === Header === */
.efb-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--efb-slate-100);
    background: var(--efb-white);
}
.efb-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--efb-blue);
    box-shadow: 0 0 0 0 rgba(34, 174, 237, 0.6);
    animation: efb-pulse 2s ease-in-out infinite;
}
@keyframes efb-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 174, 237, 0.6); }
    50%      { box-shadow: 0 0 0 8px rgba(34, 174, 237, 0); }
}
.efb-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--efb-slate-900);
    letter-spacing: -0.01em;
    flex: 1;
    margin: 0;
}
.efb-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    color: var(--efb-slate-500);
    display: flex;
    transition: background 0.2s var(--efb-ease), color 0.2s var(--efb-ease);
}
.efb-close:hover { background: var(--efb-slate-50); color: var(--efb-slate-900); }
.efb-close svg { width: 18px; height: 18px; }

/* === Messages === */
.efb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--efb-white);
    scrollbar-width: thin;
    scrollbar-color: var(--efb-slate-100) transparent;
}
.efb-messages::-webkit-scrollbar { width: 6px; }
.efb-messages::-webkit-scrollbar-thumb { background: var(--efb-slate-100); border-radius: 3px; }

.efb-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 1.25rem;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
    white-space: pre-wrap;
    word-wrap: break-word;
    animation: efb-msg-in 0.4s var(--efb-ease);
}
@keyframes efb-msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.efb-msg-bot {
    background: var(--efb-slate-50);
    color: var(--efb-slate-900);
    border-bottom-left-radius: 0.375rem;
    align-self: flex-start;
}
.efb-msg-user {
    background: var(--efb-blue);
    color: var(--efb-white);
    border-bottom-right-radius: 0.375rem;
    align-self: flex-end;
}
.efb-msg-error {
    background: #fef2f2;
    color: #991b1b;
    border-bottom-left-radius: 0.375rem;
    align-self: flex-start;
    font-size: 13px;
}

/* Typing indicator */
.efb-typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 14px 18px;
}
.efb-typing span {
    width: 7px;
    height: 7px;
    background: var(--efb-slate-400);
    border-radius: 50%;
    animation: efb-typing-bounce 1.2s ease-in-out infinite;
}
.efb-typing span:nth-child(2) { animation-delay: 0.15s; }
.efb-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes efb-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%           { transform: translateY(-4px); opacity: 1; }
}

/* === Input === */
.efb-form {
    border-top: 1px solid var(--efb-slate-100);
    padding: 14px 16px;
    display: flex;
    gap: 8px;
    background: var(--efb-white);
}
.efb-input {
    flex: 1;
    border: 1px solid var(--efb-slate-100);
    background: var(--efb-slate-50);
    border-radius: 1rem;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--efb-slate-900);
    resize: none;
    outline: none;
    transition: border-color 0.2s var(--efb-ease), background 0.2s var(--efb-ease);
    max-height: 120px;
    min-height: 44px;
    line-height: 1.4;
}
.efb-input::placeholder { color: var(--efb-slate-400); font-weight: 500; }
.efb-input:focus {
    border-color: var(--efb-blue);
    background: var(--efb-white);
}
.efb-send {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 1rem;
    background: var(--efb-blue);
    border: none;
    color: var(--efb-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s var(--efb-ease), opacity 0.2s var(--efb-ease);
}
.efb-send:hover:not(:disabled) { transform: scale(1.05); }
.efb-send:disabled { opacity: 0.4; cursor: not-allowed; }
.efb-send svg { width: 18px; height: 18px; }

/* === Footer disclaimer === */
.efb-footer {
    padding: 8px 16px 12px;
    font-size: 10px;
    color: var(--efb-slate-400);
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.02em;
    background: var(--efb-white);
}

/* === Mobile === */
@media (max-width: 480px) {
    .efb-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    .efb-bubble {
        bottom: 16px;
        right: 16px;
    }
    /* Bubble verbergen als panel open is op mobile (overlapt anders met send-knop) */
    .efb-bubble[data-open="true"] {
        display: none;
    }
}

/* Respecteer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .efb-bubble::before,
    .efb-status-dot,
    .efb-typing span,
    .efb-msg,
    .efb-panel,
    .efb-bubble { animation: none !important; transition: opacity 0.2s linear !important; }
}
