/* Stile per il bottone flottante della chat */
.atb-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #0073aa;
    color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    transition: transform 0.2s ease-in-out, background-color 0.2s;
}

.atb-chat-button:hover {
    background-color: #005a87;
    transform: scale(1.1);
}

/* Stile per la finestra della chat (nascosta di default) */
.atb-chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 70vh;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s, visibility 0s 0.3s;
}

/* Stile per la finestra della chat quando è visibile */
.atb-chat-widget.atb-is-open {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s, visibility 0s;
}

/* Header della chat */
.atb-chat-header {
    background-color: #0073aa;
    color: white;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

#atb-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

/* Area dei messaggi */
.atb-chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Stile base per i messaggi */
.atb-message {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Messaggio dell'utente */
.atb-user-message {
    background-color: #0073aa;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Messaggio del bot */
.atb-bot-message {
    background-color: #e5e5ea;
    color: #202123;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.atb-bot-message.atb-error-message {
    background-color: #fbeaea;
    color: #c00;
}

/* Form di input */
.atb-chat-form {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

#atb-chat-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#atb-chat-input:focus {
    border-color: #0073aa;
}

.atb-chat-form button {
    margin-left: 10px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.atb-chat-form button:hover {
    background-color: #005a87;
}

/* Indicatore di digitazione "..." */
.atb-typing-indicator {
    padding: 10px 15px;
    display: flex;
    align-items: center;
}

.atb-typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #999;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: atb-typing-blink 1.4s infinite both;
}

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

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

@keyframes atb-typing-blink {
    0% {
        opacity: 0.2;
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: 0.2;
    }
}

/* Media query per schermi piccoli */
@media (max-width: 480px) {
    .atb-chat-widget {
        width: 100%;
        height: 100%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}