@import '../../../styles/mixins';

.SymbolMenu {
  &.mobile-menu {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-background);
    transform: translate3d(0, calc(var(--symbol-menu-height) + var(--symbol-menu-footer-height)), 0);
    z-index: 1;

    transition: transform var(--layer-transition);

    &.open {
      transform: translate3d(0, 0, 0);

      body.is-media-viewer-open & {
        transform: translate3d(0, calc(var(--symbol-menu-height) + var(--symbol-menu-footer-height)), 0);
      }
    }
  }

  &-main {
    width: var(--symbol-menu-width);
    height: var(--symbol-menu-height);
    max-height: calc(100vh - var(--symbol-menu-footer-height));
  }

  &-footer {
    height: var(--symbol-menu-footer-height);
    border-top: 1px solid var(--color-borders);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 2px var(--color-default-shadow);
    position: relative;

    .Button {
      flex-shrink: 0;
      width: 2.125rem !important;
      height: 2.125rem;
      margin: 0 .25rem;
      padding: 0;

      &.activated {
        pointer-events: none;
      }

      &.symbol-tab-button {
        margin: 0 0.75rem;
      }

      &.symbol-search-button {
        position: absolute;
        left: 0.25rem;
      }

      &.symbol-delete-button {
        position: absolute;
        right: 0.25rem;
      }
    }
  }

  .Transition.slide {
    height: 100%;

    .Loading {
      height: var(--symbol-menu-height);
    }
  }

  .is-pointer-env & {
    > .backdrop {
      position: absolute;
      top: -1rem;
      left: 0;
      right: auto;
      width: 3.5rem;
      height: 4.5rem;
    }
  }

  .bubble {
    padding: 0;
    width: var(--symbol-menu-width);
    overflow: hidden;
  }

  .picker-disabled {
    height: var(--symbol-menu-height);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
  }

  .symbol-close-button {
    display: none;
    position: absolute;
    right: .25rem;
    top: .25rem;
  }

  @media (orientation: landscape) {
    .symbol-close-button {
      display: block;
    }
  }
}

.symbol-set {
  margin-bottom: 1rem;

  &-name {
    font-size: 1rem;
    line-height: 1.6875rem;
    font-weight: 500;
    margin: 0;
    padding-left: 0.5rem;
    color: rgba(var(--color-text-secondary-rgb), 0.75);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: initial;
    unicode-bidi: plaintext;
  }

  &-container {
    text-align: initial;
  }

  &-button {
    flex-shrink: 0;
    width: 2.125rem !important;
    height: 2.125rem;
    margin: 0 0.25rem;
    padding: 0;
  }

  @include while-transition() {
    overflow: hidden;
  }

  .symbol-set-container {
    &:not(.shown) {
      display: block;
    }

    &.closing {
      transition: none;
    }
  }
}
