/* style.css */

/* Importa fontes */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Bebas+Neue&family=Work+Sans:ital,wght@0,100..900;1,100..900&display=swap');

:root {
  --roxo: #4B0082;
  --roxo-escuro: #330066;
  --cinza-fundo: #f5f5f5;
  --cinza-borda: #ddd;
  --vermelho: #c82333;
  --vermelho-hover: #a0001d;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Bebas Neue", sans-serif;
  color: #333;
  padding: 40px 20px;
  background-color: var(--cinza-fundo);
}

/* Container principal */
.container {
  max-width: 900px;
  padding: 25px;
  margin: 0 auto;
  text-align: center;
}

h1 {
  font-size: 3.5rem;
  font-family: 'Anton', sans-serif;
  color: var(--roxo);
  margin-bottom: 30px;
}


button {
  background-color: var(--roxo);
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
  margin-top: 10px;
}

button:hover {
  background-color: var(--roxo-escuro);
}

/* Lista de Anexos */
.anexo-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.anexo-card {
  background-color: #fff;
  border: 1px solid var(--cinza-borda);
  border-radius: 12px;
  padding: 12px;
  width: 200px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.2s;
}

.anexo-card:hover {
  transform: scale(1.03);
}

.anexo-card img {
  width: 100%;
  border-radius: 8px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
}

.modal-grande {
  max-width: 900px;
}

/* Botão de fechar */
.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
.close:hover {
  color: black;
}

/* Estrutura de detalhes */
.detalhes-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-bottom: 30px;
  align-items: flex-start;
}

/* Inputs */
.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content input[type="file"] {
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  border: 1px solid var(--cinza-borda);
  border-radius: 6px;
  font-size: 16px;
}

/* Animação */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}


.anexo {
  display: inline-block;
  border: 1px solid #ccc;
  padding: 10px;
  margin: 10px;
  text-align: center;
  border-radius: 8px;
  width: 200px;
  position: relative;
}

.anexo img {
  max-width: 100%;
  cursor: pointer;
  border-radius: 6px;
}

.excluir-btn {
  background-color: #e74c3c;
  color: white;
  border: none;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.excluir-btn:hover {
  background-color: #c0392b;
}

/* Modal de detalhes - overlay */
#detalhesModal {
  display: none; /* controle via JS */
  position: fixed;
  z-index: 1100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background-color: rgba(0,0,0,0.6);
  padding: 40px 20px;
  animation: fadeIn 0.3s ease forwards;
}

/* Conteúdo do modal detalhes */
#detalhesModal .modal-content {
  background-color: #fff;
  border-radius: 12px;
  max-width: 900px;
  margin: auto;
  padding: 30px 40px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  font-family: 'Inter', sans-serif;
  color: #222;
  animation: fadeIn 0.4s ease forwards;
}

/* Imagem do detalhe */
#detalheImagem {
  max-width: 320px;
  border-radius: 55px;
  box-shadow: 0 8px 16px rgba(75, 0, 130, 0.3);
  flex-shrink: 0;
  object-fit: cover;
}

/* Container da info textual */
.detalhes-info {
  flex: 1 1 320px;
  font-size: 17px;
  line-height: 1.5;
  text-align: left;
}

/* Títulos e parágrafos dentro do modal detalhes */
.detalhes-info h2 {
  font-weight: 700;
  font-size: 2rem;
  color: var(--roxo);
  margin-bottom: 20px;
}

.detalhes-info p {
  margin: 8px 0;
  font-weight: 500;
  color: #444;
}

/* Tabela de histórico de testes */
#tabelaTestes {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  margin-top: 30px;
  font-size: 15px;
}

#tabelaTestes thead tr {
  background-color: var(--roxo);
  color: white;
  font-weight: 600;
}

#tabelaTestes th,
#tabelaTestes td {
  padding: 12px 15px;
  text-align: center;
  border-radius: 8px;
}

#tabelaTestes tbody tr {
  background-color: #f9f9f9;
  transition: background-color 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

#tabelaTestes tbody tr:hover {
  background-color: #e6e0f7;
}

/* Botão dentro do modal */
.detalhes-info > button {
  margin-top: 30px;
  background-color: var(--roxo);
  padding: 12px 25px;
  font-size: 16px;
  border-radius: 12px;
  transition: background-color 0.3s ease;
  width: 100%;
  max-width: 280px;
}

