/**
 * Vanessa — area messaggi, scroll-down, typing, reveal (dopo vanessa-widget.css)
 */

.bt-vanessa__scroll-down {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    background: #222;
    border: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.15s ease, border-color 0.15s ease;
    z-index: 5;
    pointer-events: none;
}

.bt-vanessa__scroll-down--visible {
    opacity: 1;
    pointer-events: auto;
}

.bt-vanessa__scroll-down:hover {
    background: #333;
    border-color: #555;
}

.bt-vanessa__scroll-down-icon {
    display: flex;
    color: #888;
}

.bt-vanessa__messages {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px;
    background: #111;
    scrollbar-width: none;
}

.bt-vanessa__messages::after {
    content: '';
    display: block;
    flex-shrink: 0;
    height: 32px;
    margin-top: -32px;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(to bottom, rgba(17, 17, 17, 0), #080808);
    pointer-events: none;
    z-index: 2;
}

.bt-vanessa__messages::-webkit-scrollbar {
    display: none;
}

.bt-vanessa__msg {
    word-wrap: break-word;
}

.bt-vanessa__msg--user {
    align-self: flex-end;
    max-width: 85%;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 16px;
    background: #222;
    color: #eee;
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
}

.bt-vanessa__msg--assistant {
    align-self: flex-start;
    max-width: 100%;
    margin-bottom: 16px;
    padding: 4px 0;
    background: transparent;
    color: #ccc;
    font-size: 16px;
    line-height: 1.65;
    white-space: pre-line;
}

.bt-vanessa__msg--assistant a {
    color: #888;
    text-decoration: underline;
}

.bt-vanessa__msg--assistant a:hover {
    color: #ccc;
}

.bt-vanessa__link {
    color: #888;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.bt-vanessa__link:hover {
    color: #ccc;
}

@keyframes bt-vanessa-reveal {
    from {
        clip-path: inset(0 0 100% 0);
        opacity: 0;
    }

    to {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
}

.bt-vanessa__msg--assistant.bt-vanessa__msg--reveal {
    animation: bt-vanessa-reveal 0.35s ease-out forwards;
}

.bt-vanessa__msg--assistant.bt-vanessa__msg--reveal-fast {
    animation: bt-vanessa-reveal 0.15s ease-out forwards;
}

.bt-vanessa__msg--typing {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px 0;
    max-width: 85%;
}

.bt-vanessa__msg--typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #888;
    opacity: 0.9;
    animation: bt-vanessa-typing-bounce 1.2s ease-in-out infinite;
}

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

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

@keyframes bt-vanessa-typing-bounce {
    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
    }
}
