* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Roboto", sans-serif;
}

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  /* Cor de fundo cinza para identificar se o vídeo falhar */
  background-color: #1a1a1a;
}

.language-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 40;
  display: flex;
  gap: 6px;
}

.language-switcher button {
  position: relative;
  overflow: hidden;
  background-color: #fff;
  color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  width: 42px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  font-weight: 700;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease;
}

.language-btn.flag-br {
  background: #009b3a;
}

.language-btn.flag-br::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  background: #ffdf00;
  transform: translate(-50%, -50%) rotate(45deg);
}

.language-btn.flag-br::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  background: #002776;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.language-btn.flag-us {
  width: 42px;
  height: 36px;
  background:
    linear-gradient(#3c3b6e 0 0) 0 0 / 45% 54% no-repeat,
    repeating-linear-gradient(
      to bottom,
      #b22234 0,
      #b22234 7.69%,
      #fff 7.69%,
      #fff 15.38%
    );
}

.language-switcher button:hover,
.language-switcher button.active {
  border-color: #fff;
}

.language-switcher button.active {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}

#bg-video {
  position: fixed;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translateX(-50%) translateY(-50%);
  object-fit: cover;
  z-index: -1;
}

.chart-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  gap: 20px;
}

#container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 950px;
  margin-top: -150px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.menu-label-layer {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow: visible;
  pointer-events: none;
}

.menu-label-layer .custom-label {
  position: absolute;
  pointer-events: auto;
}

.menu-label-layer.menu-hovering .custom-label:not(.is-active),
.menu-label-layer.is-hovering .custom-label:not(.is-active),
.menu-connector-layer.menu-hovering .menu-connector:not(.is-active),
.menu-connector-layer.is-hovering .menu-connector:not(.is-active) {
  opacity: 0.22;
}

.menu-label-layer .custom-label {
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    filter 0.16s ease;
}

.menu-label-layer .custom-label.is-active {
  opacity: 1;
  z-index: 40;
}

.menu-connector-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 18;
}

.menu-connector {
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    filter 0.16s ease;
}

.menu-connector.is-active {
  opacity: 1;
}

.main-title {
  position: absolute;
  top: 7%;
  width: 100%;
  text-align: center;
  font-size: 3rem;
  color: #9a1931;
  font-weight: 900;
  z-index: 20;
  pointer-events: none;
}

.main-title span {
  color: #9a1931;
}

.center-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  text-align: center;
  pointer-events: none;
  z-index: 0;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.ufpa-logo {
  margin-bottom: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.donut-logo-ufpa {
  width: 200px;
  height: 180px;

  background-image: url("../img/logo-ufpa.png");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: -10px;
  margin: center;
}

.ufpa-logo img {
  width: 150px;
  height: auto;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 1));
}

.center-text {
  font-size: 1rem;
  line-height: 1.2;
  color: #48291d;
  font-style: bold;
}

.custom-label {
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
  position: relative;
  z-index: 20;
  will-change: transform;
  width: max-content;
  min-width: max-content;
  white-space: nowrap;
  text-decoration: none;
}

.custom-label:hover {
  transform: scale(1.05);
}

.left-layout {
  flex-direction: row;
  transform-origin: right center;
}

.left-layout .label-pill {
  padding-right: 20px;
}

.right-layout {
  flex-direction: row;
  transform-origin: left center;
}

.right-layout .label-pill {
  padding-left: 20px;
}

.label-icon {
  width: 85px;
  height: 85px;
  flex-shrink: 0;
  border-radius: 50%;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  color: #555 !important;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 10;
  border: none;
}

.gradient-border {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 10px;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: 0;
  pointer-events: none;
}

.label-icon i {
  z-index: 1;
  position: relative;
}

.label-pill {
  padding: 0 20px;
  border-radius: 30px;
  color: white;
  font-weight: bold;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
  z-index: 5;
  display: flex;
  align-items: center;
  height: 40px;
}
.left-layout .label-pill-wide {
  min-width: 120px;
  padding-left: 20px;
  padding-right: 20px;
  margin-right: 0;
  justify-content: center;
  text-align: center;
}

.highcharts-data-label {
  overflow: visible !important;
}

.highcharts-data-label span,
.highcharts-data-label div {
  overflow: visible !important;
}

.highcharts-data-labels {
  overflow: visible !important;
}

.highcharts-container,
.highcharts-root {
  overflow: visible !important;
}

#container,
.highcharts-container {
  overflow: visible !important;
}

.center-text {
  font-size: 16px;
  color: #48291d;
  font-family:
    open sans,
    sans-serif;
}

@media (max-width: 1024px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .chart-wrapper {
    min-height: 700px;
  }

  #container {
    margin-top: -40px;
    max-width: 820px;
  }
  .main-title {
    top: 8%;
    font-size: 2.5rem;
  }

  .label-icon {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
  .gradient-border {
    padding: 4px;
  }

  /* Encolhe as pílulas de texto */
  .label-pill {
    height: 24px;
    font-size: 9px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    white-space: nowrap;
  }

  /* --- NOVAS REGRAS PARA O CENTRO --- */
  .donut-logo-ufpa {
    width: 90px;
    height: 75px;
  }
  .center-text {
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  body {
    width: 100%;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .chart-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    justify-content: flex-start;
    padding: 76px 16px 32px;
  }

  #container {
    width: 100%;
    height: auto;
    min-height: 0;
    max-width: 680px;
    margin-top: 0;
    display: block;
    overflow: visible !important;
  }

  .main-title {
    position: relative;
    top: auto;
    font-size: 2rem;
    line-height: 1.1;
    margin-bottom: 24px;
  }

  .mobile-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
  }

  .mobile-menu-card {
    min-width: 0;
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 14px;
    color: #fff;
    text-decoration: none;
    background: var(--card-color);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
  }

  .mobile-card-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #555;
    font-size: 16px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
  }

  .mobile-card-icon .gradient-border {
    padding: 4px;
    background-image: linear-gradient(135deg, var(--card-color), #1a1a1a);
  }

  .mobile-card-icon i {
    position: relative;
    z-index: 1;
  }

  .mobile-card-label {
    min-width: 0;
    font-size: 0.85rem;
    line-height: 1.2;
    font-weight: 700;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 400px) {
  .chart-wrapper {
    padding-right: 12px;
    padding-left: 12px;
  }

  .main-title {
    font-size: 1.5rem;
    margin-bottom: 18px;
  }

  .mobile-menu-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .mobile-menu-card {
    min-height: 58px;
    padding: 7px 10px;
  }

  .mobile-card-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    font-size: 14px;
  }

  .mobile-card-label {
    font-size: 0.82rem;
  }
}
