@use "src/colors";

.icon-wrapper {
  position: relative;
  height: 40px;
  width: 40px;
  aspect-ratio: 1 / 1;

  .inner-wrapper {
    width: 100%;
    height: 100%;
    padding: 5px;
    box-sizing: border-box;
    border-radius: 5px;
    transition: background-color 200ms;

    img {
      height: 30px;
      width: auto;
      aspect-ratio: 1 / 1;
      transition: all 200ms;

      &.click {
        height: 85%;
        margin: 7.5%;
      }
    }

    &:hover {
      background-color: rgba(colors.$light, 0.3);

      .icon-tooltip {
        opacity: 1;
        visibility: visible;
      }
    }

    .icon-tooltip {
      position: absolute;
      bottom: 52px;
      display: block;
      background-color: rgba(colors.$dark, 0.4);
      color: var(--colors-text);
      border-radius: 2px;
      padding: 5px;
      transition: opacity 100ms;
      visibility: hidden;
      opacity: 0;
      width: max-content;
      transform: translateX(-30%);
    }


    .icon-indicator {
      --dot: 5px;
      --wide: 15px;

      position: absolute;
      width: 0;
      height: 3px;
      border-radius: 1.5px;
      background-color: rgba(colors.$text, 0.4);
      transition: width 300ms ease-out;
      opacity: 0;

      top: 90%;
      left: 50%;
      transform: translate(-50%, 0);
    }
  }

  .instances {
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 52px;
    background-color: rgba(colors.$dark, 0.4);
    color: colors.$text;
    border-radius: 2px;
    padding: 5px;
    transition: opacity 100ms;
    visibility: hidden;
    opacity: 0;
    width: max-content;
    height: max-content;
    transform: translateX(-30%);
    gap: 5px;
    max-width: 200px;

    div {
      width: 100%;
      display: flex;
      justify-content: space-evenly;
      align-items: center;
      gap: 5px;
      overflow: hidden;

      &:hover {
        background-color: rgba(colors.$light, 0.3);
      }

      img {
        height: 24px;
        width: 24px;
        flex-shrink: 0;
      }

      span {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        cursor: default;
      }

      button {
        height: 24px;
        width: 24px;
        display: grid;
        place-items: center;
        flex-shrink: 0;

        mat-icon {
          font-size: 20px;
          transform: translateY(-8px);
        }
      }
    }
  }
}
