// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only

@use '../mixins';
@use '../variables';
.Stories {
  display: flex;
  height: 100vh;
  inset-inline-start: 0;
  position: absolute;
  top: 0;
  user-select: none;
  width: 100%;
  z-index: variables.$z-index-stories;
  @include mixins.light-theme {
    background: variables.$color-white;
  }
  @include mixins.dark-theme {
    background: variables.$color-gray-95;
  }

  &__pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 380px;
    padding-top: calc(2px + var(--title-bar-drag-area-height));
    @include mixins.light-theme {
      background: variables.$color-gray-04;
      border-inline-end: 1px solid variables.$color-black-alpha-16;
    }
    @include mixins.dark-theme {
      background: variables.$color-gray-80;
      border-inline-end: 1px solid variables.$color-white-alpha-16;
    }

    &__add-story__container {
      padding: 4px;
      border-radius: 4px;
      &:hover,
      &:focus {
        @include mixins.light-theme {
          background-color: variables.$color-black-alpha-06;
        }
        @include mixins.dark-theme {
          background-color: variables.$color-white-alpha-06;
        }
      }
    }

    &__add-story__button {
      height: 20px;
      width: 20px;
      @include mixins.light-theme {
        @include mixins.color-svg(
          '../images/icons/v3/plus/plus.svg',
          variables.$color-black
        );
      }
      @include mixins.dark-theme {
        @include mixins.color-svg(
          '../images/icons/v3/plus/plus.svg',
          variables.$color-gray-15
        );
      }

      &:focus {
        @include mixins.keyboard-mode {
          background-color: variables.$color-ultramarine;
        }
      }
    }

    &__header {
      align-items: center;
      display: flex;
      justify-content: space-between;
      padding-block: 0;
      padding-inline: 16px;
      position: relative;

      &--centered {
        justify-content: flex-start;
      }

      &--title {
        @include mixins.font-title-medium;
        flex: 1;
        @include mixins.light-theme {
          color: variables.$color-black;
        }
        @include mixins.dark-theme {
          color: variables.$color-gray-05;
        }
      }

      &--centered .Stories__pane__header--title {
        text-align: center;
        width: 100%;
      }
    }

    &__list {
      display: flex;
      flex-direction: column;
      flex: 1;
      overflow-y: auto;
      scrollbar-gutter: stable;
      padding-inline-start: 11px;
      padding-inline-end: calc(
        11px - var(--axo-scrollbar-gutter-thin-vertical)
      );
      @include mixins.scrollbar-on-hover;

      &--empty {
        @include mixins.font-body-1;
        align-items: center;
        @include mixins.light-theme() {
          color: variables.$color-gray-60;
        }
        @include mixins.dark-theme() {
          color: variables.$color-gray-45;
        }
        & {
          display: flex;
          flex: 1;
          flex-direction: column;
          justify-content: center;
        }
      }
    }
  }

  &__placeholder {
    align-items: center;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: center;
    opacity: 0.7;
    padding-block: 78px 28px;

    @include mixins.light-theme {
      color: variables.$color-gray-60;
    }
    @include mixins.dark-theme {
      color: variables.$color-gray-25;
    }

    &__icon {
      margin-bottom: 12px;
      width: 40px;
      height: 40px;
      @include mixins.light-theme {
        @include mixins.color-svg(
          '../images/icons/v3/stories/stories-display-bold.svg',
          variables.$color-gray-60
        );
      }
      @include mixins.dark-theme {
        @include mixins.color-svg(
          '../images/icons/v3/stories/stories-display-bold.svg',
          variables.$color-gray-25
        );
      }
    }

    &__text {
      text-align: center;
    }

    &__text__action {
      vertical-align: text-top;
      display: inline-block;

      width: 16px;
      height: 16px;
      @include mixins.light-theme {
        @include mixins.color-svg(
          '../images/icons/v3/plus/plus.svg',
          variables.$color-gray-60
        );
      }
      @include mixins.dark-theme {
        @include mixins.color-svg(
          '../images/icons/v3/plus/plus.svg',
          variables.$color-gray-25
        );
      }
    }
  }

  &__hidden-stories {
    @include mixins.button-reset;
    & {
      @include mixins.font-body-1-bold;
      align-items: center;
      display: flex;
      justify-content: space-between;
      padding-block: 12px;
      padding-inline: 24px;
      position: relative;
      width: 100%;
    }
    @include mixins.light-theme {
      color: variables.$color-black;
    }
    @include mixins.dark-theme {
      color: variables.$color-gray-05;
    }

    &::after {
      content: '';
      height: 16px;
      width: 16px;
    }

    &--collapsed {
      &::after {
        @include mixins.light-theme {
          @include mixins.color-svg(
            '../images/icons/v3/chevron/chevron-right.svg',
            variables.$color-black
          );
        }
        @include mixins.dark-theme {
          @include mixins.color-svg(
            '../images/icons/v3/chevron/chevron-right.svg',
            variables.$color-gray-05
          );
        }
      }
    }

    &--expanded {
      &::after {
        @include mixins.light-theme {
          @include mixins.color-svg(
            '../images/icons/v3/chevron/chevron-down.svg',
            variables.$color-black
          );
        }
        @include mixins.dark-theme {
          @include mixins.color-svg(
            '../images/icons/v3/chevron/chevron-down.svg',
            variables.$color-gray-05
          );
        }
      }
    }
  }
}

.StoriesTab__MoreActionsIcon {
  display: block;
  width: 20px;
  height: 20px;
  @include mixins.light-theme {
    @include mixins.color-svg(
      '../images/icons/v3/more/more.svg',
      variables.$color-black
    );
  }
  @include mixins.dark-theme {
    @include mixins.color-svg(
      '../images/icons/v3/more/more.svg',
      variables.$color-gray-15
    );
  }
}
