/* Chat System Styles - Mindfulness */

/* Variáveis CSS para consistência com o tema existente */
:root {
    --chat-primary: #667eea;
    --chat-secondary: #764ba2;
    --chat-accent: #4CAF50;
    --chat-danger: #f44336;
    --chat-warning: #ff9800;
    --chat-background: #ffffff;
    --chat-surface: #f8f9fa;
    --chat-border: #e0e0e0;
    --chat-text: #333333;
    --chat-text-secondary: #666666;
    --chat-text-muted: #999999;
    --chat-shadow: 0 4px 20px rgba(0,0,0,0.1);
    --chat-shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
    --chat-radius: 12px;
    --chat-radius-small: 8px;
    --chat-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Botão flutuante do chat */
.chat-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-secondary) 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--chat-shadow);
    transition: var(--chat-transition);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--chat-shadow-hover);
}

.chat-toggle-btn.active {
    background: var(--chat-danger);
}

/* Badge de notificações */
.chat-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--chat-danger);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 15px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Janela principal do chat */
.chat-window {
    position: fixed;
    background: var(--chat-background);
    box-shadow: var(--chat-shadow-hover);
    display: none;
    flex-direction: column;
    z-index: 999;
    overflow: hidden;
    transition: var(--chat-transition);
       position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40%;
    height: 100vh;
    border-radius: 0;
    z-index: 9900;
}



.chat-window.active {
    display: flex;
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header do chat   background: linear-gradient(135deg, #2f2f2f 0%, #764ba2 100%);*/

.chat-header {
    background: linear-gradient(135deg, #764ba2 0%, #2f2f2f 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 10vh;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-header-actions {
    display: flex;
    gap: 10px;
    justify-content: end;
    width: auto;
    
}

.chat-header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--chat-transition);
}

.chat-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Abas do chat */
.chat-tabs {
    display: flex;
    background: var(--chat-surface);
    border-bottom: 1px solid var(--chat-border);
    margin-right: 20px;
}

.chat-tab {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--chat-text-secondary);
    transition: var(--chat-transition);
    position: relative;
}

.chat-tab:hover {
    background: rgba(102, 126, 234, 0.1);
}

.chat-tab.active {
    color: var(--chat-primary);
    background: var(--chat-background);
}

.chat-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    
    height: 2px;
    background: var(--chat-primary);
}

.chat-tab-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--chat-danger);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 12px;
    min-width: 17px;
    height: 18px;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
}

/* Conteúdo do chat */
.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-panel {
    flex: 1;
    display: none;
    flex-direction: column;
}

.chat-panel.active {
    display: flex;
}
/* Área de pesquisa */
.chat-search {
  padding: 15px;
  background: transparent; /* mantém integração com fundo escuro */
}

/* Campo de input */
.chat-search-input {
  width: 100%;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.08); /* fundo translúcido */
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--chat-radius-small);
  font-size: 14px;
  color: #f1f1f1; /* texto claro */
  outline: none;
  transition: all 0.25s ease;
}

/* Placeholder mais suave */
.chat-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Foco com destaque */
.chat-search-input:focus {
  border-color: var(--chat-primary, #667eea);
  box-shadow: 0 0 6px rgba(102, 126, 234, 0.4);
  background: rgba(255, 255, 255, 0.12); /* um pouco mais claro ao focar */
}

/* Lista de usuários online */
.chat-users-list {
      position: fixed;
    background: var(--chat-background);
    box-shadow: var(--chat-shadow-hover);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: var(--chat-transition);
       position: fixed;
    right: 0;
    bottom: 0;
    width: 40%;
    height: 90vh;
    border-radius: 0;
    z-index: 9901; 
}

.chat-user-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: var(--chat-transition);
}

.chat-user-item:hover {
    background: var(--chat-surface);
}

.chat-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
    align-items: center;
    justify-content: center;
}

.chat-user-status {
    position: flex;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;

}

.chat-user-status.online {
    background: var(--chat-accent);
}

.chat-user-status.offline {
    background: var(--chat-text-muted);
}

.chat-user-info {
    flex: 1;
}

.chat-user-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--chat-text);
    margin: 0;
    
