/* Botão flutuante estilo círculo */
.chat-bubble {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: #5865F2;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999;
    animation: pulse 2s infinite; /* efeito de pulsar */
    transition: transform 0.2s ease, background 0.2s ease;
}

/* Hover */
.chat-bubble:hover {
    transform: scale(1.15);
    background: #4752C4;
    animation: none; /* pausa pulsar no hover */
}

/* Ícone Discord dentro do balão */
.chat-bubble i {
    pointer-events: none;
}

/* Badge de notificações */
.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ED4245;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: blink 1s infinite;
}

/* Animação de piscada da badge */
@keyframes blink {
    0%,50%,100% { opacity: 1; }
    25%,75% { opacity: 0; }
}

/* Pulsar suave do balão */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* Janela de chat */
.chat-window {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 320px;
    height: 400px;
    background: #36393F;
    border-radius: 8px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 9998;
}

/* Cabeçalho */
.chat-header {
    background: #2F3136;
    color: #FFF;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    font-weight: 500;
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}
.chat-header .header-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}
.chat-header .header-name { font-weight: bold; }
.chat-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #72767D;
    font-size: 1.2rem;
    cursor: pointer;
}
.chat-close:hover { color: #FFF; }

/* Mensagens */
.chat-messages {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: #202225; border-radius: 3px; }

.chat-message {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.chat-message .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}
.message-body {
    display: flex;
    flex-direction: column;
    max-width: 240px;
}
.username {
    font-size: 0.75rem;
    color: #00AFF4;
    margin-bottom: 2px;
    font-weight: 500;
}
.message-body .text {
    background: #40444B;
    color: #FFF;
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 0.85rem;
    display: inline-block;
    margin-bottom: 2px;
    word-wrap: break-word;
}
.message-body .time {
    font-size: 0.65rem;
    color: #72767D;
    align-self: flex-end;
    margin-right: 2px;
}

/* Mensagem convite Discord */
.chat-message.discord-invite .text {
    background: #5865F2;
    color: #FFF;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    border-radius: 5px;
    padding: 8px 10px;
    transition: background 0.2s, transform 0.1s;
}
.chat-message.discord-invite .text:hover {
    background: #4752C4;
    transform: scale(1.03);
}
.chat-message.discord-invite .text strong {
    text-decoration: underline;
}
