/* ============================================
   0) VARIÁVEIS GLOBAIS
   ============================================ */
@import url('https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css');
@import url('https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700');
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,700');

@import url("../../user_interface_standards/styles/colors/qmd_cores.css");
@import url("../../user_interface_standards/styles/fonts/qmd_fonte.css");

:root {
  --estat-row-height: 27px;    
  --estat-row-border-w: 1px;    
  --estat-row-border-c: #e3e3e3;
}

html, body, button, input, select, textarea {
  font-family: var(--fonts);
}

/* ============================================
   1) RESET E BASE
   ============================================ */

iframe {
  border: 0;
  margin: 0;
  padding: 0;
  width: 100%;
}

ul,
.estatisticas ul,
.comparativo ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ============================================
   2) UTILITÁRIOS DE ESPAÇAMENTO / ALINHAMENTO
   ============================================ */

.espaco_esquerda {
  padding-left: 60px;
}

.espaco_direita {
  padding-right: 60px;
  text-align: right;
}

/* ============================================
   3) UI GLOBAIS (JQUERY UI ESTADOS)
   ============================================ */

.ui-state-active {
  background: var(--secondary-color-500) !important;
  border: var(--secondary-color-300);
}

.ui-state-collapsed {
  background: var(--neutral-gray-50) !important;
  border: var(--institutional-blue-600);
}

/* ============================================
   4) CONTÊINER PRINCIPAL
   ============================================ */

#dvCorpo {
  background-color: var(--secondary-color-500);
  border: 1px solid var(--neutral-gray-700);
  border-radius: 5px;
  font-size: var(--font-size-sm);
  height: 779px;

  width: 961px;
}

#featured-content div.width-16 {
  padding-top: 49px !important;
}

/* ============================================
   5) SEÇÃO MAPA
   ============================================ */

.content-mapa {
  margin: 0;
  padding: 0;
  width: 100%;
}

.mapa {
  margin-top: 2em;
  position: relative;
  width: 100%;
}

.mapa label {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin: 0;
  padding: 0;
}

#dvTituloMapa {
  border: 1px solid var(--neutral-gray-600);
  border-radius: 6px 6px 0 0;
  width: 100%;
}

#dvTituloMapa>span {
  border-radius: 3px;
  display: block;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  padding: 10px;
}

#tituloMapa,
#subtituloMapa {
  display: inline-block;
  width: 50%;
}

#subtituloMapa {
  text-align: right;
}

#mapa {
  border: 1px solid var(--neutral-gray-1000);
  margin-top: -1px;
  max-height: 60vh;
  min-height: 640px;
  position: relative;
  width: 100%;
}

#legenda_mapa {
  border: 1px solid var(--neutral-gray-0);
  border-radius: 3px;
  bottom: 18px;
  max-height: 54px;
  max-width: 459px;
  opacity: 0.8;
  position: absolute;
  right: 1px;
  width: 100%;
  z-index: 1000;
}

.legenda {
  cursor: default;
  display: block;
  font-size: var(--font-size-lg);
  font-style: italic;
  margin-top: 0.8em;
  text-align: center;
  width: 100%;
}

#slider {
  margin: 15px 15px 15px 20px;
  position: relative;
}

/* ============================================
   6) ESTATÍSTICAS
   ============================================ */

.comparativo section {
  border-top: 1px solid var(--secondary-color-200);
  display: block;
  height: auto;
  margin-top: -1px;
  padding-top: 1em;
  width: 100%;
  z-index: 0;
}

span {
  color: var(--text-on-light);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.situacao-atual {
  color: var(--neutral-gray-500) !important;
  display: inline-block;
  font-size: clamp(var(--font-size-lg), 3vw, var(--font-size-2xl));
  font-weight: var(--font-weight-medium);
  padding-top: 20px !important;
  width: 100%;
}

.span_h2 {
  color: var(--neutral-gray-700) !important;
  font-size: clamp(var(--font-size-base), 3vw, var(--font-size-xl));
  font-weight: var(--font-weight-medium);
}

#main h2 {
  border-bottom: 1px solid var(--neutral-gray-700) !important;
  color: var(--neutral-gray-700) !important;
  display: inline-block;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  padding-top: 20px !important;
  width: 100%;
  margin-bottom: 0 !important;
}

.estatisticas {
  display: block;
  position: relative;
  width: 100%;
}

.estatisticas .estatistica {
  border: 0.5px solid var(--neutral-gray-600);
  border-radius: 5px;
  display: inline-block;
  margin: 2em 1em 0 0em;
  width: calc(50% - 1.2em);
}


