@import url("../variavel_css/variavel.css");

html, body {
  height: 100%;
  padding: 0;
  margin: 0;
  bottom: 0;
  box-sizing: border-box;
  font-family: 'Roboto', sans-serif;
}

.comunidade_container {
  display: flex;
  width: 100%;
  min-height: 100vh;
  max-width: 85%;
  margin: 0 auto;
  padding: 20px;
}

#barra_lateral {
  width: 20%;
  background-color: var(--fundo-branco-cinzaDark);
  box-shadow: 1px 1px 4px var(--pretoTransparente-cinzaDark10);
  padding: 20px;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
    max-height: 100%;
}

#barra_lateral h1 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: var(--texto-preto-branco);
}

.menu_comunidade {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu_comunidade li {
  padding: 12px 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
  color: var(--texto-preto-branco);
  display: flex;
  align-items: center;
  gap: 15px;
}

.menu_comunidade li:hover {
  background-color: var(--hover-cinzaUsuario-cinzaDark60);
}

.menu_comunidade li.ativo {
  background-color: var(--fundo-cinzaDark15-cinzaDark60);
  color: var(--texto-preto-branco);
  font-weight: bold;
}

#listaConversas {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: max-content;
  overflow-y: overlay;
}

.item_contato {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  cursor: pointer;
  border-radius: 10px;
  transition: 0.2s ease;
  color: var(--texto-preto-branco);
  overflow: hidden;
}

.item_contato:hover {
  background-color: var(--hover-cinzaUsuario-cinzaDark60);
}

.foto_contato {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--fundo-verdeDomus-cinzaDark60);
}

/* Container do nome + última mensagem */
.info_contato {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

/* Nome do usuário */
.info_contato strong {
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--texto-preto-branco);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Última mensagem */
.preview_msg {
  font-size: 0.82rem;
  color: var(--texto-preto-brancoSecundario);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Horário da última mensagem */
.hora_msg {
  font-size: 0.75rem;
  color: var(--texto-preto-brancoSecundario);
  flex-shrink: 0;
}


/* ----- Conteúdo Principal ----- */
.conteudo_comunidade {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: inherit;
  max-width: 100%;
}

.conteudo {
  display: none;
  max-width: 100%;
  width: 100%;
}

.conteudo.ativo {
  display: block;
  max-width: 100%;
}

.titulo_conteudo {
  font-size: 27px;
  font-weight: bold;
  text-align: center;
  color: var(--texto-preto-branco);
}

/* =====================================================
   🔹 RESPONSIVIDADE PARA CELULAR E TABLET
   (mantendo as funções originais, sem perder layout)
===================================================== */
@media (max-width: 1024px) {
  .comunidade_container {
    max-width: 95%;
    padding: 15px;
  }

  #barra_lateral {
    width: 25%;
  }
}

@media (max-width: 768px) {
  .comunidade_container {
    flex-direction: column;
    align-items: center;
    padding: 10px;
    max-width: 80%;
  }

  #barra_lateral {
    width: 80%;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 10px 5px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0px 2px 4px var(--pretoTransparente-cinzaDark10);
  }

  #barra_lateral h1 {
    display: none;
  }

  .menu_comunidade {
    display: flex;
    justify-content: space-evenly;
    width: 100%;
  }

  .menu_comunidade li {
    flex: 1;
    text-align: center;
    margin: 0 5px;
    padding: 10px 5px;
    font-size: 0.9rem;
  }

  .menu_comunidade li.ativo {
    font-weight: bold;
    color: var(--branco);
  }

  .titulo_conteudo {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  #barra_lateral {
    flex-direction: column;
    gap: 5px;
  }

  .menu_comunidade {
    flex-direction: column;
    width: 70%;
  }

  .menu_comunidade li {
    font-size: 0.85rem;
  }

  .titulo_conteudo {
    font-size: 20px;
  }
}
