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

@use '../mixins';
@use '../variables';

.StoriesSettingsModal {
  &__width-container {
    max-width: 420px;
  }

  &__modal {
    width: 420px;
  }

  &__conversation-list {
    .module-conversation-list {
      padding-inline: 0;
    }

    .module-conversation-list__item--contact-or-conversation__checkbox--container {
      height: 20px;
      margin-inline-end: 8px;
      position: relative;
      width: 20px;
    }

    input[type='checkbox'] {
      background: transparent;
      border: none;
      cursor: pointer;
      display: block;
      height: 0;
      margin: 0;
      min-width: 0;
      position: absolute;
      width: 0;

      @include mixins.keyboard-mode {
        &:focus {
          &::before {
            border-color: variables.$color-ultramarine;
          }
          outline: none;
        }
      }

      &::before {
        @include mixins.rounded-corners;
        background: inherit;
        border: 1.5px solid;
        @include mixins.light-theme {
          border-color: variables.$color-gray-25;
        }
        @include mixins.dark-theme {
          border-color: variables.$color-gray-60;
        }
        & {
          content: '';
          display: block;
          height: 20px;
          position: absolute;
          width: 20px;
        }
      }

      &:checked {
        &::before {
          -webkit-mask: none;
          background: variables.$color-ultramarine;
          border: 1.5px solid variables.$color-ultramarine;
        }
      }
    }
  }

  &__list {
    @include mixins.button-reset;
    & {
      @include mixins.font-body-1;
      align-items: center;
      display: flex;
      justify-content: space-between;
      width: 100%;
      padding-block: 8px;
      padding-inline: 0;
    }

    &--no-pointer {
      cursor: inherit;
    }

    &__viewers {
      display: flex;
      @include mixins.font-body-2;
      @include mixins.light-theme {
        color: variables.$color-gray-60;
      }
      @include mixins.dark-theme {
        color: variables.$color-gray-25;
      }
    }

    &__left {
      display: flex;
      align-items: center;
    }

    &__avatar {
      @mixin avatar($svg) {
        @include mixins.rounded-corners;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        width: 32px;
        height: 32px;
        @include mixins.light-theme {
          background: variables.$color-gray-15;
        }
        @include mixins.dark-theme {
          background: variables.$color-gray-75;
        }

        &::after {
          content: '';
          height: 20px;
          width: 20px;
          @include mixins.light-theme {
            @include mixins.color-svg($svg, variables.$color-black);
          }
          @include mixins.dark-theme {
            @include mixins.color-svg($svg, variables.$color-white);
          }
        }
      }

      &--new {
        @include avatar('../images/icons/v3/plus/plus.svg');
      }

      &--custom {
        @include avatar('../images/icons/v3/stories/stories.svg');

        &::after {
          height: 20px;
          width: 20px;
        }
      }
    }

    &__title {
      margin-inline-start: 12px;
    }

    &__delete {
      @include mixins.button-reset;
      & {
        height: 20px;
        width: 20px;
        visibility: hidden;
      }

      @include mixins.light-theme {
        @include mixins.color-svg(
          '../images/icons/v3/trash/trash.svg',
          variables.$color-gray-45
        );
      }
      @include mixins.dark-theme {
        @include mixins.color-svg(
          '../images/icons/v3/trash/trash.svg',
          variables.$color-gray-25
        );
      }
    }

    &:hover &__delete {
      visibility: visible;
    }
  }

  &__divider {
    width: 100%;
    border: 0 solid;
    border-top-width: 1px;
    @include mixins.light-theme {
      border-color: variables.$color-gray-15;
    }
    @include mixins.dark-theme {
      border-color: variables.$color-gray-65;
    }
  }

  &__input__container {
    margin-top: 15px;
    margin-bottom: 0px;
  }

  &__visibility {
    @include mixins.font-subtitle;
    margin-top: 10px;
    @include mixins.light-theme {
      color: variables.$color-gray-60;
    }
    @include mixins.dark-theme {
      color: variables.$color-gray-25;
    }
  }

  &__title {
    @include mixins.font-body-1-bold;
    margin-top: 32px;
  }

  &__description {
    @include mixins.font-subtitle;
    margin-top: 0px;
    margin-bottom: 16px;
    @include mixins.light-theme {
      color: variables.$color-gray-60;
    }
    @include mixins.dark-theme {
      color: variables.$color-gray-25;
    }
  }

  &__listHeader {
    display: flex;
    align-items: center;
  }

  &__listHeader__title {
    flex: 1;
    @include mixins.font-body-1-bold;
    margin-inline-end: 8px;
  }

  &__delete-list {
    @include mixins.button-reset;
    & {
      align-items: center;
      color: variables.$color-accent-red;
      display: flex;
      padding-block: 8px;
      padding-inline: 0;
      width: 100%;
    }

    &::before {
      @include mixins.color-svg(
        '../images/icons/v3/trash/trash.svg',
        variables.$color-accent-red
      );
      & {
        content: '';
        height: 20px;
        margin-inline-end: 20px;
        width: 20px;
      }
    }
  }

  &__checkbox {
    margin-block: 14px;
    margin-inline: 0;
  }

  &__checkbox-container {
    flex: 1;
    display: flex;
    align-items: center;
  }

  &__checkbox-label {
    flex: 1;
    margin-inline-end: 8px;
  }

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

  &__conversation-list {
    flex-grow: 1;
    min-height: 300px;
    overflow: hidden;
  }

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

    &__learn-more {
      @include mixins.button-reset;
      @include mixins.light-theme {
        color: variables.$color-gray-90;
      }
      @include mixins.dark-theme {
        color: variables.$color-gray-05;
      }
    }
  }

  &__stories-off-container {
    display: flex;
    gap: 16px;
    align-items: center;
  }

  &__stories-off-text {
    flex: 1;
    @include mixins.font-subtitle;
    @include mixins.light-theme {
      color: variables.$color-gray-60;
    }
    @include mixins.dark-theme {
      color: variables.$color-gray-25;
    }
  }
}

.GroupStorySettingsModal {
  &__header {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 12px;
  }

  &__members_title {
    @include mixins.font-body-1-bold;
  }

  &__members_item {
    display: flex;
    gap: 12px;
    align-items: center;

    &__name {
      @include mixins.font-body-1;
    }
  }

  &__members_help {
    @include mixins.font-body-2;
    @include mixins.light-theme {
      color: variables.$color-gray-60;
    }
    @include mixins.dark-theme {
      color: variables.$color-gray-25;
    }
  }

  &__remove_group {
    @include mixins.button-reset;
    & {
      align-items: center;
      color: variables.$color-accent-red;
      display: flex;
      padding-block: 8px;
      padding-inline: 0;
      width: 100%;
      margin-top: 12px;
    }

    &::before {
      @include mixins.color-svg(
        '../images/icons/v3/minus/minus-circle.svg',
        variables.$color-accent-red
      );
      & {
        content: '';
        height: 20px;
        margin-inline-end: 20px;
        width: 20px;
      }
    }
  }
}