.estatisticas .estatistica>div {
  display: block;
  font-size: var(--font-size-lg);
  padding: 0.25em 1em 0.25em 0.5em;
}

.focos-border {
  border-bottom: 1px solid var(--neutral-gray-600);
}

.estatisticas .titulo {
  color: var(--text-on-light) !important;
  cursor: default;
  display: inline-block !important;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  width: 57%;
}

.estatisticas .inline li {
  display: inline-block;
  padding: 0 0.2em;
}

.estatisticas ul {
  display: inline-block !important;
  text-align: right;
  width: 42%;
}

.comparativo ul {
  margin-top: 0;
  text-align: right;
  width: 100% !important;
  z-index: 1000;
}

.estatisticas .estatistica h2 {
  display: inline-block;
  width: auto;
}

.estatistica .viz-stack {
  background: var(--neutral-gray-0);
  height: 365px;
  min-height: 245px;
  position: relative;
  width: 100%;
}

.segunda-linha .viz-stack {
  height: 280px !important;
}

.viz-stack {
  height: var(--chart-height);
  min-height: 320px;
  position: relative;
}

.viz-layer {
  height: 100%;
  inset: 0;
  overflow: auto;
  position: absolute;
  width: 100%;
}

.estatistica .viz-layer iframe,
.estatistica .chart-mount canvas {
  display: block;
  height: 100% !important;
  width: 100% !important;
}

.estatistica .chart-mount canvas {
  transform: scale(0.92);
  transform-origin: center;
}

.estatistica .chart-mount {
  height: 100%;
  overflow: auto;
  width: 100%;
}

.estatistica .scroll-tabela .tabela-estatistica {
  width: 100%;
  border-collapse: collapse;       
}

.estatistica .scroll-tabela .tabela-estatistica tr {
  height: var(--estat-row-height);
}

.estatistica .scroll-tabela .tabela-estatistica th,
.estatistica .scroll-tabela .tabela-estatistica td {
  padding-top: 0;
  padding-bottom: 0;
  line-height: var(--estat-row-height);
  vertical-align: middle;
  white-space: nowrap;   
  overflow: hidden;      
  text-overflow: ellipsis;
}

.estatistica .scroll-tabela .tabela-estatistica tr th,
.estatistica .scroll-tabela .tabela-estatistica tr td {
  border-bottom: var(--estat-row-border-w) solid var(--estat-row-border-c);
}

.estatistica .scroll-tabela .tabela-estatistica tbody tr:last-child th,
.estatistica .scroll-tabela .tabela-estatistica tbody tr:last-child td {
  border-bottom: none;
}

#div-focos-estado,
#div-focos-bioma {
  float: right;
  margin-right: 0;
  margin-left: 1em;
}

#div-focos-paises,
#div-focos-municipio {
  float: left;
  margin-left: 0;
}

.estatisticas::after {
  content: "";
  display: block;
  clear: both;
}

/* ============================================
   7) TABS INLINE
   ============================================ */

.inline li {
  background: var(--neutral-gray-0);
  border: 2px solid var(--neutral-gray-0);
  border-radius: 3px;
  cursor: pointer;
  font-size: var(--font-size-lg);
}

.inline li.active {
  color: var(--secondary-color-500);
  cursor: default;
}

/* ============================================
   8) PAGINAÇÃO (QMD + TABELA)
   ============================================ */

