.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    transition: all 0.3s ease;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-widget.expanded {
    width: 350px;
    height: 450px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 20px;
    right: 20px;
}

.chat-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    background-color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: width 0.3s ease;
    flex-shrink: 0;
}

.chat-widget.expanded .chat-header {
    width: 100%;
    padding: 5px 15px;
    position: relative;
}

.assistant-icon {
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: transform 0.2s ease;
    display: block;
    background: none;
}

.chat-widget.expanded .assistant-icon {
    transform: scale(0.8);
    margin-right: 10px;
}

.chat-container {
    display: none;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 15px 15px 0;
    margin: 0;
    max-height: calc(100% - 120px); /* Ajustado para header (60px) + input (60px) */
    box-sizing: border-box;
}

.chat-widget.expanded .chat-container {
    display: flex;
    flex-direction: column;
}

.input-container {
    display: none;
    padding: 10px;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
    box-sizing: border-box;
}

.chat-widget.expanded .input-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#inputText {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

#inputText:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

#sendButton {
    padding: 10px 20px;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

#sendButton:hover {
    background: #0069d9;
    transform: translateY(-1px);
}

#sendButton.shrinking {
    transform: scale(0.9);
}

#sendButton.reappear {
    animation: reappear 0.5s ease;
}

@keyframes reappear {
    0% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.chevron-down {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    display: none;
    transition: transform 0.3s ease;
}

.chat-widget.expanded .chevron-down {
    display: block;
}

.chevron-down svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
}

.chat-widget.expanded .chevron-up svg {
    transform: rotate(180deg);
}

.message {
    margin: 8px 0;
}

.user-message {
    margin-left: auto;
    margin-right: 10px;
    padding: 10px 15px;
    background: #e0f7fa;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 100%;
    text-align: right;
}

.bot-message {
    margin-left: 10px;
    margin-right: 10px;
    padding: 0;
    max-width: 100%;
}
.bot-message-container {
    display: flex;
    align-items: start; /* Alinha verticalmente a imagem e o balão */
    margin-bottom: 10px;
}
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    transition: all 0.3s ease;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-widget.expanded {
    width: 350px;
    height: 450px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 20px;
    right: 20px;
}

.chat-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    background-color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: width 0.3s ease;
    flex-shrink: 0;
}

.chat-widget.expanded .chat-header {
    width: 100%;
    padding: 5px 15px;
    position: relative;
}

.chat-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    background-color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: width 0.3s ease;
    flex-shrink: 0;
    overflow: visible; /* Garante que as ondas não sejam cortadas */
}

.chat-widget.expanded .chat-header {
    width: 100%;
    padding: 5px 15px;
    position: relative;
}

.assistant-icon {
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: transform 0.2s ease;
    display: block;
    background: none;
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 1;
}

.chat-widget.expanded .assistant-icon {
    transform: scale(0.8);
    margin-right: 10px;
    position: relative;
    top: auto;
    left: auto;
}

.assistant-icon.wave-effect {
    animation: waveAnimation 2s infinite;
}

@keyframes waveAnimation {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.6); /* Amarelo vívido */
    }
    40% {
        box-shadow: 0 0 0 15px rgba(255, 215, 0, 0);
    }
    80% {
        box-shadow: 0 0 0 30px rgba(255, 215, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* Estilos existentes mantidos... */
.bot-message-container {
    display: flex;
    align-items: start;
    margin-bottom: 10px;
}

.assistant-icon-mini {
    margin-right: 10px;
    flex-shrink: 0;
}

.balloon {
    background-color: #f5f5f5;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    word-wrap: break-word;
}

.balloon:after {
    content: '';
    position: absolute;
    left: -10px;
    top: 10px;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 10px solid #f5f5f5;
}

/* Outros estilos (chat-container, input-container, etc.) permanecem os mesmos */

.balloon {
    background-color: #e0f7fa;
    padding: 10px;
    border-radius: 10px;
    max-width: 70%;
    word-wrap: break-word; /* Garante que o texto quebre corretamente */
}
.balloon {
    position: relative;
    background: #f5f5f5;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    word-wrap: break-word;
}

.balloon:after {
    content: '';
    position: absolute;
    left: -10px;
    top: 10px;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 10px solid #f5f5f5;
}

.balloon img, .balloon video {
    max-width: 100%;
    height: auto;
    display: block;
    margin-top: 10px;
}

.typing-message {
    color: #888;
    font-style: italic;
    margin-left: 70px;
}

.typing-dots span {
    animation: blink 1s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 20% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.chat-widget.expanded::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Fundo esmaecido */
    z-index: -1; /* Fica atrás do chat */
    display: none; /* Escondido por padrão */
}

/* Responsividade para telas menores */
@media (max-width: 400px) {
    body {
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .chat-widget.expanded {
        width: 100dvw !important;
        height: 100dvh !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        position: fixed !important;
        z-index: 10000 !important;
    }

    .chat-widget.expanded::before {
        display: block; /* Exibe o fundo esmaecido apenas em dispositivos móveis */
    }

    .chat-container {
        max-height: calc(100dvh - 120px) !important;
        margin: 0 !important;
        padding: 10px 10px 0 !important;
        overflow-y: auto !important;
        box-sizing: border-box !important;
    }

    .input-container {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 10px !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .bot-message {
        margin-left: 60px !important;
    }

    .chat-header {
        width: 100% !important;
        padding: 5px !important;
        box-sizing: border-box !important;
    }

    .assistant-icon {
        transform: scale(0.7) !important;
    }

    .chevron-down {
        top: 10px !important;
        right: 10px !important;
    }
}