@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* === SEÇÃO DE FILTROS === */
.filtros-container {
  margin-bottom: 30px;
  border-radius: 8px;
}


.filtros-linha {
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.filtro-grupo {
  flex: 1;
  min-width: 200px;
}

.filtro-grupo:last-child {
  flex: 0 0 auto;
}

.filtro-grupo label {
  display: block;
  margin-bottom: 5px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.filtro-procurar-container {
  position: relative;
  width: 100%;
}

.filtro-procurar-container input {
  width: 100%;
  padding: 10px 35px 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
}

.filtro-procurar-container .fas {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
}

.filtro-grupo select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  height: 40px;
  box-sizing: border-box;
}

.filtro-grupo button {
  background-color: #8d0202;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  cursor: pointer;
  font-size: 14px;
  height: 40px;
  box-sizing: border-box;
  margin-right: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.filtro-grupo button:hover {
  background-color: #2a5d8f;
}

.filtro-grupo .btn-secondary {
  background-color: transparent;
  border: 2px solid #6c757d;
  color: #6c757d;
  margin-right: 0;
}

.filtro-grupo .btn-secondary:hover {
  background-color: #6c757d;
  color: white;
}

.filtro-botoes {
  display: flex;
  gap: 10px;
}

/* === ESTILOS PARA CHECKBOX FILTERS === */
.filtro-checkbox-container {
  position: relative;
  width: 100%;
}

.checkbox-toggle {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  height: 40px;
  box-sizing: border-box;
  background: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.3s ease;
}

.checkbox-toggle:hover {
  border-color: #8d0202;
}

.checkbox-toggle i {
  transition: transform 0.3s ease;
}

.checkbox-toggle.active i {
  transform: rotate(180deg);
}

.checkbox-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.checkbox-dropdown.show {
  display: block;
}

.checkbox-option {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}

.checkbox-option:hover {
  background-color: #f8f9fa;
}

.checkbox-option input[type="checkbox"] {
  margin-right: 8px;
  width: 16px;
  height: 16px;
}

.checkbox-option .checkmark {
  width: 16px;
  height: 16px;
  border: 1px solid #ccc;
  border-radius: 3px;
  margin-right: 8px;
  display: inline-block;
  position: relative;
  transition: all 0.2s ease;
}

.checkbox-option input[type="checkbox"]:checked + .checkmark {
  background-color: #8d0202;
  border-color: #8d0202;
}

.checkbox-option input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  left: 2px;
  top: -2px;
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.checkbox-option input[type="checkbox"] {
  display: none;
}

/* === ÍCONES FONT AWESOME === */
.fa-icon-style {
  font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', 'FontAwesome' !important;
  font-weight: normal !important;
  font-style: normal !important;
}

.sort-icon {
  margin-left: 8px;
  color: #0D3C66;
  opacity: 0.7;
}

.sort-icon-active {
  margin-left: 8px;
  color: #0D3C66;
}

/* === PAGINAÇÃO === */
.pagination-container {
  text-align: center;
  width: 100%;
  margin-top: 20px;
}

.pagination {
  gap: 5px;
  display: inline-flex;
  margin: 0 auto;
}

.paginate_button {
  min-width: 36px;
  min-height: 36px;
  width: 36px;
  height: 36px;
  padding: 5px;
  margin: 0 2px;
  border: none;
  border-radius: 3px;
  text-align: center;
  line-height: 26px;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.paginate_button.current {
  background-color: #8d0202;
  color: white;
  border: none;
  font-weight: normal;
}

.paginate_button.disabled {
  opacity: 0.5;
  color: #6c757d;
}

.paginate_button.previous,
.paginate_button.next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.paginate_button .page-link {
  border: none;
  padding: 8px 12px;
  color: #212529;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.paginate_button.active .page-link {
  background-color: #8d0202;
  border: 1px solid #8d0202;
  color: white;
}

.paginate_button.disabled .page-link {
  color: #6c757d;
}

.paginate_button .fas {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
}

/* Estilos para a seção de filtros */
.filtros-container {
  font-family: 'Poppins', sans-serif;
}

.filtros-container .filtro-grupo label {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  color: #333;
  font-size: 14px;
  margin-bottom: 5px;
  display: block;
}

.filtros-container input,
.filtros-container select {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px 12px;
  transition: border-color 0.3s ease;
}

.filtros-container input:focus,
.filtros-container select:focus {
  outline: none;
  border-color: #8d0202;
  box-shadow: 0 0 0 2px rgba(53, 118, 175, 0.2);
}

.filtros-container button {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  background-color: #8d0202;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.filtros-container button:hover {
  background-color: #8d0202;
  opacity: 0.9;
}

/* Responsividade para filtros */
@media (max-width: 1200px) {
  .filtros-linha {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filtro-grupo {
    width: 100%;
    min-width: auto;
  }
  
  .filtro-grupo:last-child {
    flex: 1;
  }
  
  .filtro-botoes {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .filtros-container {
    padding: 15px;
  }
  
  .filtros-titulo h2 {
    font-size: 20px;
  }
  
  .filtro-grupo label {
    font-size: 13px;
  }
  
  .filtro-grupo input,
  .filtro-grupo select,
  .filtro-grupo button {
    font-size: 13px;
    padding: 6px 10px;
  }
}

/* Estilo da tabela de projetos */
.tabela-ppp {
  width: 100%;
  background-color: #fff;
  border-collapse: collapse;
  font-family: 'Poppins', sans-serif;
}

/* Forçar estilos do DataTables */
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: #8d0202 !important;
  background-color: #8d0202 !important;
  border: none !important;
  color: white !important;
  border-radius: 3px;
  font-weight: normal;
  box-shadow: none !important;
}

/* Estilos para os botões de paginação */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 0;
  margin: 0 0.2em;
  border: none !important;
  border-radius: 3px;
  background-color: #fff !important;
  color: #333 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 36px;
  min-height: 36px;
  width: 36px;
  height: 36px;
  text-align: center;
  cursor: pointer !important;
  position: relative !important;
  z-index: 11 !important;
  line-height: 1;
  font-family: 'Poppins', sans-serif;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background-color: #f4f4f4 !important;
  color: #0D3C66 !important;
  border: none !important;
}

/* Garantir que a paginação seja visível */
.dataTables_wrapper .dataTables_paginate {
  display: flex !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
  margin: 20px auto !important;
  width: 100% !important;
  position: relative !important;
  z-index: 10 !important;
  clear: both !important;
}

/* Estilo para a lista de paginação */
.dataTables_wrapper .dataTables_paginate ul.pagination {
  display: inline-flex !important;
  gap: 5px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  list-style: none !important;
}

/* Forçar exibição da paginação mesmo com poucos registros */
.dataTables_wrapper .bottom {
  display: block !important;
  margin-top: 15px !important;
}

/* FORÇAR paginação a aparecer sempre - MÁXIMA PRIORIDADE */
.dataTables_wrapper .dataTables_paginate,
#tabela-ppp_paginate,
.dataTables_paginate,
#tabela-ppp_wrapper .dataTables_paginate,
.paging_simple_numbers {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  overflow: visible !important;
  position: relative !important;

  text-align: center !important;
  z-index: 9999 !important;
  background: white !important;

  width: 100% !important;
}

/* Forçar botões de paginação a aparecer - MÁXIMA PRIORIDADE */
.dataTables_wrapper .dataTables_paginate .paginate_button,
.paginate_button,
#tabela-ppp_paginate .paginate_button,
.paging_simple_numbers .paginate_button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 9999 !important;
  background: white !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 2px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 1 !important;
  text-align: center !important;
  vertical-align: middle !important;
  font-size: 14px !important;
}

/* REGRA GLOBAL - FORÇAR QUALQUER PAGINAÇÃO A APARECER */
*[class*="paginate"],
*[id*="paginate"],
*[class*="paging"] {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Estilo para botões de paginação desabilitados mas visíveis */
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  display: inline-block !important;
}

/* Estilo para os ícones de seta na paginação */
.dataTables_wrapper .dataTables_paginate .paginate_button i.fas {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
  font-size: 16px;
  color: inherit;
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
  font-weight: normal !important;
  font-style: normal !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Estilo específico para os botões de navegação (anterior e próximo) */
.dataTables_wrapper .dataTables_paginate .paginate_button.previous,
.dataTables_wrapper .dataTables_paginate .paginate_button.next {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Estilo para os links de paginação para garantir alinhamento correto dos ícones */
.dataTables_wrapper .dataTables_paginate .paginate_button a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Forçar exibição de paginação mesmo com 1 página */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  display: inline-block !important;
}

/* Estilos para ícones SVG */
svg.detalhe-icon path, 
.dataTables_paginate .paginate_button svg path {
  stroke: #8d0202;
}

/* Estilos para ícones de ordenação */
/* Incluir Font Awesome para ícones de ordenação */
/* Garantir que os ícones Font Awesome sejam carregados corretamente */
.fas, .far, .fab, .fa {
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
  font-weight: normal !important;
  font-style: normal !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Permitir ícones de ordenação personalizados */

/* Estilo para os cabeçalhos da tabela */
table.dataTable thead th {
  cursor: pointer;
}

/* Desabilitar pseudo-elementos padrão do DataTables */
table.dataTable thead th.sorting::before,
table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::before,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::before,
table.dataTable thead th.sorting_desc::after {
  display: none !important;
  content: none !important;
}

/* Garantir que colunas ordenáveis tenham cursor pointer */
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
  cursor: pointer !important;
}

/* Estilos para os ícones Font Awesome adicionados via JavaScript */
table.dataTable thead th .fas {
  display: inline;
  margin-left: 8px;
  color: #fff;
  opacity: 0.9;
  transition: opacity 0.3s ease;
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
  font-weight: normal !important;
  font-style: normal !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

table.dataTable thead th:hover .fas {
  opacity: 1;
}

/* Estilos da tabela com ordenação */

/* Sobrescrever estilos do Bootstrap e DataTables */
.tabela-ppp.table-striped > tbody > tr,
.tabela-ppp.table-striped > tbody > tr:nth-of-type(odd),
.tabela-ppp.table-striped > tbody > tr:nth-of-type(even) {
  background-color: #fff !important;
}

/* Estilo para hover nas linhas da tabela - com especificidade aumentada */
.tabela-ppp tbody tr:hover,
table.dataTable tbody tr:hover,
table.dataTable.hover tbody tr:hover,
table.dataTable.stripe tbody tr.odd:hover,
table.dataTable.stripe tbody tr.even:hover,
#tabela-ppp tbody tr:hover,
.table-responsive #tabela-ppp tbody tr:hover {
  background-color: #F4F4F4 !important;
}

/* Estilo para texto em hover nas linhas da tabela - com especificidade aumentada */
.tabela-ppp tbody tr:hover td,
table.dataTable tbody tr:hover td,
#tabela-ppp tbody tr:hover td,
.table-responsive #tabela-ppp tbody tr:hover td {
  color: #0D3C66 !important;
  background-color: #F4F4F4 !important;
  font-weight: 500 !important;
}

.tabela-ppp thead th {
  background-color: #8d0202;
  color: #fff !important;
  font-weight: 500;
  padding: 0 15px;
  border: none;
  height: 75px;
  vertical-align: middle;
  font-family: 'Poppins', sans-serif;
}

.tabela-ppp tbody td {
  padding: 0 15px;
  border: none;
  border-bottom: 2px solid #D3D3D3;
  color: #333;
  background-color: #fff;
  height: 75px;
  vertical-align: middle;
  font-weight: 400;
  font-family: 'Poppins', sans-serif;
}

/* Permitir quebra de linha na coluna de província */
.tabela-ppp tbody td:nth-child(4) {
  white-space: normal;
  height: auto;
  min-height: 75px;
  line-height: 1.4;
}

.tabela-ppp tbody tr:last-child td {
  border-bottom: 2px solid #D3D3D3;
}

/* Remover qualquer efeito zebra que possa existir e definir altura das linhas */
.tabela-ppp tbody tr,
.tabela-ppp tbody tr:nth-child(odd),
.tabela-ppp tbody tr:nth-child(even),
.tabela-ppp tbody tr.odd,
.tabela-ppp tbody tr.even,
.table-striped > tbody > tr:nth-of-type(odd),
.table-striped > tbody > tr:nth-of-type(even),
.table-hover > tbody > tr:hover {
  height: 75px;
  background-color: #fff !important;
  font-weight: 400;
}

/* Forçar fundo branco para linhas da tabela DataTables */
#tabela-ppp tbody tr,
table.dataTable tbody tr,
table.dataTable.stripe tbody tr.odd,
table.dataTable.stripe tbody tr.even {
  background-color: #fff !important;
  font-weight: 400;
}

/* Estilo para o campo de busca */
.dataTables_filter input {
  border: 1px solid #ced4da;
  border-radius: 6px;
  padding: 6px 10px;
  outline: none;
  transition: box-shadow 0.2s ease;
}

.dataTables_filter input:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Estilo para os botões de paginação */
.dataTables_paginate {
  margin-top: 15px !important;
  margin-bottom: 15px !important;
}

.dataTables_paginate .paginate_button {
  border-radius: 0;
  margin: 0 2px;
  padding: 0;
  width: 40px;
  height: 40px;
  border: none;
  background-color: #fff;
  color: #333 !important;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dataTables_paginate .paginate_button.first,
.dataTables_paginate .paginate_button.last {
  display: none;
}

.dataTables_paginate .paginate_button svg {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

.dataTables_paginate .paginate_button:hover {
  background-color: transparent !important;
  border-color: transparent !important;
  color: #333 !important;
}

.dataTables_paginate .paginate_button.current,
.dataTables_paginate .paginate_button.current:hover {
  background-color: #8d0202 !important;
  border: 2px solid #8d0202 !important;
  color: white !important;
  box-shadow: none !important;
}

/* Estilo para página ativa */
.dataTables_wrapper .dataTables_paginate .paginate_button.active,
.dataTables_wrapper .dataTables_paginate .paginate_button.active a,
.dataTables_wrapper .dataTables_paginate .paginate_button.active .page-link,
.pagination .page-item.active .page-link {
  background-color: #8d0202 !important;
  border-color: #8d0202 !important;
  color: white !important;
  border: 1px solid #8d0202 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.active:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.active a:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.active .page-link:hover {
  background-color: #8d0202 !important;
  border-color: #8d0202 !important;
  color: white !important;
}

.dataTables_paginate .paginate_button.disabled {
  color: #6c757d !important;
  pointer-events: none;
  opacity: 0.6;
}

/* Ícone de detalhes */
.detalhe-icon {
  cursor: pointer;
  vertical-align: middle;
  display: inline-block;
}

/* Estilos para paginação */
.pagination-wrapper {
  margin-top: 20px;
}

.pagination-container {
  text-align: center;
  width: 100%;
}

/* Estilos para garantir que a paginação esteja abaixo da tabela e centralizada */
#tabela-ppp_wrapper .dataTables_paginate {
  text-align: center;
  width: 100%;
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

#tabela-ppp_wrapper .pagination {
  display: inline-flex;
  gap: 5px;
  margin: 0 auto;
}

.pagination-style {
  gap: 5px;
  display: inline-flex;
  margin: 0 auto;
}

.pagination-active {
  border: 1px solid #8d0202 !important;
  background-color: #8d0202 !important;
  color: white !important;
  padding: 8px 12px;
}

.pagination-inactive {
  border: none !important;
  padding: 8px 12px;
  color: #212529;
}

.pagination-nav-link {
  border: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  color: #212529;
}

.pagination-disabled {
  color: #6c757d !important;
}

.filtro-sector {
  margin-left: 25px;
}