/* Estrutura Principal */
.chat-container {
    display: flex;
    height: calc(100vh - 120px); /* Ajustar altura conforme necessário */
    border: 1px solid #e0e0e0;
    background-color: #f9f9f9;
}

.chat-sidebar {
    width: 30%;
    min-width: 280px;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

.chat-main {
    width: 70%;
    display: flex;
    flex-direction: column;
}

/* Sidebar */
.sidebar-header {
    padding: 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.search-bar {
    width: 100%;
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid #ccc;
    outline: none;
}

.contact-list {
    overflow-y: auto;
    flex-grow: 1;
}

.contact-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.contact-item:hover {
    background-color: #f5f5f5;
}

.contact-item.active {
    background-color: #e8f0fe; /* Cor de fundo para item ativo */
}

.avatar-container {
    position: relative;
    margin-right: 15px;
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

.status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
}

.status-indicator.online {
    background-color: #25d366; /* Verde */
}

.status-indicator.offline {
    background-color: red; /* Vermelho */
}

.contact-details {
    flex-grow: 1;
    overflow: hidden;
}

.contact-name {
    font-weight: bold;
    white-space: nowrap;
}

.last-message {
    font-size: 0.9em;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 10px;
}

.contact-time {
    font-size: 0.8em;
    color: #999;
}

.unread-badge {
    background-color: #25d366; /* Cor verde do WhatsApp */
    color: white;
    font-size: 0.75em;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 5px;
}

/* Área Principal do Chat */
.chat-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
}

.chat-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-image: url('../img/bkg-msg.jpg');
    background-size: cover;
    background-position: center;
    height: calc(100% - 140px);
}

.chat-footer {
    display: flex;
    padding: 10px;
    background-color: #f0f0f0;
}

.chat-footer input {
    flex-grow: 1;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid #ccc;
    margin-right: 10px;
    outline: none;
}

.chat-footer button {
    padding: 10px 15px;
    border-radius: 50%;
    border: none;
    background-color: #128C7E; /* Cor principal da aplicação */
    color: white;
    cursor: pointer;
    font-size: 1.2em;
}

.chat-footer button:hover {
    background-color: #075E54; /* Tom mais escuro */
}

/* Bolhas de Mensagem */
.message {
    display: flex;
    margin-bottom: 15px;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.message-bubble p {
    margin: 0;
    word-wrap: break-word;
}

.timestamp {
    font-size: 0.75em;
    color: #999;
    display: block;
    text-align: right;
    margin-top: 5px;
}

/* Mensagens Enviadas */
.message.sent {
    justify-content: flex-end;
}

.message.sent .message-bubble {
    background-color: #dcf8c6; /* Verde claro do WhatsApp */
    border-bottom-right-radius: 0;
}

/* Mensagens Recebidas */
.message.received {
    justify-content: flex-start;
}

.message.received .message-bubble {
    background-color: #f1f1f1; /* Cinza claro em vez de branco */
    border-bottom-left-radius: 0;
}

/* Tela de "Nenhuma conversa selecionada" */
.no-chat-selected {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    color: #777;
    background-color: #f9f9f9;
}

/* Estilos do Popup do Colaborador */
.collaborator-popup {
    padding: 20px;
    text-align: center;
    min-height: 200px; /* Para dar espaço ao spinner */
}

.collaborator-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 3px solid #ddd;
}

.collaborator-popup h3 {
    margin-bottom: 15px;
    font-size: 1.5em;
    color: #333;
}

.collaborator-popup p {
    margin-bottom: 8px;
    font-size: 1em;
    color: #555;
    text-align: left;
}

.collaborator-popup p strong {
    color: #111;
    margin-right: 5px;
}