/*
 * The whole layer is click-through. Without that the backdrop would sit between
 * cursor and label, which ends the hover and makes the bubble flicker.
 */
.info_overlay_div {
  position: fixed;
  inset: 0;
  z-index: 180;
  background-color: rgba(0, 0, 0, 0.72);
  pointer-events: none;
  animation: info_overlay_fade_in 0.15s ease;
}

@keyframes info_overlay_fade_in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .info_overlay_div {
    animation: none;
  }
}

/* Placed by script — top and left are set from the label's position */
.info_card_div {
  position: fixed;
  width: calc(var(--stats_panel_width) * 2 / 3);
  max-width: calc(100vw - 32px);
  background-color: var(--surface_container_lowest_color);
  border: 1px solid var(--border_color);
  border-radius: 16px;
  box-shadow: var(--shadow_strong);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Rotated square, so its two visible edges continue the card border */
.info_card_tail_span {
  position: absolute;
  width: 14px;
  height: 14px;
  background-color: var(--surface_container_lowest_color);
}
.info_card_div_above .info_card_tail_span {
  bottom: 0;
  transform: translate(-50%, 50%) rotate(45deg);
  border-right: 1px solid var(--border_color);
  border-bottom: 1px solid var(--border_color);
  border-bottom-right-radius: 3px;
}
.info_card_div_below .info_card_tail_span {
  top: 0;
  transform: translate(-50%, -50%) rotate(45deg);
  border-left: 1px solid var(--border_color);
  border-top: 1px solid var(--border_color);
  border-top-left-radius: 3px;
}

.info_card_icon {
  font-size: 30px;
  color: var(--primary_color);
  margin-bottom: 10px;
}
.info_card_title {
  font-size: 15px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.info_card_text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text_secondary_color);
}

/* Marks the labels that carry an explanation */
.salary_block_info {
  cursor: help;
}

/*
 * Once the sidebar is a rail the dialog sits close to the page furniture, and a
 * dim layer drawn over the header reads as if the app itself had gone away. The
 * layer starts below the header, and the footer keeps its own colour by sitting
 * above the layer instead of under it.
 */
@media (max-width: 1024px) {
  .info_overlay_div {
    top: 64px;
  }
  .app_footer {
    position: relative;
    z-index: 190;
  }
}

/*
 * With the bottom bar in place the bubble stops pointing at things. There is no
 * room beside a label on a phone, and a bubble pinned to one would cover the
 * very figure it explains. It becomes a panel across the width of the screen,
 * resting just above the bar — so the navigation stays visible and reachable
 * while the explanation is open.
 *
 * The script keeps writing top and left from the label's position, so both have
 * to be overridden here.
 */
@media (max-width: 720px) {
  .info_overlay_div {
    bottom: var(--mobile_nav_height);
  }
  .info_card_div {
    top: auto !important;
    bottom: calc(var(--mobile_nav_height) + 16px) !important;
    left: 50% !important;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 360px;
  }
  /* Nothing left to point at once the card is detached from its label */
  .info_card_tail_span {
    display: none;
  }
}
