/* ------------------------------ */
/* BOTTONCINO FLOTANTE MODERNO */
/* ------------------------------ */

#chatbot-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/*background: #ff3b30; */

#chatbot-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #25D366; /* verde WhatsApp */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    z-index: 9999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* ------------------------------ */
/* FINESTRA CHAT MODERNA */
/* ------------------------------ */
#chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 360px;
    height: 520px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9998;
}

#chatbot-window.open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* ------------------------------ */
/* HEADER CHAT */
/* ------------------------------ */
#chatbot-header {
    background: #ff3b30;
    color: white;
    padding: 12px;
    font-size: 17px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chatbot-close {
    cursor: pointer;
    font-size: 20px;
}

/* ------------------------------ */
/* AREA MESSAGGI */
/* ------------------------------ */

#chatbot-messages {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 12px;
    background: #f7f7f7;
    overflow-y: auto;
}

#messages-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* L'indicatore di digitazione resta sempre in fondo */
#typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto; /* forza a stare in fondo */
    flex-shrink: 0;
}




.message {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: flex-start;
}

.message.user {
    flex-direction: row-reverse;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.bubble {
    max-width: 70%;
    padding: 8px 12px;
    border-radius: 12px;
    white-space: pre-line;
    line-height: 1.35;
}

.message.user .bubble {
    background: #007bff;
    color: white;
}


.message.bot .bubble {
    background: #eaeaea;
    color: #333;
    text-align: justify;
    border-radius: 14px;
    padding: 12px 16px;
    line-height: 1.5;
}


/* ------------------------------ */
/* INPUT CHAT */
/* ------------------------------ */
#chatbot-input-area {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ddd;
    background: #fff;
}

#chatbot-input {
    flex: 1;
    border: none;
    padding: 10px;
    font-size: 15px;
    outline: none;
    border-radius: 8px;
    background: #f1f1f1;
}

#chatbot-send {
    background: #ff3b30;
    color: white;
    border: none;
    padding: 0 14px;
    margin-left: 6px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
}

/* ------------------------------ */
/* TYPING INDICATOR */
/* ------------------------------ */


.typing-bubble {
    background: #eaeaea;
    padding: 6px 12px;
    border-radius: 12px;
    display: flex;
    gap: 6px;
}

.typing-bubble span {
    width: 8px;
    height: 8px;
    background: #555;
    border-radius: 50%;
    display: inline-block;
    opacity: 0.3;
    animation: typing-dot 1.4s infinite ease-in-out;
}

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

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

@keyframes typing-dot {
    0% { opacity: 0.2; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-4px); }
    100% { opacity: 0.2; transform: translateY(0); }
}

/* ------------------------------ */
/* ANIMAZIONE PULSANTE */
/* ------------------------------ */
.animated-btn {
    width: 60px;
    height: 60px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.paused {
    animation-play-state: paused !important;
}



