/* === STILI PER WEBITA CHAT PRO - VERSIONE PULITA === */

/* Animazioni per i messaggi */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    30% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Animazione nuvoletta pensiero */
@keyframes cloudFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes cloudPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Scrollbar personalizzata per l'area messaggi */
#webita-chat-pro-messages::-webkit-scrollbar {
    width: 4px;
}

#webita-chat-pro-messages::-webkit-scrollbar-track {
    background: transparent;
}

#webita-chat-pro-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

#webita-chat-pro-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Animazione per i messaggi */
.webita-message {
    animation: fadeInUp 0.4s ease-out;
}

.message {
    animation: messageSlideIn 0.3s ease-out;
}

/* Indicatore di digitazione con nuvoletta */
.chat-loading {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 10px 0;
    padding: 12px 16px;
    background: white;
    border-radius: 20px;
    border-bottom-left-radius: 6px;
    max-width: 75%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    margin-right: 40px;
    position: relative;
}

.chat-loading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-right-color: white;
    border-bottom: none;
    border-left: none;
}

.chat-loading::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -9px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-right-color: #e9ecef;
    border-bottom: none;
    border-left: none;
}

/* Nuvoletta di pensiero stilizzata - versione semplificata */
.thinking-cloud {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 10px 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    max-width: 80px;
    margin-right: 40px;
    position: relative;
}

.cloud-icon {
    position: relative;
    width: 60px;
    height: 35px;
    border-radius: 50px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
}

/* RIMUOVI questi pseudo-elementi che creano i pallini centrali */
/* 
.cloud-icon::before {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    border: 1px solid #e9ecef;
    border-radius: 50%;
    top: -12px;
    left: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.cloud-icon::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 1px solid #e9ecef;
    border-radius: 50%;
    top: -8px;
    right: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
}
*/

/* Piccole bolle di pensiero */
.thinking-cloud::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid #e9ecef;
    border-radius: 50%;
    bottom: -15px;
    left: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.thinking-cloud::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    border: 1px solid #e9ecef;
    border-radius: 50%;
    bottom: -25px;
    left: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Punti di sospensione animati all'interno della nuvoletta */
.cloud-icon .dots {
    display: flex;
    gap: 3px;
}

.cloud-icon .dot {
    width: 4px;
    height: 4px;
    background: #9BC332;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.cloud-icon .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.cloud-icon .dot:nth-child(3) {
    animation-delay: 0.4s;
}

.chat-loading .dot {
    width: 8px;
    height: 8px;
    background: #9BC332;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

.chat-loading .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-loading .dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Responsive design */
@media (max-width: 480px) {
    #webita-chat-pro-container {
        width: calc(100% - 20px) !important;
        height: calc(100% - 100px) !important;
        bottom: 10px !important;
        right: 10px !important;
        left: 10px !important;
        border-radius: 15px !important;
    }
    
    #webita-chat-pro-header {
        border-radius: 15px 15px 0 0 !important;
    }
    
    #webita-chat-pro-input-area {
        border-radius: 0 0 15px 15px !important;
    }
    
    .webita-chat-pro-footer {
        border-radius: 0 0 15px 15px !important;
    }
}

/* Stili per il footer "Powered by Webita" */
.webita-chat-pro-footer {
    padding: 8px 20px 15px 20px;
    text-align: center;
    /* background: white; ← Rimuovi questa riga */
    border-radius: 0 0 20px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.webita-chat-pro-footer a {
    /* color: #6c757d; ← Rimuovi questa riga */
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.webita-chat-pro-footer a:hover {
    color: #9BC332;
}

/* Transizioni generali */
.transition-all {
    transition: all 0.3s ease;
}

/* Utility classes */
.fade-in {
    animation: fadeInUp 0.4s ease-out;
}

.slide-in {
    animation: messageSlideIn 0.3s ease-out;
}

/* Nuvoletta messaggio automatico */
.auto-message-bubble {
    position: fixed;
    bottom: 90px;
    right: 20px;
    max-width: 250px;
    padding: 12px 16px;
    border-radius: 20px;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    line-height: 1.4;
    z-index: 999998;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    border: 2px solid;
}

.auto-message-bubble.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.auto-message-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-top-color: inherit;
    border-bottom: none;
    border-right: none;
}

/* Animazione di entrata chat */
#webita-chat-pro-container.auto-opening {
    animation: autoOpenChat 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes autoOpenChat {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animazione icona che pulsa prima dell'apertura */
#webita-chat-pro-icon.pre-opening {
    animation: preOpenPulse 2s ease-in-out infinite;
}

@keyframes preOpenPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(155, 195, 50, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(155, 195, 50, 0);
    }
}