margin-right: 6px;
}
.fundoUserOnline {
    display: flex;          /* 🔑 ativa flexbox */
    align-items: center;    /* alinha no eixo vertical */
    gap: 6px;               /* espaço entre avatar, nome e status */
    border-radius: 8px;     /* opcional, deixa arredondado */
    
}

.chat-user-last-seen {
    font-size: 12px;
    color: var(--chat-text-muted);
    margin: 0;
}


.fundoMensagens {
  height: 176px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column; /* normal */
}


/* Área de mensagens */
.chat-messages {
  display: inline-block;
    min-height: 176px; 
    
}

.fundoMensagens2 {
  height: 245px;            /* Altura fixa para ativar a rolagem */
  overflow-y: auto;         /* Rolagem vertical */
  padding: 10px;            /* Opcional: espaço interno */
}

/* Área de mensagens */
.chat-messages2 {
  display: inline-block;
     height: 235px;

    
}


    
.chat-content {
    height: 100vh;
}
.chat-panel {
    width: 100%;
}



.fundoMensagens {
  flex: 1 1 auto; /* <- ocupa todo o espaço entre header e input */
  overflow: hidden; /* não precisa de rolagem aqui */
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto; /* <- rolagem funciona */
  display: flex;
  flex-direction: column;
  padding: 10px;
  box-sizing: border-box;
}

.chat-input-area {
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #f8f8f8;
  border-top: 1px solid #ccc;
  display: flex;
  align-items: center;
  padding: 10px;
  box-sizing: border-box;
  z-index: 100;
}



.fundoMensagens2 {
  flex: 1 1 auto; /* <- ocupa todo o espaço entre header e input */
  overflow: hidden; /* não precisa de rolagem aqui */
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.chat-messages2 {
  flex: 1 1 auto;
  overflow-y: auto; /* <- rolagem funciona */
  display: flex;
  flex-direction: column;
  padding: 10px;
  box-sizing: border-box;
}






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

.chat-messages::-webkit-scrollbar-track {
    background: var(--chat-surface);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--chat-border);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--chat-text-muted);
}

/* Mensagem individual */
.chat-message {
    display: flex;
    gap: 10px;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.own {
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

.chat-message-content {
    flex: 1;
    max-width: 70%;
}

.chat-message.own .chat-message-content {
    align-items: flex-end;
}

.chat-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.chat-message.own .chat-message-header {
    justify-content: flex-end;
}

.chat-message-sender {
    font-weight: 500;
    font-size: 13px;
    color: var(--chat-text);
}

.chat-message-time {
    font-size: 11px;
    color: var(--chat-text-muted);
}

.chat-message-bubble {
    background: var(--chat-surface);
    padding: 10px 15px;
    border-radius: var(--chat-radius-small);
    word-wrap: break-word;
    position: relative;
}

.chat-message.own .chat-message-bubble {
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-secondary) 100%);
    color: white;
}

.chat-message-text {
  display: block;
  max-width: 100%;           /* Não ultrapassa a largura do container/página */
  box-sizing: border-box;    /* Inclui padding/borda no cálculo da largura */
  word-wrap: break-word;     /* Quebra palavras longas */
  overflow-wrap: break-word; /* Compatibilidade com navegadores */
  white-space: normal;       /* Permite múltiplas linhas */
}

.chat-message-text img,
.chat-message-text a,
.chat-message-text .chat-link-preview {
  max-width: 100%;           /* Não ultrapassa a largura do container */
  height: auto;              /* Mantém proporção das imagens */
  display: block;            /* Evita que imagens flutuem fora do fluxo */
}

.chat-message-text .chat-link-details {
  overflow-wrap: break-word; /* Quebra texto longo dentro do preview */
}


/* Preview de links */
.message-previews {
    margin-top: 10px;
}

.link-preview {
    border: 1px solid var(--chat-border);
    border-radius: var(--chat-radius-small);
    overflow: hidden;
    background: var(--chat-background);
    cursor: pointer;
    transition: var(--chat-transition);
}

.link-preview:hover {
    box-shadow: var(--chat-shadow);
}

.link-preview-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.link-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-preview-content {
    padding: 12px;
}

.link-preview-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}

.link-preview-type-icon {
    font-size: 12px;
}

