/**
 * Kiara Proactive Bubble
 * Style identique aux bulles agent de Message.html.twig (bg-light rounded-3)
 * Positionnée au-dessus du launcher dans ka-root (position: absolute)
 */

/* Conteneur — même positionnement que .ka-window */
.ka-proactive {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 320px;
    z-index: 1;
    animation: ka-proactive-in 260ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* La ligne de message est cliquable */
.ka-proactive .kiara-message {
    cursor: pointer;
}

/* Feedback hover sur la bulle */
.ka-proactive .kiara-message-bubble {
    transition: box-shadow 150ms ease, transform 150ms ease;
}

.ka-proactive .kiara-message:hover .kiara-message-bubble {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.ka-proactive .kiara-message:focus-visible .kiara-message-bubble {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

/* Avatar — gradient indigo-teal comme le launcher Kiara */
.ka-proactive-avatar {
    background: linear-gradient(135deg, var(--kl-indigo), var(--kl-teal));
    color: #071022;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

/* Bouton fermer — neutre sur fond clair */
.ka-proactive-dismiss {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2;
    transition: background 150ms ease, color 150ms ease;
}

.ka-proactive-dismiss:hover {
    background: #e5e7eb;
    color: #111827;
}

/* Texte du message LLM */
.ka-proactive-text {
    font-size: 14px;
    line-height: 1.55;
}

/* Typing dots — sombres sur fond clair */
.ka-proactive-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    min-height: 20px;
}

.ka-proactive-dots span {
    width: 7px;
    height: 7px;
    border-radius: 99px;
    background: #9ca3af;
    animation: ka-proactive-dot 1.2s infinite ease-in-out;
}

.ka-proactive-dots span:nth-child(2) { animation-delay: 0.15s; }
.ka-proactive-dots span:nth-child(3) { animation-delay: 0.30s; }

/* Mobile : réduire la largeur */
@media (max-width: 520px) {
    .ka-proactive {
        width: calc(100vw - 48px);
    }
}

/* Animations */
@keyframes ka-proactive-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ka-proactive-dot {
    0%, 80%, 100% {
        transform: scale(0.75);
        opacity: 0.45;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}
