/*
  Declaração das Fontes Rawline
  A ordem dos formatos (woff2, woff, ttf) é importante.
  woff2 é o mais moderno e com melhor compressão, seguido por woff, e ttf como fallback.
*/

/* Rawline-500 (Médio) */
@font-face {
  font-family: "Rawline";
  src: url("./src/fonts/Rawline-500.woff2") format("woff2"),
    url("./src/fonts/Rawline-500.woff") format("woff"),
    url("./src/fonts/Rawline-500.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap; /* Melhora a experiência do usuário durante o carregamento da fonte */
}

/* Rawline-700 (Negrito) */
@font-face {
  font-family: "Rawline";
  src: url("./src/fonts/rawline-700.woff2") format("woff2"),
    url("./src/fonts/Rawline-700.woff") format("woff"),
    url("./src/fonts/Rawline-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Rawline-900 (Extra-Negrito) */
@font-face {
  font-family: "Rawline";
  src: url("./src/fonts/Rawline-900.woff2") format("woff2"),
    url("./src/fonts/Rawline-900.woff") format("woff"),
    url("./src/fonts/Rawline-900.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.qvobject,
.qvobject-placeholder {
  height: 100%;
  width: 100%;
}

div.container {
  display: grid;
  grid-template-rows: 5vh 1fr;
  height: 100vh;
  width: 100vw;
  overflow-x: hidden;
}

.topo {
  background-color: #119172;
  background-image: url(src/Detalhe_bg.png);
  background-repeat: no-repeat;
  background-size: contain;
  color: white;
  text-align: center;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topo h1 {
  font-size: 1.5rem;
  font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande", "Lucida Sans Unicode", Geneva,
    Verdana, sans-serif;
}

#check,
.selecoes,
.sidebar {
  display: none;
}

.grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px;
  height: 100%;
}

.grid-container-interno {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.mapa {
  display: flex;
  align-items: center;
  justify-content: center;
}

.area {
  display: grid;
  grid-template-rows: 1fr auto 5fr;
  gap: 10px;
}

.areaInterna {
  display: grid;
  grid-template-rows: 1fr auto 2fr auto 6fr;
  gap: 10px;
  padding: 10px;
}

.filtros {
  display: grid;
  grid-template-columns: 11fr 1fr;
}

.filtro,
.limparFiltros {
  display: flex;
  align-items: center;
  height: 100%;
}

.cards {
  display: grid;
  grid-template-rows: repeat(auto-fit, 1fr);
  gap: 20px;
  overflow-y: auto;
}

.card {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tabela {
  display: flex;
  align-items: center;
  justify-content: center;
}

div#CC_QV05,
div#MC_QV05,
div#CA_QV05 {
  background-color: #fcedce;
}

/* Ajustes para a exportação */
.box {
  display: grid;
  grid-template-rows: 1fr auto;
}
button.btn > span {
  font-family: QlikView Sans, sans-serif;
  color: rgb(60, 60, 59);
  font-weight: bold;
  font-style: normal;
}
.btn-export {
  padding: 5px;
  background-color: transparent;
  border: none;
  cursor: pointer;
}
/*Alinha os objets à direita*/
.alinha-direita {
  text-align: right;
}

/* === Mobile Portrait View === */
@media screen and (max-width: 768px) and (orientation: portrait) {
  .topo {
    background-size: 20% !important;
  }

  .topo h1 {
    font-size: 1rem !important;
  }

  #check:checked ~ .sidebar {
    right: 0;
  }

  #check:checked ~ .sidebar-overlay {
    display: block;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999; /* Below sidebar, above content */
  }

  .sidebar {
    background-color: white;
    display: block;
    position: fixed;
    top: 0;
    right: -250px; /* Same as width */
    width: 250px;
    height: 100%;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s ease-in-out;
  }

  .sbArea {
    display: grid;
    grid-template-rows: 2fr 2fr 25fr;
    gap: 10px;
    height: 100%;
  }

  .sbFechar {
    background-color: #119172;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: sans-serif;
    font-size: large;
    font-weight: bold;
    padding: 0 10px;
  }

  .sbLimparSelecoes {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-family: sans-serif;
    font-size: large;
    cursor: pointer;
    font-size: medium;
  }

  .sbFiltros {
    padding: 10px;
  }

  .selecoes {
    display: flex;
    position: fixed;
    gap: 10px;
    right: 0px;
    padding-right: 10px;
  }

  div.container {
    grid-template-rows: 5vh 1fr !important;
  }

  .area {
    grid-template-rows: 1fr !important;
    gap: 0px !important;
  }

  .areaInterna {
    grid-template-rows: 1fr 3.5fr !important;
    gap: 10px;
    padding: 0px;
  }

  .grid-container {
    grid-template-columns: 1fr;
    grid-template-rows: 10fr 10fr 1fr !important;
  }

  .grid-container-interno {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 2fr !important;
  }

  .mapa {
    padding: 5px !important;
  }

  .filtros,
  hr {
    display: none !important;
  }

  .cards {
    gap: 0px !important;
  }

  .table {
    width: 50% !important;
  }
}

/* === Mobile landscape View === */
@media screen and (max-width: 930px) and (orientation: landscape) {
  .filtros,
  hr {
    display: none !important;
  }

  #check:checked ~ .sidebar {
    right: 0;
  }

  #check:checked ~ .sidebar-overlay {
    display: block;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999; /* Below sidebar, above content */
  }

  .sidebar {
    background-color: white;
    display: block;
    position: fixed;
    top: 0;
    right: -250px; /* Same as width */
    width: 250px;
    height: 100%;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s ease-in-out;
  }

  .sbArea {
    display: grid;
    grid-template-rows: 2fr 2fr 10fr;
    gap: 10px;
    height: 100%;
  }

  .sbFechar {
    background-color: #119172;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: sans-serif;
    font-size: large;
    font-weight: bold;
    padding: 0 10px;
  }

  .sbLimparSelecoes {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-family: sans-serif;
    font-size: large;
    cursor: pointer;
  }

  .sbFiltros {
    padding: 10px;
  }

  .selecoes {
    display: flex;
    position: fixed;
    gap: 10px;
    right: 0px;
    padding-right: 10px;
  }

  div.container {
    grid-template-rows: 10vh 1fr !important;
  }

  .grid-container-interno {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .area {
    grid-template-rows: 1fr !important;
  }

  .areaInterna {
    grid-template-rows: 1fr 2fr 0.3fr !important;
    gap: 10px;
  }

  .cards {
    gap: 5px;
  }
}

#CC_QV05 > div > article,
#MC_QV05 > div > article,
#CA_QV05 > div > article {
  background-position: initial !important;
}

.sn-kpi-ellips-text > span {
  font-family: "QlikView Sans", sans-serif !important;
}

/* Preloader Style */
.preloader {
  height: 40px;
  width: 40px;
  margin: 50px auto; /* Adiciona uma margem para o loader ficar visível */
  border: 4px solid #f3f3f3; /* Cinza claro */
  border-top: 4px solid #119172; /* Cor do tema */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.exportar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.exportar a {
  cursor: pointer;
  font-size: 1.5rem; /* Ajuste o tamanho do ícone conforme necessário */
  color: #119172; /* Cor dos ícones */
}

.exportar span {
  font-family: "Rawline", sans-serif;
  font-weight: 700;
  color: #333;
}
