@define-mixin docs-icon-ui-light {
  .docs-icon {
    color: var(--ld-col-neutral-900);

    &__player {
      filter: none;
    }
  }
}
@define-mixin docs-icon-ui-dark {
  .docs-icon {
    color: var(--ld-col-wht);

    &__player {
      filter: invert(1) hue-rotate(180deg);
    }
  }
}

@mixin docs-icon-ui-light;

@media (prefers-color-scheme: dark) {
  @mixin docs-icon-ui-dark;
}
.docs-ui-dark {
  @mixin docs-icon-ui-dark;
}
.docs-ui-light {
  @mixin docs-icon-ui-light;
}

.docs-icon {
  align-items: center;
  border-radius: var(--ld-br-l);
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  padding: var(--ld-sp-24) var(--ld-sp-8) var(--ld-sp-8);
  position: relative;
  text-decoration: none;
  width: 100%;
  transition: transform 0.2s ease;

  &:hover,
  &:focus-visible,
  &.docs-icon--active {
    background: var(--ld-col-neutral-010);
    color: var(--ld-col-neutral-900);
    transform: scale(1.05);
    z-index: 1;

    .docs-icon__player {
      filter: none;
    }

    .docs-icon__identifier {
      opacity: 1;
    }

    .docs-icon__name {
      opacity: 0;
    }

    .docs-icon__instructions {
      top: 0;
      opacity: 1;

      &--hidden {
        opacity: 0;
      }
    }
  }

  &.docs-icon--active {
    &::before {
      content: '';
      border-radius: var(--ld-br-l);
      inset: 0 0 -1rem;
      position: absolute;
      z-index: -1;
    }
  }

  &__player {
    flex: 0;
    margin: calc(var(--ld-sp-16) * -1) 0 calc(var(--ld-sp-8) * -1);
    width: 3rem;
  }

  &__identifier {
    flex: 1;
    font: var(--ld-typo-code-s);
    font-weight: 700;
    opacity: 0;
    padding-top: var(--ld-sp-16);
    text-align: center;
  }

  &__name {
    font: var(--ld-typo-label-s);
    inset: var(--ld-sp-8);
    margin-top: var(--ld-sp-8);
    position: absolute;
    text-align: center;
    top: 3.75rem;
  }

  &__action {
    margin: var(--ld-sp-8) 0;
    position: relative;
  }

  &__confirmation {
    top: 0;
    bottom: 0;
    color: var(--ld-thm-secondary);
    position: absolute;
    opacity: 0;
    width: 100%;

    &--visible {
      opacity: 1;
    }

    &::part(tag) {
      align-items: center;
      display: flex;
      height: 100%;
      justify-content: center;
    }

    ld-icon {
      margin-left: var(--ld-sp-8);
    }
  }

  &__player,
  &__identifier,
  &__name,
  &__instructions,
  &__confirmation {
    transition: opacity 0.2s ease-in-out;
  }
}

.docs-icon__instructions {
  opacity: 0;
  position: relative;
  text-align: center;
  top: var(--ld-sp-8);

  &::part(tag) {
    line-height: 140%;
  }

  &--hidden {
    opacity: 0;
  }

  span {
    color: var(--ld-thm-secondary);
  }
}