.link-preview-domain {
    font-size: 11px;
    color: var(--chat-text-muted);
    text-transform: uppercase;
    font-weight: 500;
}

.link-preview-title {
    font-weight: 500;
    font-size: 14px;
    color: var(--chat-text);
    margin-bottom: 5px;
    line-height: 1.3;
}

.link-preview-description {
    font-size: 12px;
    color: var(--chat-text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.link-preview-url {
    font-size: 11px;
    color: var(--chat-text-muted);
    font-family: monospace;
}

.link-preview-actions {
    padding: 8px 12px;
    border-top: 1px solid var(--chat-border);
    background: var(--chat-surface);
}

.link-preview-open {
    background: var(--chat-primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: var(--chat-radius-small);
    font-size: 12px;
    cursor: pointer;
    transition: var(--chat-transition);
}

.link-preview-open:hover {
    background: var(--chat-secondary);
}

/* Campo de entrada */
.chat-input-area {
    padding: 15px;
    border-top: 1px solid var(--chat-border);
    background: var(--chat-background);
}

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

.chat-input {
    flex: 1;
    min-height: 40px;
    max-height: 100px;
    padding: 10px 15px;
    border: 1px solid var(--chat-border);
    border-radius: var(--chat-radius-small);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: var(--chat-transition);
}

.chat-input:focus {
    border-color: var(--chat-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-secondary) 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--chat-transition);
}

.chat-send-btn:hover {
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Lista de conversas */
.chat-conversations {
    display: flex;
    overflow-x: auto; /* scroll horizontal */
    overflow-y: hidden;
    white-space: nowrap;
    height: 80px;
    align-items: center;
    background-color: #eceaea   ;
}
.fundoUser {
    flex: 0 0 auto; /* Mantém o item com largura fixa no flex container */
    display: flex;
    align-items: center; /* Centraliza os itens verticalmente */
    padding: 12px 15px;
    cursor: pointer;    
    gap: 10px;
    width: 100%;
}

.chat-conversation-item {
    flex: 0 0 auto; /* Mantém o item com largura fixa no flex container */
    display: flex;
    align-items: center; /* Centraliza os itens verticalmente */
    padding: 12px 15px;
    cursor: pointer;
    
    /* Transição suave para todas as propriedades */
    transition: all 0.3s ease; 

    border: none; /* Remove a borda antiga para um visual mais limpo */
    height: 50px; /* Ajustei a altura para um valor fixo, fica melhor com o padding */
    margin-right: 15px;
    width: 200px;
    border-radius: 12px; /* Um raio um pouco menor costuma ser mais elegante */
    background-color: #f0f2f5; /* Um fundo mais neutro, como o do Facebook */

    /* A MÁGICA ACONTECE AQUI: Sombra suave em camadas */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 
                0 2px 4px rgba(0, 0, 0, 0.05);
}

.chat-conversation-item:hover {
    background-color: #e4e6eb; /* Um cinza um pouco mais escuro para o hover */
    
    /* Aumenta a sombra no hover para dar um efeito de "elevação" */
    transform: translateY(-2px); /* Move o card um pouco para cima */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 
                0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Opcional: Adiciona um estado "ativo" para a conversa selecionada */
.chat-conversation-item.active {
    background-color: #e7f3ff; /* Azul claro para indicar seleção */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
}


.chat-conversation-item.active {
    background: rgba(102, 126, 234, 0.1);
    border-left: 3px solid var(--chat-primary);
width: 200px;

}

.chat-conversation-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
}

.chat-conversation-info {
    flex: 1;
    min-width: 0;
}

.chat-conversation-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--chat-text);
    margin: 0 0 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #232323;
}

.chat-conversation-last-message {
    font-size: 12px;
    color: var(--chat-text-secondary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    
}

.chat-conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.chat-conversation-time {
    font-size: 11px;
    color: var(--chat-text-muted);
}

.chat-conversation-unread {
    background: var(--chat-danger);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    display: none;
    align-items: center;
    justify-content: center;
}

.chat-conversation-unread.show {
    display: flex;
}

/* Modal de perfil */
.chat-profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.chat-conversation-badge {
    color: #f44336;
    font-size: 10px;
}
.chat-profile-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.chat-profile-content {
    background: var(--chat-background);
    border-radius: var(--chat-radius);
    padding: 30px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-profile-header {
    text-align: center;
    margin-bottom: 20px;
}

.chat-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: block;
        cursor: pointer;

}

.chat-profile-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--chat-text);
    margin: 0 0 5px 0;
    cursor: pointer;
}

