/* Estilos globais */

#menu {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;

}

.menu-selection {
  background-color: rgba(255, 255, 255, 0.85);
  padding: 20px 40px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: 1300px;
}

#game-selection {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
}


.game-button {
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 200px;
    text-align: center;
    transition: background-color 0.3s, transform 0.2s;
}

.game-button:hover {
    /*background-color: rgba(0, 0, 0, 0.1);*/
    transform: scale(1.05);
}

.game-button img {
    width: 180px;
    height: 180px;
    border-radius: 10px;
    border: 2px solid black;
    object-fit: cover;
}

.game-button span {
    display: block;
    margin-top: 10px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    color: rgb(168, 160, 160); /* Garante que seja visível */
}

body {
    background-image: url('../assets/img/back.png');
    background-repeat: repeat;
    font-family: 'Arial Rounded MT Bold', Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

body.menu-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: 'Arial Rounded MT Bold', Arial, sans-serif;
    background-image: url('../assets/img/back.png');
    background-repeat: repeat;
    text-align: center;
    overflow-x: hidden; /* impede scroll horizontal */
}

#body.processing {
    pointer-events: none !important;
}

#wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center; 
  align-items: center;
}

.site-footer {
  flex-basis: 100%;
  width: 60%;
  text-align: center;
  padding: 12px;
  font-size: 0.9em;
  background-color: #f8f8f8;
  border-top: 1px solid #ccc;
  margin-top: 80px;
}
.site-footer a {
  color: #3366cc;
  text-decoration: none;
}
.site-footer a:hover {
  text-decoration: underline;
}

#game-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color:  #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

.game-title {
    display: flex;
    background-color: #ffffff;
}

.buttons {
    align-items: center;
    background-color: #ffffff;
}

.btn {
    margin-top: 10px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #a9b1a9;
    color: white;
    transition: background-color 0.3s, transform 0.2s;
}

.btn:hover {
    background-color: #cacfca;
    transform: scale(1.05);
}

.waiting {
    cursor: wait !important;
  }

/* Painel de Opções */
.options-panel {
    display: none;
    background-color: #ffffff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 60%;
    max-width: 600px;
}

.options-columns {
    display: flex;
    flex-wrap: wrap; /* Permite que os itens quebrem linha */
    justify-content: center; /* Centraliza os itens */
    gap: 20px;
    margin-bottom: 20px;
}
.option-group{
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Alinha à esquerda */
    background-color: #f9f9f9;
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%; /* Garante que a largura seja suficiente */
    min-width: 250px; /* Evita que os itens quebrem linha */
}

.option-group label {
    display: flex;
    align-items: center; /* Alinha a caixa de seleção com o texto */
    gap: 8px; /* Espaçamento entre a checkbox e o texto */
}

.option-group .option-title {
    font-weight: bold;
}

.option-title label {
    display: flex;
    align-items: center;
    font-size: 16px;
    cursor: pointer;
    width: 100%; /* Garante que o texto e o checkbox fiquem na mesma linha */
}

.option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 10px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    width: auto;
    min-width: 20px;
}

.option input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #007bff;
    border-radius: 5px;
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin-right: 10px;
}

.option input[type="checkbox"]:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.option input[type="checkbox"]:checked::after {
    content: '\2713';
    color: white;
    font-size: 15px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
}

.option-container.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px 16px;
}

.horizontal-options {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  justify-content: flex-start;
  padding-top: 3px;
}

.horizontal-options .option {
  width: auto !important;
  font-size: 14px;
}

.slider-container {
    width: 90%; 
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-group[data-option="difficulty"] input[type="range"] {
    width: 90%;  /* Faz o slider ocupar quase toda a largura do grupo */
    margin: 0 auto; /* Centraliza o slider dentro do grupo */
    display: block; /* Garante que ocupa uma linha separada */
}

.piece {
  position: relative;
}

.piece .move-number {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.6em;
  background: transparent;
  top: 15%;
  left: 15%;
  padding: 4px 2px;
  border-radius: 4px;
  font-weight: bold;
  z-index: 2; 
  pointer-events: none;
}

.emoji-options-container, .piece-options-container {
    display: flex;
    justify-content: space-around; /* Distribui os grupos de forma equilibrada */
    gap: 20px; /* Espaço entre as colunas */
}

.emoji-group, .piece-group {
    flex: 1; /* Cada grupo ocupa metade do espaço */
    min-width: 180px; /* Garante que não fique muito pequeno */
    max-width: 200px; /* Garante que não fique muito grande */
}

.custom-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-emoji-input {
    width: 22px; /* Largura fixa */
    height: 22px; /* Altura fixa para parecer um botão */
    font-size: 16px; /* Texto maior para o emoji */
    text-align: center; /* Centraliza o emoji */
    border: 2px solid #007bff; /* Borda azul para destaque */
    border-radius: 8px; /* Cantos arredondados */
    background-color: white;
    transition: border-color 0.3s;
}

.custom-emoji-input:focus {
    border-color: #7faad8; /* Azul mais escuro quando está ativo */
}



/* ------------ */


/* Painel de Fim de Jogo */
.endgame-inline {
    display: block;
    position: absolute;

    transform: translate(-50%, -50%);
    
    background-color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    
    text-align: center;
    z-index: 1000;
    max-width: 90vw;

    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.hidden {
    display: none !important;
}

/* Quando vai desaparecer */
.endgame-inline.fade-out {
    opacity: 0;
    pointer-events: none;
}
/* ------------ */


/* Histórico */
.history-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px auto;
    max-width: 600px;
}

.history-controls button {
    background: #4a6fa5;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: background 0.3s;
}

.history-controls button:hover {
    background: #2e4a6e;
}

.history-controls button:disabled {
    background: #cccccc;
    cursor: not-allowed;
}
.history-controls button.inactive {
  background-color: #cccccc !important;
  cursor: not-allowed;
  opacity: 0.6;
}

.history-controls button.inactive:hover {
  background-color: #cccccc !important;
  transform: none;
}
.move-current {
  background-color: #fff8dc !important; /* cor creme */
}

.review-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}

