/* 
  box que engloba os elementos do chatbox:
  descrição do atendente no topo e ferramenta de chat 
*/
#chatbox {
  margin: 20px auto;
  width: 100%;
  padding: 5px;
  box-sizing: border-box;
}
/* 
  descricao do atendente no topo antes do chat
*/
header#descricao-atendente {
  background: var(--qualiconsig-azul);
  text-align: center;
  color: var(--qualiconsig-branco);
  font-family: var(--qualiconsig-fonte);
  margin: 0 auto;
  padding: 5px;
  box-sizing: border-box;
}
header#descricao-atendente h2 {
  font-weight: normal;
  margin: 0;
  padding: 0;
  font-size: 18px;
  line-height: 18px;
}
header#descricao-atendente h2 strong {
    font-family: var(--qualiconsig-fonte);
    color: var(--qualiconsig-amarelo);
    font-weight: 600;
}
header#descricao-atendente h3 {
    font-size: 16px;
    line-height: 16px;
    margin: 8px 0;
    padding: 0;
}
header#descricao-atendente h3 strong {
    font-weight: 600;
}
header#descricao-atendente p {
    font-style: italic;
    font-size: 13px;
    margin: 0;
    padding: 0;
    color: var(--qualiconsig-branco);
}
/* 
  Tela com os itens do chat (sidebar e mensagens de chat)
*/
#tela {
  width: 100%;
  height: 500px;
  background: var(--qualiconsig-azul);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  margin: 20px auto 40px auto;
  overflow-x: hidden;
  padding: 0;
  border-radius: 5px;
}
@media (min-width: 1025px) {
  /* Desktop */
  #tela {
    flex-direction: row;
  }
}

#atendente {
  background: var(--qualiconsig-branco);
  width: 100%;
  height: 135px;
  box-sizing: border-box;
}

@media (min-width: 1025px) {
  /* Desktop */
  #atendente {
    width: 280px;
    height: 100%;
  }
}

#chat {
  background: #e5ddd5;
  flex: 1 1 0;
  width: 100%;
  height: calc(100vh - 150px);
  min-height: 200px;
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
}

@media (min-width: 1025px) {
  /* Desktop */
  #chat {
    height: 100%;
    width: calc(100% - 280px);
  }
}

#atendente header {
  padding: 10px;
  text-align: left;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

@media (min-width: 1025px) {
  /* Desktop */
  #atendente header {
    margin: 0 0 15px 0;
  }
}

#atendente header h3 {
  font-weight: 700;
  font-size: 16px;
  font-family: var(--qualiconsig-fonte);
  color: var(--qualiconsig-azul);
  margin: 0;
}
#atendente section {
  width: 100%;
  max-height: 150px;
  box-sizing: border-box;
  border-bottom: 1px solid #eee;
  padding: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
#atendente section:hover {
  background: #f5f5f5;
}
#atendente section h4 {
  font-family: var(--qualiconsig-fonte);
  color: var(--qualiconsig-azul);
  margin: 0 0 5px 0;
  font-size: 13px;
}
#atendente section p {
  font-family: var(--qualiconsig-fonte);
  color: var(--qualiconsig-preto);
  margin: 0;
  font-size: 11px;
  font-weight: normal;
  font-style: italic;
}
#imagem {
  width: 60px;
  height: 60px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  display: block;
}
#pessoa {
  margin-left: 15px;
  width: calc(100% - 80px);
}
#chat section {
  height: calc(100% - 80px);
  padding: 20px 15px;
  box-sizing: border-box;
  overflow: hidden;
}
#chat footer {
  height: 80px;
  width: 100%;
  padding: 20px;
  background: #f0f0f0;
  box-sizing: border-box;
}
#chat footer input[type="text"] {
  /* width: 48%; */
  width: 82%;
  background: #FFF;
  border-radius: 5px;
  font-family: var(--qualiconsig-fonte);
  color: var(--qualiconsig-azul);
  font-size: 15px;
  border: 0;
  outline: none;
  padding: 10px;
  box-sizing: border-box;
}


@media (min-width: 769px) {
  /* Tablet */
  #chat footer input[type="text"] {
    width: 60%;
  }
}

@media (min-width: 1025px) {
  /* Desktop */
  #chat footer input[type="text"] {
    width: 82%;
  }
}

#chat footer button {
  padding: 10px 15px;
  box-sizing: border-box;
  text-align: center;
  cursor: pointer;
  border: 0;
  border-radius: 5px;
  color: #FFF;
  font-weight: bold;
}
#chat footer button#enviar {
  background: rgb(1, 1, 254);
}
#chat footer button#anexar {
  background: #949494;
}
#chat footer button svg {
  width: 12px;
  height: 12px;
  fill: #FFF;
}

@media (min-width: 769px) {
  /* Tablet */
  #chat footer button svg {
    width: 14px;
    height: 14px;
  }
}

@media (min-width: 1025px) {
  /* Desktop */
  #chat footer button svg {
    width: 16px;
    height: 16px;
  }
}

.chat-messages {
  display: flex;
  box-sizing: border-box;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 20px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.2) rgba(0,0,0,0.05);
}
.chat-messages::-webkit-scrollbar {
  width: 8px;
  background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.18);
  border-radius: 8px;
  border: 2px solid rgba(0,0,0,0.01);
  min-height: 40px;
  transition: background 0.2s;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.28);
}
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.mensagem {
  display: flex;
  align-items: flex-end;
  max-width: 85%;
  flex-direction: row;
}

.mensagem.atendente {
  flex-direction: row;
  align-items: flex-start;
  align-self: flex-start;
}
.mensagem.atendente h6 {
   font-family: var(--qualiconsig-fonte);
   color: var(--qualiconsig-azul);
   margin: 0 0 5px 0;
   padding: 0;
   width: 100%;
   font-size: 14px;
   font-weight: 600;
}

.mensagem.atendente .imagem {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 8px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  aspect-ratio: 1 / 1;
}
.mensagem.atendente .balon {
  background: #fff;
  color: var(--qualiconsig-preto);
  border-radius: 0 8px 8px 8px;
  padding: 10px 14px;
  font-size: 14px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.05);
  font-family: var(--qualiconsig-fonte);
}

.mensagem.enviada {
  flex-direction: row-reverse;
  align-items: flex-end;
  align-self: flex-end;
}
.mensagem.enviada .balon {
  background: #d2f8c6;
  color: #222;
  border-radius: 8px 0 8px 8px;
  padding: 10px 14px;
  font-size: 14px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.05);
  font-family: var(--qualiconsig-fonte);
}

.mensagem .balon a.imagem-msg {
  display: inline-block;
  max-width: 180px;
  max-height: 180px;
  margin: 5px 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #eee;
  transition: box-shadow 0.2s;
}
.mensagem .balon a.imagem-msg:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.mensagem .balon a.imagem-msg img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.mensagem .imagem {
  margin-bottom: 0;
  margin-right: 8px;
}

.balon {
  position: relative;
}
.mensagem .balon p {
    margin: 0;
    padding: 0;
    width: 100%;
}
.timestamp {
  display: inline-block;
  color: #666;
  font-size: 9px;
  width: 100%;
  text-align: right;
}

section#form {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 16px;
}
#foto {
  width: 100%;
}
#formulario {
  width: 100%;
}
@media (min-width: 1025px) {
  section#form {
    flex-direction: row;
    gap: 24px;
  }
  #foto, #formulario {
    width: 50%;
  }
} 