@use "../mixins";

.tag-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: var(--spacing-4);

  label {
    display: block;
    font-weight: bold;
    font-size: var(--font-size_medium);
    margin-bottom: var(--spacing-2);
  }

  alchemy-list-filter {
    margin: 0;

    input {
      background-color: var(--list-filter-background-color);

      &:focus {
        background-color: var(--list-filter-focus-background-color);
      }
    }
  }

  ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;

    li {
      display: block;

      &:first-child {
        margin-top: 0;
      }

      a {
        @include mixins.tag-base;

        & {
          display: flex;
          text-decoration: none;
        }
      }

      &:hover a {
        background-color: var(--tag-hover-background-color);
      }

      &.active {
        a {
          background-color: var(--tag-active-background-color);
          color: var(--tag-active-text-color);

          &:before {
            background-image: var(--tag-active-background-image);
          }
        }
      }
    }
  }
}

.tag {
  pointer-events: none;
  font-size: var(--font-size_small);
  @include mixins.tag-base(
    $margin: var(--spacing-0) 0,
    $padding: var(--spacing-1) var(--spacing-2) var(--spacing-1)
  );
}

.tags .list .tag {
  padding: 0;
}

#overlay_file_list.with_tag_list {
  padding-right: 234px;
}

#tags_tag_list {
  alchemy-list-filter {
    margin-top: 0;
  }

  ul.tags {
    max-height: 10em;
    padding: 1px;
    margin: 0;
    margin-top: var(--spacing-0);
    overflow: auto;
    text-align: left;
    list-style-type: none;

    li {
      background-color: var(--tag-background-color);
      padding: var(--spacing-1);
      margin: 0 0 var(--spacing-1) 0;
      position: relative;
      border-radius: var(--border-radius_medium);

      &.odd {
        background-color: #eaf3f9;
      }

      input {
        position: absolute;
        top: 3px;
        left: var(--spacing-1);
      }

      label {
        display: inline-block;
        margin-left: 2em;
        line-height: 1.6em;
      }
    }
  }
}

.autocomplete_tag_list {
  .select2-container.select2-container-multi {
    .select2-search-choice {
      padding: var(--spacing-1) 22px;
      background-image: var(--tag-background-image);
      background-repeat: no-repeat;
      background-position: 6px;
      background-color: var(--tag-background-color);
      background-size: 1rem;

      > div {
        position: relative;
        top: -1px;
      }
    }
  }
}
