
/* Stile dell'icona del chatbot */
.chatbot-icon {
    position: fixed;
    bottom: 80px;
    right: 5px;
    width: 60px;
    height: 60px;
    background-color: #8dc63f;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000; /* Assicura che sia sopra gli altri elementi */
}

.chatbot-icon img {
    width: 35px;
    height: 35px;
    filter: invert(100%); /* Rende l'icona bianca se è un'immagine SVG scura */
}

/* Stile della finestra popup del chatbot */
.chatbot-popup {
    position: fixed;
    bottom: 90px; /* Sopra l'icona */
    right: 20px;
    width: 350px;
    height: 450px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
    display: none; /* Inizialmente nascosto */
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
}

.chatbot-popup.open {
    display: flex;
}

.chatbot-header {
    background-color: #8dc63f;
    color: #fff;
    padding: 15px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.1em;
}

.chatbot-header .close-btn {
    font-size: 1.5em;
    cursor: pointer;
}

.chatbot-messages {
    flex-grow: 1; /* Occupa lo spazio disponibile */
    padding: 15px;
    overflow-y: auto; /* Abilita lo scroll se i messaggi superano l'altezza */
    background-color: #e5ddd5; /* Colore di sfondo stile WhatsApp */
}

.message {
    max-width: 80%;
    padding: 10px 12px;
    border-radius: 15px;
    margin-bottom: 10px;
    word-wrap: break-word;
    font-size: 0.9em;
}

.message.received {
    background-color: #fff;
    align-self: flex-start; /* Allinea a sinistra */
    border-bottom-left-radius: 2px;
}

.message.sent {
    background-color: #dcf8c6; /* Colore dei messaggi inviati stile WhatsApp */
    align-self: flex-end; /* Allinea a destra */
    margin-left: auto; /* Sposta a destra */
    border-bottom-right-radius: 2px;
}

.chatbot-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eee;
    background-color: #f7f7f7;
}

.chatbot-input input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    margin-right: 10px;
    outline: none;
}

.chatbot-input button {
    background-color: #8dc63f;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s ease;
}

.chatbot-input button:hover {
    background-color: #6B9630;
}
/***********************
*   NEW SPINNER
***********************/
.default_spinner {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border-top: 3.3px solid;
    border-color: #8dc63f transparent;
    animation: spin .7s linear infinite;
    -webkit-animation: spin .7s linear infinite;
}
.sm-spinner {
    width: 1rem;
    height: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg)
    }

    100% {
        transform: rotate(359deg)
    }
}
.spinner_position {
    position: absolute;
    top: 20%;
    left: 50%;
    margin-top: 1rem;
}
/***********************
*   LINE SPINNER - ALTERNATIVE SPINNER
***********************/
.line-spinner {
    margin-top: .5rem;
    width: .6rem;
    height: 1.5rem;
    background: #74a4ff;
    animation: line-spinner 1s ease-in-out infinite;
    animation-delay: 0.4s;
    border-radius: 8px;
}

    .line-spinner:after,
    .line-spinner:before {
        border-radius: 8px;
        content: "";
        position: absolute;
        width: .6rem;
        height: 1.5rem;
        background: #74a4ff;
        animation: line-spinner 1s ease-in-out infinite;
    }

    .line-spinner:before {
        right: .8rem;
        animation-delay: 0.15s;
    }

    .line-spinner:after {
        left: .8rem;
        animation-delay: 0.6s;
    }

@keyframes line-spinner {
    0%, 100% {
        background-color: #74a4ff;
        box-shadow: 0 0 0 #74a4ff, 0 0 0 #74a4ff;
    }

    50% {
        background-color: #0052ec;
        box-shadow: 0 -15px 0 #0052ec, 0 15px 0 #0052ec;
    }
}