.qmd-tabela-paginada {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.qmd-tabela-paginada .qmd-pagina {
  flex: 1 1 auto;
  overflow: auto;
  width: 100%;
}

.qmd-tabela-paginada .qmd-paginacao,
.tabela-paginada .paginacao {
  background: var(--neutral-gray-0);
  display: flex;
  gap: 10px;
  justify-content: center;
  z-index: 1;
}

.qmd-dot,
.tabela-paginada .paginacao .dot {
  appearance: none;
  background: transparent !important;
  border: 2px solid var(--secondary-color-500) !important;
  border-radius: 50%;
  cursor: pointer;
  height: 12px;
  line-height: 0;
  padding: 0;
  width: 12px;
}

.qmd-dot.qmd-ativo {
  background: var(--primary-color-500) !important;
  border-color: var(--primary-color-500) !important;
}

.qmd-dot:focus-visible {
  outline: 2px solid var(--neutral-gray-800);
  outline-offset: 2px;
}

/* ============================================
   9) TABELA DATAFRAME
   ============================================ */

table.dataframe {
  border-collapse: collapse;
  border-radius: 25px;
  font-family: var(--fonts);
  font-size: var(--font-size-sm);
  height: 100%;
  table-layout: fixed;
  text-align: right;
  width: 100%;
}

table.dataframe thead {
  display: none;
}

table.dataframe tr:nth-child(even) {
  background-color: var(--secondary-color-100);
}

table.dataframe tr {
  background-color: var(--secondary-color-200);
}

table.dataframe th,
table.dataframe td {
  overflow: auto;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

table.dataframe th {
  font-weight: var(--font-weight-medium);
}

table.dataframe td {
  font-weight: var(--font-weight-bold);
}

.scroll-tabela table.dataframe {
  border-collapse: separate;
  border-spacing: 0;
}

table.dataframe th:first-child,
table.dataframe td:first-child {
  padding-left: 50px;
  text-align: left;
  font-weight: var(--font-weight-bold);
}

table.dataframe td:first-child {
  text-align: right;
}

table.dataframe td:last-child {
  padding-right: 50px;
}

.comparativo table.dataframe {
  font-size: var(--font-size-base);
}

.comparativo table.dataframe th,
.comparativo table.dataframe td {
  min-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
  width: 80px;
}

.comparativo table.dataframe th {
  font-weight: var(--font-weight-medium);
}

.comparativo table.dataframe td {
  font-weight: var(--font-weight-bold);
}

.comparativo table.dataframe th:first-child,
.comparativo table.dataframe td:first-child {
  padding-left: none;
  width: 160px;
}

.comparativo .scroll-tabela table.dataframe th:first-child,
.comparativo .scroll-tabela table.dataframe td:first-child {
  background: var(--secondary-color-100);
  border-right: 1px solid var(--neutral-gray-1000);
  left: 0;
  overflow: visible;
  position: sticky;
  z-index: 2;
}

.comparativo .scroll-tabela {
  border: 1px solid var(--neutral-gray-1000);
}

.comparativo table.dataframe th,
.comparativo table.dataframe td {
  white-space: nowrap;
  padding: 3px 6px;
  min-width: 40px;
}

.comparativo table.dataframe th:not(:first-child),
.comparativo table.dataframe td:not(:first-child) {
  border-left: 1px solid var(--neutral-gray-600);
}

.comparativo table.dataframe th:nth-child(2),
.comparativo table.dataframe td:nth-child(2) {
  border-left: none;
}

.comparativo table.dataframe th,
.comparativo table.dataframe td {
  text-align: center;
}

.comparativo table.dataframe tbody tr:nth-child(odd),
.comparativo table.dataframe thead tr:nth-child(odd) {
  background-color: var(--secondary-color-200) !important;
}

.comparativo table.dataframe tbody tr:nth-child(even) {
  background-color: var(--secondary-color-100) !important;
}

.comparativo .scroll-tabela table.dataframe th:first-child,
.comparativo .scroll-tabela table.dataframe td:first-child {
  background-color: inherit !important;
}

.comparativo table.dataframe th,
.comparativo table.dataframe td {
  font-weight: var(--font-weight-regular);
}

.comparativo table.dataframe tbody tr:first-child>th,
.comparativo table.dataframe tbody tr:first-child>td {
  font-weight: var(--font-weight-bold);
}

.comparativo table.dataframe thead th,
.comparativo table.dataframe tbody th:first-child,
.comparativo table.dataframe tbody td:first-child {
  font-weight: var(--font-weight-bold);
}

table.dataframe.crosshair td.hl-cell,
table.dataframe.crosshair th.hl-cell {
  box-shadow: inset 0 0 0 1.25px var(--neutral-gray-500);
  outline: none;
}

.comparativo .scroll-tabela table.dataframe.crosshair tr.hl-row>th,
.comparativo .scroll-tabela table.dataframe.crosshair tr.hl-row>td,
.comparativo .scroll-tabela table.dataframe.crosshair td.hl-col,
.comparativo .scroll-tabela table.dataframe.crosshair th.hl-col {
  background-color: var(--secondary-color-50) !important;
}

table.dataframe td,
table.dataframe th {
  cursor: default !important;
}

table.dataframe.crosshair td,
table.dataframe.crosshair th {
  cursor: default !important;
}

.comparativo table.dataframe th,
.comparativo table.dataframe td {
  min-width: 75px;
  width: 75px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

/* ============================================
   10) SEÇÃO: COMPARATIVO
   - Bloco com título, abas/links e um conteúdo (iframe/gráfico)
   ============================================ */
.comparativo iframe {
  min-height: auto;
}

.comparativo>* {
  display: inline-block;
}

.comparativo>span {
  display: block;
  width: 100%;
}

.comparativo ul {
  display: block;
  margin-top: 0;
  text-align: right;
  width: 100% !important;
  z-index: 1000;
}

.comparativo li {
  cursor: pointer;
  text-align: center;
}

.descTempo {
  cursor: default;
  display: block;
  font-size: var(--font-size-base);
  padding: 0em 0em 0em 8.55px;
  margin-left: 0px !important;
}

.comparativo section>* {
  display: block;
  padding: 0;
  width: 100%;
}

.comparativo section a {
  font-size: var(--font-size-base);
  text-align: right;
  font-weight: var(--font-weight-bold);
}

.comparativo section a:hover {
  text-decoration: underline;
}

.span-situacao{
  padding-left: 0.2rem;
}

/* ============================================
   11) CHARTS / VARIÁVEIS CSS
   ============================================ */
.scroll-tabela {
  white-space: nowrap;

  background-color: var(--neutral-gray-50);
  border: 0;
  border-top: 1px solid var(--neutral-gray-600);
  height: 100%;
  overflow-x: auto;
  overflow-y: auto;
}

.scroll-tabela::-webkit-scrollbar {
  width: 8px;
}

.scroll-tabela::-webkit-scrollbar-track {
  background-color: var(--secondary-color-100);
  border-left: 1px solid var(--neutral-gray-100);
}

.scroll-tabela::-webkit-scrollbar-thumb {
  background-color: var(--secondary-color-500);
  border: 2px solid var(--secondary-color-100);
}

.scroll-tabela {
  scrollbar-color: var(--secondary-color-500) var(--secondary-color-100);
  scrollbar-width: thin;
}

/* ============================
   12) Toolbar dos Focos por País sem quebra
   ============================ */

.estatisticas .estatistica > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: nowrap;        
}

.estatisticas .titulo {
  flex: 1 1 auto;          
  min-width: 0;             
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  width: auto !important;   
}

.estatisticas ul {
  display: flex !important;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  width: auto !important;   
  overflow-x: auto;        
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.estatisticas .inline li,
.estatisticas ul li {
  flex: 0 0 auto;
  white-space: nowrap;
}

.estatisticas ul::-webkit-scrollbar { height: 6px; }
.estatisticas ul::-webkit-scrollbar-track { background: var(--secondary-color-100); }
.estatisticas ul::-webkit-scrollbar-thumb { background: var(--secondary-color-500); border: 2px solid var(--secondary-color-100); }

.comparativo section.links-linha {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: .8rem;
  width: 100%;
}

.comparativo section.links-linha a {
  display: inline-flex;   
  align-items: center;   
  width: auto !important;
  padding: 0;             
}

.comparativo section.links-linha a:hover {
  text-decoration: underline;
}

.comparativo section.links-linha a .fa,
.comparativo section.links-linha a .fas {
  color: var(--institutional-blue-500);
  margin-left: .2rem;
}

.csv_download{
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  text-align: left !important;
}

/* ============================================
   13) MEDIA QUERIES
   ============================================ */

@media (max-width: 992px) {
  .estatisticas .titulo {
    width: 48%;
  }

  .estatisticas ul {
    width: 50%;
  }

  table.dataframe {
    font-size: var(--font-size-sm);
  }
}

@media (max-width: 1030px) {
  .estatisticas .estatistica {
    width: calc(100% - 0em);
  }

  .estatisticas .titulo {
    width: 67%;
  }

  .estatisticas ul {
    width: 32%;
  }
}

@media (max-width: 1030px) {
  #div-focos-estado,
  #div-focos-bioma,
  #div-focos-paises,
  #div-focos-municipio {
    float: none;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 576px) {

  #main h1,
  #main h2 {
    margin-top: 1em;
  }

  .span_h2 {
    margin-top: 1em;
  }

  .estatisticas .estatistica {
    margin-left: 0;
    width: calc(100% - 2.2em);
  }

  .estatisticas .titulo {
    width: 42%;
  }

  .estatisticas ul {
    width: 56%;
  }

  #tituloMapa,
  #subtituloMapa {
    font-size: var(--font-size-xs);
    /* 12px */
  }

  table.dataframe {
    font-size: var(--font-size-sm);
  }
}

body.preload { overflow: hidden; }

#preloader {
  position: fixed; 
  inset: 0; 
  z-index: 9999;
  display: grid; 
  place-items: center;
  background: #fff url("../images/spinner.gif") center center no-repeat;
}