.detalhes-info > button:hover {
  background-color: var(--roxo-escuro);
  cursor: pointer;
}

/* Botão fechar do modal */
#detalhesModal .close {
  position: absolute;
  top: 25px;
  right: 25px;
  font-size: 32px;
  font-weight: 700;
  color: var(--roxo);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 1110;
}

#detalhesModal .close:hover {
  color: var(--roxo-escuro);
}

/* Responsividade */
@media (max-width: 768px) {
  #detalhesModal .modal-content {
    flex-direction: column;
    padding: 20px;
  }

  #detalheImagem {
    max-width: 100%;
    margin: 0 auto 20px;
  }

  .detalhes-info > button {
    max-width: 100%;
  }
}

/* Modal de adição - overlay */
#addModal {
  display: none; /* controle via JS */
  position: fixed;
  z-index: 1200; /* maior que o modal de detalhes */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background-color: rgba(0,0,0,0.6);
  padding: 40px 20px;
  animation: fadeIn 0.3s ease forwards;
}

/* Conteúdo do modal de adição */
#addModal .modal-content {
  background-color: #fff;
  border-radius: 12px;
  max-width: 800px;
  margin: auto;
  padding: 30px 40px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  font-family: 'Inter', sans-serif;
  color: #222;
  animation: fadeIn 0.4s ease forwards;
}

/* Botão fechar do modal de adição */
#addModal .close {
  position: absolute;
  top: 25px;
  right: 25px;
  font-size: 32px;
  font-weight: 700;
  color: var(--roxo);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 1210; /* acima do overlay */
}

#addModal .close:hover {
  color: var(--roxo-escuro);
}

/* Modal de detalhes */
#detalhesModal {
  z-index: 1000;
}

/* Modal de adição */
#adicionarDadosModal {
  z-index: 1100; /* Maior que o detalhes */
}

#select {
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  border: 1px solid var(--cinza-borda);
  border-radius: 6px;
  font-size: 16px;
}

#linguagem {
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  border: 1px solid var(--cinza-borda);
  border-radius: 6px;
  font-size: 16px;
}

.btn-excluir {
  background-color: #d9534f;
  color: white;
  border: none;
  padding: 6px 10px;
  margin-top: 5px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
}

.btn-excluir:hover {
  background-color: #c9302c;
}

.anexo-item {
  display: flex;
  align-items: center;
  margin: 15px 0;
  padding: 10px;
  background-color: #f5f5f5;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.anexo-imagem {
  width: 250px;
  height: 150px;
  border-radius: 8px;
}

.anexo-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.anexo-info strong {
  font-size: 1.2em;
}


/* Menu base */
.menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background-color: #fff;
  border-bottom: 1.5px solid #ddd;
  z-index: 1000;
  box-shadow: 0 3px 8px rgba(75, 0, 130, 0.15);
  flex-wrap: wrap;
}

