/* ===== ESTILOS ADICIONAIS PARA CHAT PÚBLICO ===== */

/* Mensagens de outros usuários */
.message.other {
    justify-content: flex-start;
}

.message-content {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.message-user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    padding-left: 4px;
}

.message-avatar {
    font-size: 16px;
}

.message-username {
    font-size: 12px;
    font-weight: 600;
}

.message.other .message-bubble {
    background: rgba(102, 126, 234, 0.08);
    color: #333;
    border-bottom-left-radius: 4px;
    border-left: 3px solid #667eea;
}

.message-text {
    word-wrap: break-word;
    line-height: 1.4;
}

/* Contador de usuários online */
.chat-online-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
    margin-top: 3px;
}

.online-indicator {
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

/* Nome do usuário no header */
.chat-user-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    font-size: 13px;
    opacity: 0.95;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
}

/* Indicador de digitação melhorado */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 18px;
    width: fit-content;
    margin-bottom: 15px;
    border-left: 3px solid #667eea;
}

.typing-avatar {
    font-size: 16px;
}

.typing-name {
    font-size: 12px;
    font-weight: 600;
}

.typing-dots {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #667eea;
    border-radius: 50%;
    animation: typing-anim 1.4s infinite;
}

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

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

/* Badge de novo usuário */
.new-user-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 5px;
    font-weight: 600;
}

/* Lista de usuários online (opcional) */
.online-users-list {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 12px;
    margin-top: 8px;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10000;
    display: none;
}

.online-users-list.active {
    display: block;
    animation: fadeIn-chat 0.2s ease;
}

.online-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.online-user-item:hover {
    background: #f5f5f5;
}

.online-user-avatar {
    font-size: 20px;
}

.online-user-name {
    font-size: 13px;
    font-weight: 500;
}

.online-user-status {
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    margin-left: auto;
}

/* Mensagem do sistema */
.system-message {
    text-align: center;
    padding: 8px 16px;
    margin: 15px 0;
    font-size: 12px;
    color: #666;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    animation: fadeIn-chat 0.3s ease;
}

.system-message .user-joined {
    color: #2ecc71;
    font-weight: 600;
}

.system-message .user-left {
    color: #e74c3c;
    font-weight: 600;
}

/* Melhorias visuais */
.message.user .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.message.other .message-bubble {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Animação para novas mensagens */
@keyframes slideInMessage {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message {
    animation: slideInMessage 0.3s ease;
}

/* Highlight quando mencionado */
.message.mentioned {
    position: relative;
}

.message.mentioned::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #f39c12;
    border-radius: 2px;
}

/* Reações rápidas (opcional) */
.message-reactions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.reaction-item {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.reaction-item:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.reaction-emoji {
    font-size: 14px;
}

.reaction-count {
    font-size: 11px;
    font-weight: 600;
    color: #666;
}

/* Botão de mudança de nome */
.change-name-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
}

.change-name-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Toast de notificação */
.chat-toast {
    position: fixed;
    bottom: 110px;
    right: 30px;
    background: white;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    animation: slideInToast 0.3s ease;
}

@keyframes slideInToast {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-avatar {
    font-size: 20px;
}

.toast-content {
    display: flex;
    flex-direction: column;
}

.toast-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 12px;
    color: #666;
}

/* Responsivo */
@media (max-width: 480px) {
    .message-content {
        max-width: 85%;
    }
    
    .chat-toast {
        right: 20px;
        bottom: 90px;
        left: 20px;
    }
}
