html {
  margin: 0;
  padding: 0;
}
body {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4 !important;
  font-family: Arial, sans-serif;
}
.coords {
  font-size: 12px;
}

.gradient-custom-strong {
  /* fallback for old browsers */
  background: #d3e1e8;
  box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.077);
  border: 1px solid #b1b1b1 !important;
  border-radius: 20px;
}

.layout-container {
  display: flex;
  flex-direction: column; /* ALTERADO: de 'row' para 'column' para empilhar a navbar e o conteúdo */
  width: 100%;
  height: 100vh;
}

/* ALTERADO: A classe .sidebar foi modificada para se comportar como uma navbar horizontal */
.sidebar {
  max-width: none; /* ALTERADO: Remove a largura máxima */
  height: auto; /* ALTERADO: Altura automática baseada no conteúdo */
  max-height: none; /* ALTERADO: Remove a altura máxima */
  padding: 1rem; /* ALTERADO: Adiciona um padding mais adequado para uma navbar */
  display: flex;
  flex-direction: row; /* ALTERADO: Itens internos (título e links) ficam lado a lado */
  align-items: center; /* ALTERADO: Alinha os itens verticalmente no centro */
  justify-content: space-between; /* ALTERADO: Empurra o título para um lado e os links para o outro */
  overflow: visible; /* ALTERADO: Remove o scroll */
}

.sidebar::-webkit-scrollbar {
  display: none; /* Esconde a barra de rolagem que não é mais necessária */
}

.config {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.config label {
  margin-right: 0.3em;
}

.config input {
  margin-right: 0.3em;
  flex: 1;
  min-width: 40px;
}

#figureSelect,
#lineAlgorithm,
#circleAlgorithm,
#transformeSelect {
  appearance: none;
  background-color: #f8f9fa;
  border-radius: 15px;
  padding: 4px 4px;
  margin-bottom: 5px;
  width: 100%;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  padding-left: 10px;
}

#figureSelect:hover,
#lineAlgorithm:hover,
#circleAlgorithm:hover,
#transformeSelect:hover {
  background-color: #3358794a !important;
  border: 1px solid #ffffff !important;
  color: white !important;
  font-weight: 600;
}

#figureSelect:focus,
#lineAlgorithm:focus,
#circleAlgorithm:focus,
#transformeSelect:focus {
  background-color: #ffffff !important;
  border: 1px solid #ffffff !important;
  color: rgb(27, 46, 69) !important;
  font-weight: 600;
}

#figureSelect option,
#lineAlgorithm option,
#circleAlgorithm option,
#transformeSelect option {
  background-color: #3358794a !important;
  border: 1px solid #ffffff !important;
  color: white !important;
  font-weight: 600;
}

#figureSelect {
  border: 1px solid #ccc !important;
}
input {
  padding: 5px 10px;

  margin: 5px 0;
  border: 1px solid #ccc !important;
  border-radius: 15px !important;
  font-size: 13px !important;
}

/* Para navegadores WebKit (Chrome, Safari, Edge) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Para Firefox */
input[type="number"] {
  appearance: textfield;
}

button {
  width: auto; /* ALTERADO: Largura automática para os botões */
  padding: 4px 10px; /* Ajuste no padding do botão */
  margin-top: 0 !important; /* ALTERADO: Remove a margem superior */
  border: 1px solid #ccc !important;
  border-radius: 20px !important;
  background-color: #ffffff !important;
  color: rgb(0, 0, 0) !important;
  cursor: pointer;
  transition: 0.3s;
  font-size: 14px !important;
}

button:hover {
  background-color: #3358794a !important;
  border: 1px solid #ffffff !important;
  color: white !important;
}

.main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  flex-direction: column;
  max-width: 500px;
  max-height: 400px;
  margin-top: 100px;
}

/* Opcional: A segunda sidebar (se existir) pode ser removida ou mantida */
.transformer-header {
  flex-shrink: 0;
  width: 220px;
  color: rgb(0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  padding: 20px;
}

canvas {
  border: 1px solid #ccc;
  max-width: 100%;
  height: auto;
}

#iterationLog {
  max-width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  max-width: 800px;
  border-collapse: collapse;
  margin-top: 10px;
}

th,
td {
  border: 1px solid #97a0a4 !important;
  padding: 8px;
  text-align: center;
}

th {
  background-color: #d3e1e8;
  border: 1px solid #97a0a4 !important;
}

/* A responsividade foi simplificada pois o layout agora é sempre vertical */
@media (min-width: 768px) {
  /* Regras anteriores não são mais necessárias para este layout */
}

#btn-3d {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #0d6efd;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 16px;
  font-weight: bold;
  z-index: 1000;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

#btn-3d:hover {
  background-color: #084298;
}

#figuraInfo3D {
  font-size: 0.8rem;
}

#figuraInfo3D p {
  margin-bottom: 0.3rem;
}

.vertex-info {
  color: #0d6efd;
  font-weight: bold;
}

.edge-info {
  color: #dc3545;
  font-weight: bold;
}

#worldWindow {
  border: 1px solid #ccc;
  background-color: white;
  margin-top: 10px;
}

.panel {
  margin: 10px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background-color: #f9f9f9;
}

[type="range"] {
  appearance: none;
  display: block;
  background-color: rgb(255, 255, 255);
  border-radius: 10px;
  padding: 4px;
  outline: none;
  border: none;
}

[type="range"]::-webkit-slider-thumb {
  appearance: none;
  display: block;
  width: 15px;
  height: 15px;
  border-radius: 50px;
  background: #d3e1e8;
  border: 1px solid #b1b1b1 !important;
}

.dark-grey-blued-text {
  color: #273e52;
}

img {
  max-width: 300px;
}
.borda-branca {
  border: 2px solid #ffffff !important;
}

/* ESTILOS PARA AS NOVAS TABELAS DE PIXELS */

.table-container {
  max-height: 400px; /* Altura máxima, a rolagem começa a partir daqui */
  overflow: auto; /* Adiciona barras de rolagem quando necessário */
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 5px;
}

.pixel-table {
  width: 100%;
  border-collapse: collapse; /* Remove espaço entre as bordas das células */
  font-size: 12px;
  font-family: monospace;
  white-space: nowrap; /* Impede que o conteúdo da célula quebre linha */
}

.pixel-table th,
.pixel-table td {
  border: 1px solid #555;
  padding: 4px 6px;
  text-align: center;
}

/* --- Efeito de Cabeçalho Fixo (Sticky) --- */
.pixel-table thead th {
  position: -webkit-sticky; /* Para compatibilidade com Safari */
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: #0d123b; /* Cor de fundo para o cabeçalho X */
  color: white;
}

.pixel-table tbody th {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 1;
  background-color: #1c2657; /* Cor de fundo para o cabeçalho Y */
  color: white;
}

/* Garante que o canto superior esquerdo fique acima de tudo */
.pixel-table thead th:first-child {
  left: 0;
  z-index: 3;
}

/* --- Efeito de Hover Sincronizado --- */
.pixel-table td.pixel-hover {
  background-color: #ffc107; /* Cor de destaque (amarelo bootstrap) */
  color: black;
  font-weight: bold;
}

/* --- Efeito de Clique Sincronizado --- */
.pixel-table td.pixel-selected {
  background-color: #0d6efd; /* Alterado para o azul primário do Bootstrap */
  color: white;
  font-weight: bold;
  outline: 2px solid #ffc107; /* Adiciona um contorno amarelo para mais destaque */
  outline-offset: -2px;
}

.img-card {
  max-width: 350px !important;
  height: 350px !important;
  max-height: 350px !important;
}
