// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) KALEIDOS INC

@import "refactor/common-refactor.scss";

.text-context-menu {
  position: absolute;
  left: auto;
  bottom: var(--height);
  max-width: $s-480;
  padding: $s-4;
  margin: 0 0 $s-4 0;
  z-index: $z-index-4;
  border-radius: $br-10;
  background-color: var(--context-menu-background-color);

  .palette-library,
  .file-library {
    position: relative;
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: $s-8;
    padding: $s-8;
    margin-bottom: $s-4;
    border-radius: $br-8;

    &:last-child {
      margin-bottom: 0;
    }
    .library-name {
      @include bodySmallTypography;
      color: var(--context-menu-foreground-color);
      display: grid;
      grid-template-columns: 1fr $s-24;
      max-width: $s-400;
      .lib-name {
        @include textEllipsis;
        max-width: $s-380;
      }
      .lib-num {
        margin-left: $s-4;
      }
    }
    .icon-wrapper {
      margin-left: $s-4;
      @include flexCenter;
      svg {
        @include flexCenter;
        @extend .button-icon-small;
        stroke: var(--icon-foreground);
      }
    }
    &.selected,
    &:hover {
      .icon-wrapper {
        @include flexCenter;
        svg {
          @include flexCenter;
          @extend .button-icon-small;
          stroke: var(--context-menu-foreground-color-selected);
        }
      }
      .library-name {
        color: var(--context-menu-foreground-color-selected);
      }
    }

    &:hover {
      background-color: var(--context-menu-background-color-selected);
    }
  }
}
