@use '../../partials/flex';
@use '../../partials/text';
@use '../../partials/dir';

.emoji-board {
  --emoji-board-height: 390px;
  --emoji-board-width: 286px;
  display: flex;
  max-width: 90vw;
  max-height: 90vh;
  
  &__content {
    @extend .cp-fx__item-one;
    @extend .cp-fx__column;
    height: var(--emoji-board-height);
    width: var(--emoji-board-width);
  }
  & > .scrollbar {
    width: initial;
    height: var(--emoji-board-height);
  }
  &__nav {
    @extend .cp-fx__column;
    justify-content: center;

    min-height: 100%;
    padding: 4px 6px;
    @include dir.side(border, none, 1px solid var(--bg-surface-border));

    position: relative;
    
    & .ic-btn-surface {
      opacity: 0.8;
    }
  }
  &__nav-custom,
  &__nav-twemoji {
    @extend .cp-fx__column;
  }
  &__nav-twemoji {
    background-color: var(--bg-surface);
    position: sticky;
    bottom: -70%;
    z-index: 999;
  }
}

.emoji-board__content__search {
  padding: var(--sp-extra-tight);
  position: relative;
  
  & .ic-raw {
    position: absolute;
    @include dir.prop(left, var(--sp-normal), unset);
    @include dir.prop(right, unset, var(--sp-normal));
    top: var(--sp-normal);
    transform: translateY(1px);
  }

  & .input-container {
    & .input {
      min-width: 100%;
      width: 0;
      padding: var(--sp-extra-tight) 36px;
      border-radius: calc(var(--bo-radius) / 2);
    }
  }
}
.emoji-board__content__emojis {
  @extend .cp-fx__item-one;
  @extend .cp-fx__column;
}
.emoji-board__content__info {
  margin: 0 var(--sp-extra-tight);
  padding: var(--sp-tight) var(--sp-extra-tight);
  border-top: 1px solid var(--bg-surface-border);

  display: flex;
  align-items: center;

  & > div:first-child {
    line-height: 0;
    .emoji {
      width: 32px;
      height: 32px;
      object-fit: contain;
    }
  }
  & > p:last-child {
    @extend .cp-fx__item-one;
    @extend .cp-txt__ellipsis;
    margin: 0 var(--sp-tight);
  }
}

.emoji-row {
  display: flex;
}

.emoji-group {
  --emoji-padding: 6px;
  position: relative;
  margin-bottom: var(--sp-normal);
  
  &__header {
    position: sticky;
    top: 0;
    z-index: 99;
    background-color: var(--bg-surface);

    @include dir.side(margin, var(--sp-extra-tight), 0);
    padding: var(--sp-extra-tight) var(--sp-ultra-tight);
    text-transform: uppercase;
    box-shadow: 0 -4px 0 0 var(--bg-surface);
    border-bottom: 1px solid var(--bg-surface-border);
  }
  & .emoji-set {
    --left-margin: calc(var(--sp-normal) - var(--emoji-padding));
    --right-margin: calc(var(--sp-extra-tight) - var(--emoji-padding));
    margin: var(--sp-extra-tight);
    @include dir.side(margin, var(--left-margin), var(--right-margin));
  }
  & .emoji {
    max-width: 38px;
    max-height: 38px;
    width: 100%;
    height: 100%;
    overflow: hidden;
    object-fit: contain;
    padding: var(--emoji-padding);
    cursor: pointer;
    &:hover {
      background-color: var(--bg-surface-hover);
      border-radius: var(--bo-radius);
    }
  }
}