/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Importar a fonte Roboto */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* Estilização geral */
body {
  font-family: 'Roboto', sans-serif;
  background-color: #F5F7FA;
  color: #333333;
  line-height: 1.6;
}

/* Cabeçalho */
header {
  background-color: #2C3E50;
  color: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
}

nav {
  margin-top: 1rem;
  text-align: center;
}

nav a {
  color: white;
  text-decoration: none;
  margin: 0 1rem;
  font-weight: 600;
  transition: color 0.3s ease;
}

nav a:hover {
  color: #3498DB;
}

/* Conteúdo principal */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  padding-bottom: 60px;
}

/* Títulos */
h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #2C3E50;
}

h3 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: #2C3E50;
}

/* Parágrafos */
p {
  margin-bottom: 1rem;
  font-size: 1rem;
  text-align: justify; /* Justificar texto */
}

/* Formulários */
form {
  background-color: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 3rem;
}

.form {
  background-color: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 5rem;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #2C3E50;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  border-color: #3498DB;
  outline: none;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

input[type="file"] {
  margin-bottom: 1rem;
}

/* Botões */
button,
input[type="submit"] {
  background-color: #2C3E50;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover,
input[type="submit"]:hover {
  background-color: #3498DB;
}

button.encerrar {
  background-color: #E74C3C;
}

button.encerrar:hover {
  background-color: #C0392B;
}

/* Tabelas */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 2rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

th, td {
  padding: 1rem;
  text-align: left; /* Mantém alinhamento à esquerda para melhor legibilidade */
  border-bottom: 1px solid #ddd;
  white-space: nowrap;
}

th {
  background-color: #2C3E50;
  color: white;
  font-weight: 700;
}

td {
  font-size: 0.875rem;
}

tr:hover {
  background-color: #F5F7FA;
}

td a {
  color: #3c137c;
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

.table-button {
  display: inline-block;
  background-color: #2C3E50;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.table-button:hover {
  background-color: #3498DB;
  text-decoration: none;
}

/* Responsividade */
@media (max-width: 768px) {
  .table-container {
    margin-bottom: 1rem;
  }

  table, th, td {
    font-size: 0.75rem;
    padding: 0.5rem;
  }

  .table-button {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }
}

/* Links */
a {
  color: #3c137c;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Mensagens de Sucesso/Erro */
.mensagem-sucesso {
  background-color: #40cc2e;
  color: white;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  text-align: justify; /* Justificar texto */
}

.mensagem-erro {
  background-color: #E74C3C;
  color: white;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  text-align: justify; /* Justificar texto */
}

/* Rodapé */
footer {
  background-color: #2C3E50;
  color: white;
  text-align: center; /* Mantém centralizado */
  padding: 0.5rem;
  position: fixed;
  bottom: 0;
  width: 100%;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

footer p {
  margin: 0;
  font-size: 0.875rem;
  text-align: center; /* Mantém centralizado */
}

/* Responsividade */
@media (max-width: 768px) {
  header {
    padding: 1rem;
  }

  header h1 {
    font-size: 1.25rem;
  }

  nav a {
    margin: 0 0.5rem;
    font-size: 0.875rem;
  }

  main {
    margin: 1rem;
    padding: 0 0.5rem;
  }

  form {
    padding: 1rem;
  }

  table, th, td {
    font-size: 0.75rem;
    padding: 0.5rem;
  }
}

/* Estilização do Chat */
.chat-container {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 1rem 1rem 0rem 1rem;
  max-height: 800px;
  overflow-y: auto;
  margin-bottom: 0rem;
  position: relative;
}

.chat-message {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-message {
  align-items: flex-start;
}

.admin-message {
  align-items: flex-end;
}

.message-bubble {
  max-width: 70%;
  padding: 0.75rem;
  border-radius: 12px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.message-bubble:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-message .message-bubble {
  background-color: #01545a;
  color: #ffffff;
  border-bottom-left-radius: 0;
}

.admin-message .message-bubble {
  background-color: #001d3f;
  color: white;
  border-bottom-right-radius: 0;
}

.chat-message.user-message:first-child .message-bubble {
  background-color: #01545a;
  border-bottom-left-radius: 0;
}

.message-author {
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.message-text {
  font-size: 1rem;
  word-wrap: break-word;
  text-align: justify; /* Justificar texto */
}

.message-timestamp {
  font-size: 0.75rem;
  color: #afafaf;
  margin-top: 0.25rem;
  text-align: right; /* Mantém alinhamento à direita */
}

/* Formulário de Entrada de Mensagem */
.chat-input-form {
  position: sticky;
  bottom: 0;
  background-color: white;
  padding: 0rem;
}

.chat-input-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-input-container textarea {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 1rem;
  resize: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.chat-input-container textarea:focus {
  border-color: #1c8b00;
  box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.anexo-label {
  cursor: pointer;
  font-size: 1.5rem;
  color: #666666;
  transition: color 0.3s ease;
}

.anexo-label:hover {
  color: #3498DB;
}

.chat-input-container button {
  background-color: #3498DB;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: background-color 0.3s ease, transform 0.1s ease;
}

.chat-input-container button:hover {
  background-color: #2C3E50;
  transform: scale(1.05);
}

.chat-input-container button:active {
  transform: scale(0.95);
}

/* Responsividade para o Chat */
@media (max-width: 768px) {
  .chat-container {
    max-height: 600px;
    padding: 0.5rem;
  }

  .message-bubble {
    max-width: 85%;
  }

  .chat-input-container textarea {
    font-size: 0.875rem;
  }

  .chat-input-container button {
    padding: 0.5rem;
    font-size: 0.875rem;
  }
}

/* Estilização do Link de Logout */
.logout-link {
  color: #E74C3C;
  font-weight: 500;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid #E74C3C;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.logout-link:hover {
  background-color: #E74C3C;
  color: white;
  text-decoration: none;
}

/* Estilização dos Anexos no Chat */
.message-attachments {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.attachment-link {
  display: inline-flex;
  align-items: center;
  color: #3498DB;
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid #3498DB;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.attachment-link:hover {
  background-color: #3498DB;
  color: white;
}

.attachment-icon {
  margin-right: 0.25rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .attachment-link {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
  }
}

/* Estilização dos Detalhes do Relato */
.relato-detalhes {
  background-color: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.relato-detalhes p {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  text-align: justify; /* Justificar texto */
}

.relato-detalhes p strong {
  width: 150px;
  color: #2C3E50;
}

/* Estilização do Aviso de Autorização */
.aviso-autorizacao {
  background-color: #FFF3CD;
  border: 1px solid #FFECB3;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
  color: #856404;
}

.aviso-autorizacao p {
  margin-bottom: 0.5rem;
  text-align: justify; /* Justificar texto */
}

.aviso-autorizacao label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

/* Mensagem Informativa */
.mensagem-info {
  background-color: #D1E7DD;
  color: #0F5132;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  text-align: justify; /* Justificar texto (substitui text-align: center) */
  font-style: italic;
}

.topoTabela {
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.logo {
  background-image: url('/public/imagens/logo.png');
  width: 200px;
}

/* Estilização da Lista de Anexos */
.lista-anexos {
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.anexo-item {
  display: flex;
  align-items: center;
  background-color: #f5f5f5;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  gap: 0.5rem;
}

.remover-anexo {
  background-color: #E74C3C;
  color: white;
  border: none;
  border-radius: 10%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background-color 0.3s ease;
}

.remover-anexo:hover {
  background-color: #C0392B;
}

/* Responsividade */
@media (max-width: 768px) {
  .anexo-item {
    font-size: 0.75rem;
    padding: 0.4rem;
  }

  .remover-anexo {
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
  }
}

/* Estilização do Loading Spinner */
.loading-spinner {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #2C3E50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

.loading-spinner p {
  color: white;
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  text-align: center; /* Mantém centralizado */
}

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

/* Responsividade */
@media (max-width: 768px) {
  .spinner {
    width: 30px;
    height: 30px;
    border-width: 3px;
  }

  .loading-spinner p {
    font-size: 0.875rem;
  }
}

.mensagem-erro {
  padding: 0.5rem;
  border-radius: 4px;
  margin-top: 0.5rem;
  text-align: justify; /* Justificar texto (substitui text-align: center) */
  font-size: 0.875rem;
}

#mensagem-consulta {
  margin-top: 0.5rem;
  min-height: 1.5rem;
}

/* Estilização dos Filtros */
.filtros-container {
  margin-bottom: 1.5rem;
  background-color: #f9f9f9;
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.filtro-grupo {
  display: inline-block;
  margin-right: 1rem;
  margin-bottom: 0.5rem;
}

.filtro-grupo label {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.filtro-grupo input,
.filtro-grupo select {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.875rem;
  width: 150px;
}

.filtro-grupo button {
  padding: 0.5rem 1rem;
  background-color: #2C3E50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.filtro-grupo button:hover {
  background-color: #34495E;
}

.limpar-filtros {
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  color: #ffffff;
  text-decoration: none;
  margin-left: 1rem;
  border-radius: 4px;
  background-color: #2C3E50;
}

.limpar-filtros:hover {
  text-decoration: underline;
}

/* Estilização da Paginação */
.paginacao {
  text-align: center;
  margin-top: 0rem;
  margin-bottom: 6rem;
}

.paginacao-link {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  margin: 0 0.25rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: #2C3E50;
  font-size: 0.875rem;
}

.paginacao-link:hover {
  background-color: #f1f1f1;
}

.paginacao-link.active {
  background-color: #2C3E50;
  color: white;
  border-color: #2C3E50;
}

.paginacao-link.disabled {
  color: #999;
  border-color: #ddd;
  cursor: not-allowed;
}

/* Responsividade */
@media (max-width: 768px) {
  .filtro-grupo {
    display: block;
    margin-right: 0;
  }

  .filtro-grupo input,
  .filtro-grupo select {
    width: 100%;
  }

  .limpar-filtros {
    display: block;
    margin-top: 0.5rem;
    margin-left: 0;
    width: 30%;
    text-align: center;
  }
}