@import 'src/global/styles/var';

.glue-toast {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: content-box;

  // hack for avoid max-width when use left & fixed
  width: @toast-default-width;
  max-width: @toast-max-width;
  min-height: @toast-default-min-height;
  padding: @toast-default-padding;
  color: @toast-text-color;
  font-size: @toast-font-size;
  line-height: @toast-line-height;

  // allow newline charactor
  white-space: pre-wrap;
  text-align: center;
  word-wrap: break-word;
  background-color: @toast-background-color;
  border-radius: @toast-border-radius;
  &__popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate3d(-50%, -50%, 0);
    max-height: 100%;
    overflow-y: auto;
  }
  &--unclickable {
    // lock scroll
    overflow: hidden;

    // should not add pointer-events: none directly to body tag
    // that will cause unexpected tap-highlight-color in mobile safari
    * {
      pointer-events: none;
    }
  }

  &--text,
  &--html {
    width: fit-content;
    min-width: @toast-text-min-width;
    min-height: 0;
    padding: @toast-text-padding;

    .glue-toast__text {
      margin-top: 0;
    }
  }

  &--top {
    top: @toast-position-top-distance;
  }

  &--bottom {
    top: auto;
    bottom: @toast-position-bottom-distance;
  }

  &__icon {
    font-size: @toast-icon-size;
  }

  &__loading {
    padding: @padding-base;
    color: @toast-loading-icon-color;
  }

  &__text {
    margin-top: @padding-xs;
  }
  &&--center {
    top: 50%;
    left: 50%;
    transform: translate3d(-50%, -50%, 0);
  }
  &&--popup {
    position: fixed;
    max-height: 100%;
    overflow-y: auto;
  }
}
