/**
 * ApexCharts Rating - Estilos comuns a todos os gráficos (Top/Lowest Rated, Stacked, etc.)
 * Classes específicas para não conflitar com a página.
 * Copie e cole no arquivo CSS do site onde os gráficos serão implantados.
 */

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

/* Container do bloco do gráfico (wrapper) */
.apexcharts-rating-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.apexcharts-rating-chart-wrap {
  width: 100%;
  flex-shrink: 0;
  position: relative;
  min-height: 320px;
}

/* Loading (exibido até o gráfico terminar de renderizar) */
.apexcharts-rating-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.95);
  z-index: 10;
  font-family: Figtree, sans-serif;
  font-size: 14px;
  color: rgb(25, 53, 68);
}

.apexcharts-rating-loading-hidden {
  display: none !important;
}

.apexcharts-rating-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgb(229, 231, 235);
  border-top-color: #5eb8e6;
  border-radius: 50%;
  animation: apexcharts-rating-spin 0.8s linear infinite;
}

@keyframes apexcharts-rating-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Barra de controles (botões) — topo e rodapé */
.apexcharts-rating-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
  flex-wrap: wrap;
  min-height: 41px;
  flex-shrink: 0;
}

/* Barra inferior: apenas um botão (SHOW ALL), alinhado ao início */
.apexcharts-rating-controls.apexcharts-rating-controls-bottom {
  justify-content: flex-start;
}

.apexcharts-rating-controls .apexcharts-rating-btn-toggle {
  background: rgb(243, 244, 246);
  transition: background 200ms;
  min-height: 33px;
  height: 33px;
  width: max-content;
  min-width: 0;
  font-family: Figtree, sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: rgb(25, 53, 68);
  text-align: center;
  letter-spacing: 0.4px;
  line-height: 1;
  border-radius: 4px;
  padding: 0 20px;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.apexcharts-rating-controls .apexcharts-rating-btn-toggle:hover {
  background: rgb(229, 231, 235);
}

.apexcharts-rating-btn-zoom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.apexcharts-rating-btn-zoom .apexcharts-rating-zoom-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: #5eb8e6;
}

.apexcharts-rating-btn-zoom .apexcharts-rating-zoom-out-icon {
  display: inline-block;
}

.apexcharts-rating-btn-zoom .apexcharts-rating-zoom-in-icon {
  display: none;
}

.apexcharts-rating-btn-zoom.apexcharts-rating-zoomed-out .apexcharts-rating-zoom-out-icon {
  display: none;
}

.apexcharts-rating-btn-zoom.apexcharts-rating-zoomed-out .apexcharts-rating-zoom-in-icon {
  display: inline-block;
}

/* Ocultar tooltip padrão do ApexCharts — só o personalizado (eixo) deve aparecer */
.apexcharts-rating-container .apexcharts-tooltip,
.apexcharts-rating-container .apexcharts-tooltip.apexcharts-active {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.apexcharts-rating-container .apexcharts-tooltip-series-group,
.apexcharts-rating-container .apexcharts-tooltip-marker,
.apexcharts-rating-container .apexcharts-tooltip-text,
.apexcharts-rating-container .apexcharts-tooltip-text-y-label,
.apexcharts-rating-container .apexcharts-tooltip-text-y-value {
  display: none !important;
}

.apexcharts-rating-container .apexcharts-yaxis-label {
  pointer-events: auto;
  cursor: pointer;
}

.apexcharts-rating-container svg .apexcharts-tooltip,
.apexcharts-rating-container g .apexcharts-tooltip {
  display: none !important;
}

/* Sort By dropdown (used by timeline charts) */
.apexcharts-rating-sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.apexcharts-rating-sort-wrap label {
  font-family: Figtree, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: rgb(25, 53, 68);
  white-space: nowrap;
}

.apexcharts-rating-sort-select {
  min-width: 250px;
  max-width: 250px;
  width: 250px;
  min-height: 33px;
  max-height: 33px;
  height: 33px;
  margin: 0 0 0 5px;
  border: 1px solid rgb(228, 230, 239);
  background-color: transparent;
  color: rgb(25, 53, 68);
  font-family: Figtree, sans-serif;
  font-size: 14px;
  font-weight: 400;
  border-radius: 5px;
  letter-spacing: 0.7px;
  padding: 6px;
  cursor: pointer;
}

/* 
   FIX: In distributed horizontal bar charts, ApexCharts sometimes ignores offsetX.
   This forces a horizontal shift (margin) for the data values.
*/
#topRated_chart .apexcharts-datalabel,
#topRatedComp_chart .apexcharts-datalabel,
#lowestRated_chart .apexcharts-datalabel,
#lowestRatedComp_chart .apexcharts-datalabel {
  transform: translateX(15px);
}
