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

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

.Toast {
  $border-radius-px: 8px;

  @include mixins.font-body-2;

  align-items: stretch;
  border-radius: $border-radius-px;
  box-shadow:
    0px 0px 4px rgba(0, 0, 0, 0.05),
    0px 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  overflow: hidden;
  width: fit-content;
  max-width: 280px;
  background-color: variables.$color-gray-75;
  color: variables.$color-gray-05;
  z-index: variables.$z-index-toast;

  inset-inline-start: 20px;
  text-align: start;

  &:focus {
    outline: none;
    @include mixins.keyboard-mode {
      box-shadow: inset 0px 0px 0px 2px variables.$color-ultramarine;
    }
  }

  .ToastManager--narrow-sidebar & {
    width: max-content;
  }

  .ToastManager--narrow-sidebar.ToastManager--composition-area-visible & {
    min-width: initial;
    text-align: center;
  }

  &__content {
    padding-block: 13px;
    padding-inline: 16px;
  }

  &__button {
    display: flex;
    align-items: center;
    justify-content: center;
    @include mixins.font-body-2-bold;
    cursor: pointer;
    padding-block: 13px;
    padding-inline: 16px;
    white-space: nowrap;
    color: variables.$color-ios-blue-tint;

    &:focus {
      outline: none;
      @include mixins.keyboard-mode {
        @include mixins.axo-focus-ring;
      }
    }
  }
}
