/* Pulsante Flottante WhatsApp */
#whatsapp-chat .chat-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    cursor: pointer;
}

#whatsapp-chat .chat-button img {
    width: 35px;
    height: 35px;
}

/* Finestra Pop-Up della Chat */
#whatsapp-chat .chat-popup {
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 300px;
    max-height: 400px;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    z-index: 1000;
    transition: bottom 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

#whatsapp-chat .chat-popup.active {
    display: flex;
    bottom: 90px;
    opacity: 1;
}

/* Intestazione del Pop-Up */
#whatsapp-chat .chat-header {
    background-color: #25d366;
    color: #ffffff;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 10px 10px 0 0;
}

#whatsapp-chat .chat-header img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
}

#whatsapp-chat .chat-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: bold;
    color: #f1f1f1;
}

#whatsapp-chat .chat-header span {
    margin: 0;
    font-size: 12px;
    color: #f1f1f1;
}

/* Spostamento del pulsante di chiusura "X" */
#whatsapp-chat .close-button {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    background: none;
    border: none;
    cursor: pointer;
    align-self: flex-start;
    margin-left: auto;
}

/* Corpo del Pop-Up */
#whatsapp-chat .chat-body {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Spazio tra i messaggi */
}

#whatsapp-chat .message p {
    margin: 0;
    background: #f1f1f1;
    padding: 10px;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
}

/* Footer della Chat */
#whatsapp-chat .chat-footer {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

#whatsapp-chat .chat-footer input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    height: 40px; /* Altezza uniforme */
    box-sizing: border-box;
}

/* Pulsante di Invio */
#whatsapp-chat .send-button {
    width: 40px;
    height: 40px; /* Altezza uniforme con l'input */
    background-color: #25d366;
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

#whatsapp-chat .send-button img {
    width: 20px;
    height: 20px;
}

/* Puntini di "sta scrivendo" */
.message.typing {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: none; /* Rimuove lo sfondo grigio chiaro */
    padding: 0; /* Elimina il padding */
    border-radius: 50%; /* Non serve arrotondare */
    max-width: fit-content; /* Adatta la larghezza al contenuto */
    gap: 5px; /* Spaziatura tra i puntini */
    margin: 5px 0; /* Aggiusta lo spazio sopra e sotto */
}

.message.typing span {
    display: inline-block;
    width: 6px; /* Riduci dimensione puntini */
    height: 6px; /* Riduci dimensione puntini */
    background-color: #ccc;
    border-radius: 50%;
    animation: typing 1.5s infinite;
}

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

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

/* Animazione per i puntini */
@keyframes typing {
    0%, 80%, 100% {
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
}

.notification-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 10px;
    height: 10px;
    background-color: red;
    border-radius: 50%;
    display: none; /* Nascondi il pallino inizialmente */
    z-index: 1100; /* Sopra il pulsante */
}

.chat-button {
    position: relative;
}