/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.chat-bubble {
    position: relative;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    padding: 15px 20px;
    border-radius: 20px 20px 5px 20px;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
    max-width: 280px;
    margin-bottom: 15px;
    animation: slideInBubble 0.5s ease-out 1s both;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-bubble:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.5);
}

.chat-bubble::before {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #8b5cf6;
}

.chat-bubble-text {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.chat-bubble-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 0.7rem;
}

.chat-bubble:hover .chat-bubble-close {
    opacity: 1;
}

.chat-bubble-close:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.chat-button {
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    border: none;
    color: white;
    font-size: 1.5rem;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(37, 211, 102, 0.6);
    background: #20BA5A;
}

/* Animações */
@keyframes slideInBubble {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 10px 40px rgba(37, 211, 102, 0.6), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }
}

/* Typing Animation */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    margin-left: 5px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* Responsivo */
@media (max-width: 768px) {
    .chat-widget {
        bottom: 20px;
        right: 20px;
    }
    
    .chat-bubble {
        max-width: 240px;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .chat-button {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
}

/* Esconder quando fechado */
.chat-bubble.hidden {
    display: none;
}
