/* Estilos Compartilhados para Páginas de Avaliação Física */

/* Highlight para tabelas */
.highlight {
  background-color: #606060 !important;
  color: #FFFFFF !important;
  font-weight: bold;
}

.highlight-cell {
  background-color: #606060 !important;
  color: #FFFFFF !important;
}

/* Container de tabela responsiva */
.table-responsive {
  max-height: 400px;
  overflow-x: auto;
  overflow-y: auto;
}

/* Estilos de células de tabela */
table td, table th {
  font-size: 14px;
  text-align: center;
  vertical-align: middle;
  width: 14.2%;
}

/* Labels em negrito */
label {
  font-weight: bold;
}

/* Valores em cards */
.card-value {
  font-size: 2rem;
  font-weight: bold;
}

/* Mensagens de erro (traço vermelho quando sem cálculo) */
.error {
  color: red;
}

/* Cards padrão - sem sombra */
.card {
  box-shadow: none !important;
}

/* Card de classificação - título preto por padrão */
.card-classificacao .card-title {
  color: #000;
}

/* O valor da classificação (texto) é branco, para fundos coloridos */
.card-classificacao .card-value {
  color: #fff;
}

/* O traço de erro deve ser sempre vermelho */
.card-classificacao .card-value .error {
  color: red !important;
}

/* Card de 1RM - título e texto sempre pretos */
.card-1rm .card-value,
.card-1rm .card-title {
  color: #000000 !important;
}

/* Card de força relativa - título branco, valor assume cor da classificação */
.card-forca-relativa .card-title {
  color: #000000;
}

.card-forca-relativa .card-value {
  color: #000000; /* Será sobrescrito dinamicamente */
}

/* Título de tabelas colapsáveis */
.table-title {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.table-title i {
  margin-right: 0.5rem;
  transition: transform 0.3s;
}

.table-title.collapsed i {
  transform: rotate(-90deg);
}

/* Inputs readonly */
input[readonly],
input[readonly]:focus {
  background-color: #e9ecef;
  box-shadow: none;
}

/* Cards de resultado - sem sombra */
.result-card {
  border: 1px solid #dee2e6;
  border-radius: .5rem;
  box-shadow: none !important;
  padding: 1rem;
  text-align: center;
}

.result-card h5 {
  margin-bottom: .5rem;
  color: #000000;
}

/* Card de 1RM - título e texto sempre pretos */
.result-card.card-1rm h5,
.result-card.card-1rm .card-value {
  color: #000000 !important;
}

/* Card de classificação - texto do resultado fica branco quando há uma classe de classificação */
.result-card.card-classificacao[class*="class-"] .card-value {
  color: #FFFFFF !important;
}

/* Card de força relativa - título preto, valor assume cor dinâmica */
.result-card.card-forca-relativa h5 {
  color: #000000 !important;
}

/* Classes de classificação */
.class-excelente {
  background-color: #32CD32;
  color: white;
}

.class-muito-bom {
  background-color: #1E90FF;
  color: white;
}

.class-bom {
  background-color: #87CEFA;
  color: white;
}

.class-acima-da-media {
  background-color: #1e90ff;
  color: white;
}

.class-media {
  background-color: #FFD700;
  color: white;
}

.class-regular {
  background-color: #FFD700;
  color: white;
}

.class-abaixo-da-media {
  background-color: #FF7F50;
  color: white;
}

.class-baixo {
  background-color: #FF7F50;
  color: white;
}

.class-fraco {
  background-color: #FF4C4C;
  color: white;
}

.class-muito-baixo {
  background-color: #ff4c4c;
  color: white;
}

/* Controle de exibição de texto das abas */
.tab-text-short {
  display: none;
}

.tab-text-full {
  display: inline;
}

/* Wrapper para tabela com scroll horizontal e coluna fixa */
.fixed-column-table-wrapper {
  position: relative;
  overflow: hidden;
}

.fixed-column-table-wrapper .table-responsive {
  overflow-x: auto;
  overflow-y: visible;
  margin-left: 100px; /* Largura da coluna fixa */
}

.fixed-column-table-wrapper table {
  margin-bottom: 0;
}

/* Coluna fixa - Faixa Etária */
.fixed-column-table-wrapper .fixed-column {
  position: absolute;
  left: 0;
  top: 0;
  width: 100px;
  background-color: #fff;
  z-index: 10;
  border-right: 2px solid #dee2e6;
}

.fixed-column-table-wrapper .fixed-column table {
  margin-bottom: 0;
  width: 100px;
  table-layout: fixed;
}

.fixed-column-table-wrapper .fixed-column th,
.fixed-column-table-wrapper .fixed-column td {
  width: 100px;
  background-color: #fff;
  border-right: 1px solid #dee2e6;
  white-space: nowrap;
  box-sizing: border-box;
  line-height: 1.5;
}

.fixed-column-table-wrapper .fixed-column thead th {
  background-color: #f8f9fa !important;
}

/* Garantir mesmo box-sizing e line-height para tabela scrollável */
.fixed-column-table-wrapper .table-responsive table th,
.fixed-column-table-wrapper .table-responsive table td {
  box-sizing: border-box;
  line-height: 1.5;
}

/* Ocultar primeira coluna na tabela scrollável */
.fixed-column-table-wrapper .table-responsive table th:first-child,
.fixed-column-table-wrapper .table-responsive table td:first-child {
  display: none;
}

/* Garantir largura mínima para colunas de classificação na tabela scrollável */
.fixed-column-table-wrapper .table-responsive table th:not(:first-child),
.fixed-column-table-wrapper .table-responsive table td:not(:first-child) {
  min-width: 90px;
  white-space: nowrap;
}

/* Responsividade para dispositivos móveis */
@media (max-width: 767px) {
  .row.g-3.mb-4 > div {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .row.mb-4 > .col-md-4 {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 1rem;
  }

  .card-value {
    font-size: 1.8rem;
  }

  table td, table th {
    font-size: 12px;
  }
  
  /* Ativar tabela com coluna fixa apenas em mobile */
  .fixed-column-table-wrapper .table-responsive {
    margin-left: 100px;
  }
  
  .fixed-column-table-wrapper .fixed-column {
    display: block;
  }
  
  /* Ajustar padding para células na tabela com scroll */
  .fixed-column-table-wrapper table td,
  .fixed-column-table-wrapper table th {
    padding: 0.4rem;
  }
  
  /* Abreviar texto das abas em mobile */
  .tab-text-full {
    display: none;
  }
  
  .tab-text-short {
    display: inline;
  }
}

/* Em telas maiores, desabilitar coluna fixa */
@media (min-width: 768px) {
  .fixed-column-table-wrapper .table-responsive {
    margin-left: 0 !important;
  }
  
  .fixed-column-table-wrapper .fixed-column {
    display: none !important;
  }
  
  .fixed-column-table-wrapper .table-responsive table th:first-child,
  .fixed-column-table-wrapper .table-responsive table td:first-child {
    display: table-cell !important;
  }
}