/* Links do menu */
.menu a {
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  color: #4B0082;
  padding: 8px 14px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.menu a:hover {
  background-color: rgba(75, 0, 130, 0.12);
  color: #330066;
}

/* Agrupadores */
.menu-left,
.menu-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Wrapper para os itens do menu */
.menu-items {
  display: flex;
  flex: 1;
  justify-content: space-between;
}

/* Botão do menu mobile */
.menu-toggle {
  display: none;
  font-size: 26px;
  color: #4B0082;
  background: none;
  border: none;
  cursor: pointer;
}

/* Responsivo */
@media (max-width: 768px) {
  .menu {
    flex-direction: column;
    align-items: flex-start;
  }

  .menu-toggle {
    display: block;
    margin-bottom: 10px;
  }

  .menu-items {
    flex-direction: column;
    width: 100%;
    display: none;
  }

  .menu-items.active {
    display: flex;
  }

  .menu-left,
  .menu-right {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  .menu a {
    width: 100%;
    padding: 12px 20px;
    border-top: 1px solid rgba(75, 0, 130, 0.1);
  }
}

@media (max-width: 480px) {
  #tabelaTestes {
    display: none;
  }
}

/* Estilo para o Modo Escuro usando data-theme="dark" */

/* Body */
[data-theme="dark"] body {
  background-color: #121212; /* Fundo escuro */
  color: #e0e0e0; /* Texto claro */
}

/* Container principal */
[data-theme="dark"] .container {
  background-color: #222; /* Fundo escuro */
  color: #e0e0e0;
}

/* Títulos */
[data-theme="dark"] h1 {
  color: #bb86fc; /* Roxo claro */
}

/* Botões */
[data-theme="dark"] button {
  background-color: #6200ea; /* Roxo escuro */
  color: white;
}

[data-theme="dark"] button:hover {
  background-color: #bb86fc; /* Roxo claro */
}

/* Lista de Anexos */
[data-theme="dark"] .anexo-card {
  background-color: #333; /* Fundo escuro para os cards */
  border: 1px solid #444; /* Cor de borda escura */
}

[data-theme="dark"] .anexo-card:hover {
  transform: scale(1.03);
}

[data-theme="dark"] .anexo-card img {
  filter: brightness(0.8); /* Imagem um pouco mais escura */
}

/* Modal */
[data-theme="dark"] .modal {
  background-color: rgba(0, 0, 0, 0.6); /* Fundo escuro do overlay */
}

[data-theme="dark"] .modal-content {
  background-color: #222; /* Fundo escuro para o conteúdo */
  color: #e0e0e0; /* Texto claro */
}

[data-theme="dark"] .close {
  color: #bbb; /* Cor clara para o botão de fechar */
}

[data-theme="dark"] .close:hover {
  color: #bb86fc; /* Roxo claro no hover */
}

/* Estrutura de detalhes */
[data-theme="dark"] .detalhes-container {
  background-color: #333;
}

[data-theme="dark"] .detalhes-info h2 {
  color: #bb86fc; /* Roxo claro */
}

[data-theme="dark"] .detalhes-info p {
  color: #bbb; /* Texto claro */
}

/* Tabela */
[data-theme="dark"] #tabelaTestes thead tr {
  background-color: #6200ea; /* Roxo escuro */
  color: white;
}

[data-theme="dark"] #tabelaTestes tbody tr {
  background-color: #444; /* Fundo escuro para as linhas */
}

[data-theme="dark"] #tabelaTestes tbody tr:hover {
  background-color: #555; /* Fundo mais claro no hover */
}

/* Modal de Adição */
[data-theme="dark"] #addModal .modal-content {
  background-color: #333; /* Fundo escuro */
  color: #e0e0e0; /* Texto claro */
}

/* Inputs */
[data-theme="dark"] .modal-content input[type="text"],
[data-theme="dark"] .modal-content input[type="number"],
[data-theme="dark"] .modal-content input[type="file"],
[data-theme="dark"] #select,
[data-theme="dark"] #linguagem {
  background-color: #222; /* Fundo escuro para inputs */
  border: 1px solid #444; /* Borda escura */
  color: #e0e0e0; /* Texto claro */
}

/* Botão de Excluir */
[data-theme="dark"] .btn-excluir {
  background-color: #d9534f; /* Vermelho */
  color: white;
}

[data-theme="dark"] .btn-excluir:hover {
  background-color: #c9302c; /* Vermelho mais escuro */
}

/* Menu */
[data-theme="dark"] .menu {
  background-color: #222; /* Fundo escuro */
  border-bottom: 1px solid #444; /* Borda escura */
}

[data-theme="dark"] .menu a {
  color: #e0e0e0; /* Texto claro */
}

[data-theme="dark"] .menu a:hover {
  background-color: rgba(75, 0, 130, 0.12);
  color: #bb86fc; /* Roxo claro no hover */
}

/* Menu Mobile */
[data-theme="dark"] .menu-toggle {
  color: #e0e0e0; /* Texto claro para o botão de menu */
}

/* Responsividade */
[data-theme="dark"] #detalhesModal .modal-content {
  background-color: #333; /* Fundo escuro */
  color: #e0e0e0; /* Texto claro */
}

[data-theme="dark"] .detalhes-info > button {
  background-color: #6200ea; /* Roxo escuro */
  color: white;
}

[data-theme="dark"] .detalhes-info > button:hover {
  background-color: #bb86fc; /* Roxo claro no hover */
}

/* Modal de Detalhes */
[data-theme="dark"] #detalhesModal {
  background-color: rgba(0, 0, 0, 0.6); /* Overlay escuro */
}

[data-theme="dark"] .anexo-item {
  background-color: #444; /* Fundo mais escuro para os itens */
}

[data-theme="dark"] .anexo-info strong {
  color: #bb86fc; /* Roxo claro */
}
