/* Botão Flutuante */
.chat-widget-toggle {
    position: fixed;
    bottom: 90px;
    /* Acima do botão do WhatsApp */
    right: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: transform 0.3s;
    animation: pulse 2s infinite;
}

.chat-widget-toggle i {
    color: white;
    font-size: 28px;
}

.chat-widget-toggle:hover {
    transform: scale(1.1);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(118, 75, 162, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(118, 75, 162, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(118, 75, 162, 0);
    }
}

/* Janela do Chat */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 90px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-window.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-header small {
    display: block;
    font-size: 11px;
    opacity: 0.8;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
}

/* Body */
.chat-body {
    flex: 1;
    padding: 15px;
    background: #f9f9f9;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.message.bot {
    background: white;
    color: #333;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    align-self: flex-start;
}

.message.user {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 2px;
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
    align-self: flex-end;
}

.message .time {
    font-size: 9px;
    opacity: 0.5;
    margin-top: 5px;
    text-align: right;
    display: block;
}

/* Typing Indicator */
.typing {
    align-self: flex-start;
    background: white;
    padding: 10px 15px;
    border-radius: 15px;
    border-bottom-left-radius: 2px;
    display: none;
    gap: 5px;
}

.typing span {
    width: 6px;
    height: 6px;
    background: #ccc;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Footer */
.chat-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.chat-footer input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

.chat-footer input:focus {
    border-color: #667eea;
}

.chat-footer button {
    background: #667eea;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-footer button:hover {
    background: #764ba2;
}

@media (max-width: 480px) {
    .chat-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .chat-widget-toggle {
        bottom: 80px;
    }
}