// 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";

.palette-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,
  .recent-colors,
  .file-library {
    position: relative;
    display: flex;
    align-items: flex-start;
    width: 100%;
    padding: $s-8;
    border-radius: $br-8;
    margin-bottom: $s-4;
    &:last-child {
      margin-bottom: 0;
    }
    .option-wrapper {
      width: 100%;
      .library-name {
        @include bodySmallTypography;
        color: var(--context-menu-foreground-color);
        display: grid;
        grid-template-columns: 1fr $s-24;
        .lib-name-wrapper {
          display: flex;
          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 {
            @extend .button-icon-small;
            @include flexCenter;
            stroke: var(--icon-foreground);
          }
        }
      }
      .color-sample {
        display: flex;
        flex-direction: row;
        gap: $s-8;
        margin-top: $s-4;
      }
    }

    &.selected,
    &:hover {
      .option-wrapper .library-name {
        color: var(--context-menu-foreground-color-selected);
        .icon-wrapper {
          @include flexCenter;
          svg {
            @include flexCenter;
            @extend .button-icon-small;
            stroke: var(--context-menu-foreground-color-selected);
          }
        }
      }
    }

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