/*
 * https://github.com/morethanwords/tweb
 * Copyright (C) 2019-2021 Eduard Kuzmenko
 * https://github.com/morethanwords/tweb/blob/master/LICENSE
 */

.topics {
  &-slider {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
  }

  &-container {
    --offset: 0;
    --width: 100%;
    background-color: var(--surface-color) !important;
    width: var(--width) !important;
    // max-width: unquote("min(100%, 20rem)") !important;
    // display: flex !important;

    &.is-floating {
      --offset: 5.0625rem;
      --width: calc(100% - var(--offset));
      transform: translateX(calc(100% * var(--reflect)));
      overflow: unset !important;
      position: absolute;
      top: 0;
      bottom: 0;
      inset-inline-end: 0;
      z-index: 1;
      pointer-events: all;
      border-inline-start: 1px solid var(--border-color);
    }

    &.is-visible {
      &:not(.backwards) {
        transform: translateX(0);
      }

      &.animating {
        transition: transform var(--transition-standard-in);

        &.backwards {
          transition: transform var(--transition-standard-out);
        }
      }
    }

    // &:before {
    //   position: absolute;
    //   content: " ";
    //   width: 1px;
    //   left: -1px;
    //   top: 0;
    //   bottom: 0;
    //   background-color: var(--border-color);
    // }

    .sidebar-header {
      padding: 0 .75rem;

      &__title,
      &__subtitle {
        padding-inline-start: .5rem;
      }

      // .btn-icon {
      //   padding: .375rem;
      // }
    }

    .chatlist-chat {
      min-height: 4rem;
      padding-inline-start: .75rem;
    }
  }
}

.topic {
  &-name {
    .topic-icon {
      margin-inline-end: .25rem;
    }

    &-button {
      --color: var(--primary-color);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      height: 1.5rem;
      padding: 0 .5rem;
      color: var(--color);
      font-weight: var(--font-weight-bold);
      position: relative;
      text-decoration: none !important;
      max-width: 100%;
      @include text-overflow(true);

      &-container {
        display: flex !important;
        align-items: flex-start;
        justify-content: flex-start;
      }

      .peer-title,
      .topic-name {
        position: relative;
        pointer-events: none;
        @include text-overflow(true);
      }

      &:before {
        content: " ";
        position: absolute;
        inset: 0;
        background-color: var(--color);
        opacity: #{$hover-alpha};
        border-radius: 1.5rem;
      }

      @include hover() {
        &:before {
          opacity: #{$hover-alpha * 2};
        }
      }
    }
  }

  &-icon {
    --size: 1.25rem;
    --custom-emoji-size: var(--size);
    font-size: calc(var(--size) / 2);
    line-height: 1.875 !important;
    display: inline-flex;
    // width: var(--size);
    // height: var(--size);
    position: relative;
    justify-content: center;
    // align-items: center;
    vertical-align: middle;

    &-general {
      fill: var(--secondary-color);
      width: var(--size);
      height: var(--size);
    }

    &-svg {
      position: absolute;
      // left: 0;
      width: inherit;
      height: inherit;
      // fill: url(#topic-icon-gradient);
      // stroke: #000;
    }

    // &-gradient {
    //   &-stop-1 {
    //     stop-color: var(--color-top);
    //   }

    //   &-stop-2 {
    //     stop-color: var(--color-bottom);
    //   }
    // }

    &-content {
      // position: absolute;
      // top: 50%;
      // left: 50%;
      // transform: translate(-50%, -50%);

      position: relative;
      // display: inline-block;
      // width: inherit;
      // height: inherit;
      // min-width: inherit;
      // min-height: inherit;
    }
  }
}

.edit-topic {
  &-container {
    .scrollable-y {
      display: flex;
      flex-direction: column;
    }
  }

  &-icon {
    position: absolute;

    .topic-icon {
      --size: 4rem;
    }

    &-container {
      width: 100px;
      height: 100px;
      margin: 0 auto;
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }
  }

  &-emoticons-container {
    flex: 1 1 auto;

    .sidebar-left-section {
      padding: 0 !important;
      height: 100%;
    }

    .emoji-padding {
      // height: 25rem;
      display: flex;
      flex-direction: column;
    }

    .super-emoji-topic-icon {
      // position: relative;

      .topic-icon {
        --size: var(--esg-emoji-size);
        --custom-emoji-size: inherit;
        margin-inline-start: calc((var(--custom-emoji-size) - var(--esg-emoji-size)) / 2);
      }
    }
  }
}