.history-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.exit-review-container {
  margin-top: 12px;
}

#exit-review-button {
  padding: 10px 24px;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  background-color: #a9b1a9;;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s;
}

#exit-review-button:hover {
  background-color: #cacfca;
}

#learning-panel {
  background-color: white;
  border-left: 1px solid #ccc;
  padding: 16px;
  font-family: sans-serif;
  width: 280px;
  flex-shrink: 0;
  box-shadow: -2px 0 4px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  display: none;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  height: 100%;
  max-height: 100%;
}

.move-history {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
}

.move-history th,
.move-history td {
  border: 1px solid #ddd;
  padding: 6px 8px;
  font-size: 14px;
  text-align: center;
}

.move-history thead {
  background-color: #f0f0f0;
  position: sticky;
  top: 0;
}

.move-history tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* Painel de Estatísticas */
.stats-side-panel {
  background-color: white;
  border-right: 1px solid #ccc;
  padding: 16px;
  font-family: sans-serif;
  width: 280px;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  height: 100%;
  max-width: 100%;
}

.stats-side-panel .tabs {
  display: flex;
  justify-content: space-around;
  margin-bottom: 10px;
  gap: 6px;
}

.stats-side-panel .tab {
  padding: 6px 12px;
  border: none;
  background: #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.stats-side-panel .tab.active {
  background: #a9b1a9;
  color: white;
}

.stats-side-panel .summary-section {
  margin-bottom: 12px;
  font-size: 14px;
}

.stats-side-panel table {
  width: auto;
  min-width: 100%;
  table-layout: auto;
}


.stats-side-panel th,
.stats-side-panel td {
  white-space: nowrap;
  text-align: center;
  padding: 6px 6px;

}
#stats-panel {
  display: flex;
  flex-direction: column;
  max-height: 65vh; /* Protege em ecrãs pequenos */
  width: 90%;
  max-width: 400px;
  border-radius: 10px;
  padding: 10px;
  flex-shrink: 0;
}

.stats-content {
  overflow-y: auto;
  max-height: 60vh; /* Área scrollável visível */
  margin-bottom: 20px;
}

.hidden {
  display: none !important;
}

.stats-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* Container geral - ESSENCIAL */
.game-container {
    position: relative;
    flex-direction: row;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
#game-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.col-labels {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

.row-labels {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

.row-label {
    width: 25px;
    text-align: right;
    margin-top: 14px;
    margin-left: -5px;
}

  /* Estilo para os containers de labels */
 /* Estilos para os containers de rótulos e setas */
.col-label-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.col-arrow-top {
    font-size: 16px;
    margin-top: -7px;
    margin-left: -32px;
    position: relative;
    z-index: 12;
}

.col-arrow-bottom {
    font-size: 16px;
    margin-top: -32px;
    margin-left: -25px;
    position: relative;
    z-index: 12;
}
.board-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;  /* Igual ao cellSize */
    height: 25px; /* Altura reduzida para labels de coluna */
    font-size: 12px;
    font-weight: bold;
    color: #333;
    user-select: none;
}

/* Estilos para as legendas hexagonais */
.board-label-hex {
    position: relative;
    z-index: 10;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    text-align: center;
    pointer-events: none;
}

.row-label-hex {
    width: 20px;
    text-align: right;
    margin-top: -5px;
    margin-left: -5px;
}

.col-label-top {
    width: 20px;
    margin-top: 7px;
    margin-left: -7px;
}

.col-label-bottom {
    width: 20px;
    margin-top: -5px;
    margin-left: -5px;
}


.defasada .col-label {
    color: #666;
    font-style: italic;
}

.row-labels-left, 
.col-labels-top, 
.col-labels-bottom {
    position: absolute;
    top: 0;
    left: 0;
}

#footer-iframe {
  width: 100%;
  border: none;
  display: block;
  overflow: hidden;
  
  /* Default height for single-line view */
  height: 25px;
}

#all-content {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 5px;
    width: 100%;
    max-width: 1700px; /* Ajuste conforme necessário */
    margin: 0 auto;
}

.sugest-inline {
  position: absolute;
  z-index: 100;
  background-color: white;
  border: 2px solid #444;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  max-width: 300px;
}

.sugest-inline.hidden {
  display: none;
}

@media (max-width: 768px) {
  #all-content {
    flex-direction: column;  
    align-items: center;
  }

  #learning-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid #ccc;
    height: auto !important;
  }
  
  .stats-side-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #ccc;
    height: auto !important;
  }

}