@use 'pix-design-tokens/breakpoints';
@use 'pix-design-tokens/fonts';

.tooltip {
  &__tag {
    position: relative;
    top: 6px;
    width: 45px;
    height: 40px;
    margin-top: -23px;
    margin-right: -17px;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border: none;

    @include breakpoints.device-is('tablet') {
      width: 85px;
      height: 80px;
      margin-top: -25px;
    }

    &--focused {
      background-image: url('/images/tag-focused-challenge.svg');
    }

    &--regular {
      background-image: url('/images/tag-regular-challenge.svg');
    }
  }
}

.tooltip-tag {
  &__icon-button {
    width: 100%;
    height: 100%;
    background-color: transparent;
    border: none;
  }

  &__information {
    position: absolute;
    top: -10px;
    right: 50px;
    z-index: 300;
    width: 40vw;
    min-width: 220px;
    max-width: 300px;
    padding: 24px;
    background-color: var(--pix-neutral-0);
    border-radius: 15px;
    box-shadow: 0 0 20px 0 rgb(0 0 0 / 20%);

    @include breakpoints.device-is('tablet') {
      top: -60px;
      right: 80px;
    }

    &::before {
      position: absolute;
      top: 20px;
      left: 100%;
      margin-top: -5px;
      border-color: transparent transparent transparent var(--pix-neutral-0);
      border-style: solid;
      border-width: 15px;
      content: ' ';

      @include breakpoints.device-is('tablet') {
        top: 80px;
      }
    }

    p {
      margin-top: 0;

      &:last-child {
        margin-bottom: 0;
      }
    }
  }
}

.tooltip-tag-information {
  &__title {
    margin-bottom: 16px;
    font-weight: var(--pix-font-medium);
    font-size: 1.125rem;
    font-family: fonts.$font-roboto;
    line-height: 1rem;
  }

  &__text {
    display: block;
    font-weight: var(--pix-font-normal);
    font-size: 0.875rem;
    font-family: fonts.$font-roboto;
    line-height: 1.375rem;
    letter-spacing: 0;
    text-align: left;
  }

  &__button {
    margin-top: 16px;
  }
}

.tooltip-tag__icon-button[aria-expanded='false'] + .tooltip-tag__information {
  display: none;
}
