﻿.chat-fab-left {
    position: fixed;
    bottom: 20px;
    right: 20px; /* alterado de left para right */
    background-color: #00ffff;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 0 12px #00ffff;
    padding: 12px; /* opcional para dar respiro ao ícone */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
    .chat-fab-left:hover {
        transform: scale(1.1);
        box-shadow: 0 0 12px #00ffffaa;
    }

    .chat-fab-left img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }


@media (max-width: 768px) {
    .chat-fab-left {
        bottom: 80px; /* mais alto para evitar rodapé */
        right: 16px;
        width: 60px;
        height: 60px;
    }

    .chat-container {
        bottom: 100px;
        width: 90%;
        right: 5%;
        left: 5%;
        transition: transform 0.4s ease, opacity 0.4s ease;
        transform: scale(0.95);
        opacity: 0;
        pointer-events: none;
    }
}

@media (min-width: 769px) {
    .chat-fab-left {
        bottom: 20px;
        right: 20px;
    }

    .chat-container {
        bottom: 100px;
        right: 20px;
    }
}

/* Container do chat */
.chat-container {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    position: fixed;
    bottom: 100px;
    right: 20px; /* alterado de left para right */
    width: 320px;
    height: 440px;
    background-color: #111;
    border: 1px solid #00ffff;
    border-radius: 10px;
    z-index: 1000;
    box-shadow: 0 0 12px #00ffff;
    /* Animação */
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

    .chat-container.open {
        display: flex;
        opacity: 1;
        transform: scale(1);
        transform: scale(1);
        opacity: 1;
        pointer-events: all;
    }


/* Cabeçalho do chat */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #0ff;
    color: #000;
    font-weight: bold;
    padding: 10px;
    border-radius: 10px 10px 0 0;
    font-size: 16px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #000;
}

/* Janela de mensagens */
.chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background-color: #000;
    color: #0ff;
    font-size: 14px;
    scroll-behavior: smooth;
}

    .chat-window::-webkit-scrollbar {
        width: 6px;
    }

    .chat-window::-webkit-scrollbar-thumb {
        background: #00ffff88;
        border-radius: 10px;
    }

/* Campo de entrada */
.chat-input {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #00ffff;
    align-items: stretch;
    flex-wrap: nowrap;
    overflow: hidden;
}

    .chat-input input {
        flex: 1 1 auto;
        min-width: 0; /* 💡 essencial para evitar quebra no botão */
        padding: 8px;
        border-radius: 6px;
        border: none;
        outline: none;
        background-color: #111;
        color: #0ff;
        font-size: 14px;
    }

    .chat-input button {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 8px 12px;
        border: none;
        background-color: #00ffff;
        color: #000;
        font-weight: bold;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

        .chat-input button:hover {
            background-color: #00cccc;
        }


/* Balões de mensagens */
.msg {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 12px;
    line-height: 1.4;
    font-size: 14px;
    word-wrap: break-word;
    white-space: pre-wrap;
    margin-bottom: 10px;
}

    .msg span {
        font-weight: bold;
        display: block;
        margin-bottom: 4px;
    }

    .msg.ia {
        align-self: flex-start;
        background-color: #0a0a0a;
        color: #0ff;
        border: 1px solid #0ff;
    }

    .msg.user {
        align-self: flex-end;
        background-color: #0ff;
        color: #000;
        border: 1px solid #0ff;
    }

.chat-header-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .chat-header-avatar img {
        width: 100px;
        height: 100px;
        border-radius: 10%;
        object-fit: cover;
        border: 1px solid #000;
    }

.msg-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
    flex-shrink: 0;
    border: 1px solid #0ff;
    float: left;
}

