/*      Estes itens estão dentro de uma div maior .section       */
/*          GRAPH CONTAINER          */

.graph-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  height: calc(80vh - 101px);
  min-height: 300px;
  box-sizing: border-box;
  position: relative;
  padding: 2rem;
  background-color: white;
  border-radius: 0;
  width: 100%;
  max-width: 100%;
  z-index: 1;
}

.graph-container .grafo {
  flex: 8;
  background-color: #eaeaea;
  border-radius: 1rem;
  box-shadow: 0 4px 8px #00000033;
  box-sizing: border-box;
  position: relative;
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: 300px;
}

#mynetwork {
  width: 100%;
  height: 100%;
  border: #333;
}

/*      STATS CONTAINER       */

.graph-container .stats {
  height: 100%;
  flex: 2;
  overflow-y: auto;
  background-color: #eaeaea;
  border-radius: 1rem;
  box-shadow: 0 4px 8px #00000033;
  box-sizing: border-box;
  position: relative;
  padding: 1.5rem;
  font-size: clamp(0.7rem, 1vw, 1rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.graph-container .stats p {
  margin: 2px 0;
  word-break: break-word;
  line-height: 1.4;
}

#stats table {
  width: 100%;
  border-collapse: collapse;
}

#stats th, #stats td {
  border: 1px solid #999;
  padding: 8px;
  text-align: center;
}

.route-finder {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-group label {
  font-weight: bold;
  font-size: 14px;
}

.input-group input {
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#calculate-routes-btn {
  padding: 8px 12px;
  background-color: #303332;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  align-self: flex-start;
}

#calculate-routes-btn:hover {
  transition: all 300ms;
  background-color: #acacac;
}

#route-results p {
  margin: 5px 0;
}

#btnExibirMatriz,
#matrizOutputContainer {
  flex: 1 1 100%;
  width: 100%;
  margin-top: 1rem;
  overflow-x: auto;
  position: relative;
  z-index: 0;
}

.graph-container button {
  padding: 0.5rem 1rem;
  background-color: #0e3a72;
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: bold;
}

#matrizOutputContainer table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background-color: #fff;
}

#matrizOutputContainer th,
#matrizOutputContainer td {
  border: 1px solid #999;
  padding: 6px;
  text-align: center;
}
.matriz-gerada {
  flex: 1 1 100%;
  width: 100%;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#matrizOutputContainer input {
  width: 40px;
}

#btnExibirMatriz {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background-color: #0e3a72;
  color: #fff;
  font-weight: bold;
  font-family: "Work Sans", sans-serif;
  font-size: 0.95rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#btnExibirMatriz:hover {
  background-color: #104c9b;
}

/* Container da matriz gerada */
#matrizOutputContainer {
  width: 100%;
  margin-top: 1rem;
  overflow-x: auto;
}

/* Tabela da matriz */
#matrizOutputContainer table {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff;
  box-shadow: 0 2px 8px #00000022;
  border-radius: 0.5rem;
  overflow: hidden;
}

#matrizOutputContainer th,
#matrizOutputContainer td {
  border: 1px solid #ccc;
  padding: 6px
}

.txt-converter-div {
  display: flex;
  justify-content: center;
  width: auto; /* Alterado para se ajustar ao conteúdo */
  min-width: 15%; /* Mantém uma largura mínima */
  box-sizing: border-box;
  gap: 15px; /* <-- ADICIONE ESTA LINHA */
}

.txt-converter-div button {
  width: 160px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  background-color: #303332;
  border-radius: 10px;
  box-shadow: 0 4px 8px #00000033;
  font-weight: bold;
  color: white;
  cursor: pointer;
  position: relative;
}

#txt-converter:hover {
  transition: all 300ms;
  background-color: #919191;
}