.chat-profile-email {
    font-size: 14px;
    color: var(--chat-text-secondary);
    margin: 0;
        cursor: pointer;

}

.chat-profile-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
        cursor: pointer;

}

.chat-profile-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--chat-radius-small);
    cursor: pointer;
    font-size: 14px;
    transition: var(--chat-transition);
}

.chat-profile-btn.primary {
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-secondary) 100%);
    color: white;
}

.chat-profile-btn.secondary {
    background: var(--chat-surface);
    color: var(--chat-text);
    border: 1px solid var(--chat-border);
}

.chat-profile-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--chat-shadow);
}

/* Notificações visuais */
.chat-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--chat-background);
    border: 1px solid var(--chat-border);
    border-radius: var(--chat-radius);
    padding: 15px;
    box-shadow: var(--chat-shadow-hover);
    z-index: 10000;
    max-width: 300px;
    cursor: pointer;
    transition: var(--chat-transition);
}

.chat-notification:hover {
    transform: translateY(-2px);
}

.chat-notification-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.chat-notification-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.chat-notification-info {
    flex: 1;
}

.chat-notification-sender {
    font-weight: 500;
    font-size: 14px;
    color: var(--chat-text);
    margin: 0;
}

.chat-notification-type {
    font-size: 12px;
    color: var(--chat-text-secondary);
    margin: 0;
}

.chat-notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--chat-text-muted);
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-notification-message {
    font-size: 13px;
    color: var(--chat-text);
    line-height: 1.4;
}

/* Configurações do chat */
.chat-settings {
    padding: 15px;
}

.chat-setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--chat-border);
}

.chat-setting-item:last-child {
    border-bottom: none;
}

.chat-setting-label {
    font-size: 14px;
    color: var(--chat-text);
}

.chat-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--chat-border);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--chat-transition);
}

.chat-toggle.active {
    background: var(--chat-primary);
}

.chat-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: var(--chat-transition);
}

.chat-toggle.active::after {
    transform: translateX(20px);
}

/* Estados vazios */
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--chat-text-muted);
}

.chat-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.chat-empty-title {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 8px 0;
}

.chat-empty-description {
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}


/* Responsividade */
@media (max-width: 1000px) {
    .chat-window {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height:100%;
        border-radius: 0;
    z-index: 9900; /* garante que fica acima de tudo */

    }
    
    .chat-toggle-btn {
        bottom: 120px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
    
    .chat-profile-content {
        width: 95%;
        padding: 20px;
    }
    
    .chat-notification {
        left: 10px;
        right: 10px;
        max-width: none;
    }

    
.chat-content {
    height: 100%;
}
.chat-panel {
    width: 100%;
}
.chat-search {
    overflow: hidden;
    width: 100%;
}


.fundoMensagens {
  flex: 1 1 auto; /* <- ocupa todo o espaço entre header e input */
  overflow: hidden; /* não precisa de rolagem aqui */
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto; /* <- rolagem funciona */
  display: flex;
  flex-direction: column;
  padding: 10px;
  box-sizing: border-box;
}

.chat-input-area {
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #f8f8f8;
  border-top: 1px solid #ccc;
  display: flex;
  align-items: center;
  padding: 10px;
  box-sizing: border-box;
  z-index: 100;
}



.fundoMensagens2 {
  flex: 1 1 auto; /* <- ocupa todo o espaço entre header e input */
  overflow: hidden; /* não precisa de rolagem aqui */
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.chat-messages2 {
  flex: 1 1 auto;
  overflow-y: auto; /* <- rolagem funciona */
  display: flex;
  flex-direction: column;
  padding: 10px;
  box-sizing: border-box;
}





}

/* Animações adicionais */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Estados de carregamento */
.chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.chat-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--chat-border);
    border-top: 2px solid var(--chat-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

