@import '../../base/bootstrap5-lite.scss';
@import '../../buttons/button/bootstrap5.scss';
//Layout Variables Start
//Mouse Mode Start
$toast-icon-nrml-height: 20px !default;
$toast-icon-nrml-width: 20px !default;
$toast-icon-nrml-size: $text-sm !default;
$toast-icon-nrml-right-margin: 14px !default;
$toast-close-icon-nrml-height: 20px !default;
$toast-close-icon-nrml-width: 20px !default;
$toast-close-icon-nrml-size: $text-sm !default;
$toast-position-nrml-distance: 10px !default;
$multitoast-nrml-gap-distance: 10px !default;
$toast-nrml-min-height: 48px !default;
$toast-nrml-padding: 0 !default;
$toast-action-btn-nrml-padding: 12px 0 !default;
$toast-action-btn-nrml-margin: 10px !default;
$toast-progressbar-nrml-height: 4px !default;
$toast-content-nrml-padding: 12px !default;
$toast-nrml-border-radious: 4px !default;
$toast-font-nrml-size: $text-sm !default;
$toast-title-font-nrml-size: $text-sm !default;

//Mouse Mode End

//Touch Mode Start
$toast-icon-bgr-height: 24px !default;
$toast-icon-bgr-width: 24px !default;
$toast-icon-bgr-size: 18px !default;
$toast-icon-bgr-right-margin: 16px !default;
$toast-close-icon-bgr-height: 24px !default;
$toast-close-icon-bgr-width: 24px !default;
$toast-close-icon-bgr-size: $text-sm !default;
$toast-position-bgr-distance: 10px !default;
$multitoast-bgr-gap-distance: 10px !default;
$toast-bgr-min-height: 48px !default;
$toast-action-btn-bgr-padding: 16px 0 !default;
$toast-action-btn-bgr-margin: 10px !default;
$toast-progressbar-bgr-height: 4px !default;
$toast-content-bgr-padding: 16px !default;
$toast-bgr-border-radious: 4px !default;
$toast-font-bgr-size: $text-sm !default;
$toast-title-font-weight: $font-weight-medium !default;

//Touch Mode End
//Layout Variables End

//Theme Variables Start
$toast-border: 1px solid $border-light !default;
$toast-box-shadow: $shadow !default;
$toast-hover-box-shadow: $shadow !default;
$toast-progress-color: $primary !default;
$toast-bg-color: $content-bg-color !default;
$toast-hover-bg-color: $content-bg-color !default;
$toast-active-bg-color: $content-bg-color !default;
$toast-font-color: $content-text-color-alt1 !default;
$toast-icon-color: $icon-color !default;
$toast-close-icon-color: $icon-color !default;
$toast-title-color: $content-text-color !default;
$toast-content-color: $content-text-color-alt1 !default;

// Toast Type Definitions Start
$toast-success-bg-color: $success-light !default;
$toast-success-color: $success-bg-color !default;
$toast-success-title-color: $success-bg-color !default;
$toast-success-title-border-color: $success-border-color !default;
$toast-success-icon-color: $success-bg-color !default;
$toast-success-content-color: $success-bg-color !default;
$toast-success-hover-bg-color: $success-light !default;
$toast-success-hover-color: $success-bg-color !default;
$toast-success-hover-box-shadow: $shadow !default;

$toast-info-bg-color: $info-light !default;
$toast-info-color: $info-dark !default;
$toast-info-title-color: $info-dark !default;
$toast-info-title-border-color: $info-dark !default;
$toast-info-icon-color: $info-dark !default;
$toast-info-content-color: $info-dark !default;
$toast-info-hover-bg-color: $info-light !default;
$toast-info-hover-color: $info-dark !default;
$toast-info-hover-box-shadow: $shadow !default;

$toast-warning-bg-color: $warning-light !default;
$toast-warning-color: $warning-dark !default;
$toast-warning-title-color: $warning-dark !default;
$toast-warning-title-border-color: $warning-dark !default;
$toast-warning-icon-color: $warning-dark !default;
$toast-warning-content-color: $warning-dark !default;
$toast-warning-hover-bg-color: $warning-light !default;
$toast-warning-hover-color: $warning-dark !default;
$toast-warning-hover-box-shadow: $shadow !default;

$toast-danger-bg-color: $danger-light !default;
$toast-danger-color: $danger-bg-color !default;
$toast-danger-title-color: $danger-bg-color !default;
$toast-danger-title-border-color: $border-error !default;
$toast-danger-icon-color: $danger-bg-color !default;
$toast-danger-content-color: $danger-bg-color !default;
$toast-danger-hover-bg-color: $danger-light !default;
$toast-danger-hover-color: $danger-bg-color !default;
$toast-danger-hover-box-shadow: $shadow !default;

$toast-close-icon-hover-bg-color: $transparent !default;
$toast-close-icon-hover-color: $icon-color-hover !default;

// Toast Type Definitions End
//Theme Variables End

@include export-module('toast-layout') {
  /* stylelint-disable property-no-vendor-prefix */
  .e-toast-container {
    display: inline-flex;
    flex-direction: column;
    position: relative;

    &.e-toast-top-left {
      left: $toast-position-nrml-distance;
      top: $toast-position-nrml-distance;
    }

    &.e-toast-bottom-left {
      bottom: $toast-position-nrml-distance;
      left: $toast-position-nrml-distance;
    }

    &.e-toast-top-right {
      right: $toast-position-nrml-distance;
      top: $toast-position-nrml-distance;
    }

    &.e-toast-bottom-right {
      bottom: $toast-position-nrml-distance;
      right: $toast-position-nrml-distance;
    }

    &.e-toast-bottom-center {
      bottom: $toast-position-nrml-distance;
      pointer-events: none;
      right: 0;
      width: 100%;

      .e-toast {
        margin: 0 auto $multitoast-nrml-gap-distance;
        pointer-events: auto;
      }
    }

    &.e-toast-top-center {
      pointer-events: none;
      right: 0;
      top: $toast-position-nrml-distance;
      width: 100%;

      .e-toast {
        margin: 0 auto $multitoast-nrml-gap-distance;
        pointer-events: auto;
      }
    }

    &.e-toast-full-width {
      left: 0;
      right: 0;
      width: 100%;

      .e-toast {
        margin: 0 auto $multitoast-nrml-gap-distance;
        width: 96%;
      }
    }

    &.e-rtl {
      .e-toast {
        .e-toast-actions {
          text-align: left;

          > * {
            margin-left: initial;
            margin-right: $toast-action-btn-nrml-margin;
          }
        }

        .e-toast-close-icon {
          margin-left: initial;
          margin-right: auto;
        }

        .e-toast-icon {
          margin-left: $toast-icon-nrml-right-margin;
          margin-right: initial;
        }

        .e-toast-progress {
          left: auto;
          right: 0;
        }
      }
    }

    .e-toast {
      border-radius: $toast-nrml-border-radious;
      display: inline-flex;
      font-size: $toast-font-nrml-size;
      margin: 0 0 $multitoast-nrml-gap-distance;
      overflow: hidden;
      padding: $toast-nrml-padding;
      position: relative;

      .e-toast-icon,
      .e-toast-message {
        display: inline-flex;
      }

      > * {
        word-break: break-word;
        word-wrap: break-word;
      }

      .e-toast-message {
        align-self: center;
        flex-direction: column;
        overflow: hidden;
        width: inherit;
        @if $skin-name == 'material' or $skin-name == 'Material3' {
          flex: 1;
        }

        .e-toast-title,
        .e-toast-content {
          overflow: hidden;
          text-overflow: ellipsis;

          &:first-child {
            padding: 0;
            @if $skin-name == 'bootstrap5' or $skin-name == 'bootstrap5.3' {
              padding-bottom: 12px;
              padding-left: 12px;
              padding-right: 12px;
              padding-top: 12px;
            }
          }

          &:last-child {
            padding-bottom: 0;
            @if $skin-name == 'bootstrap5' or $skin-name == 'bootstrap5.3' {
              padding-bottom: 12px;
            }
          }

          > * {
            overflow: hidden;
            text-overflow: ellipsis;
          }
        }

        .e-toast-title {
          font-size: $toast-title-font-nrml-size;
          font-weight: $toast-title-font-weight;
          letter-spacing: .5px;
          @if $skin-name == 'bootstrap5' or $skin-name == 'bootstrap5.3' {
            border-bottom: 1px solid $border;
          }
        }

        .e-toast-content {
          padding: $toast-content-nrml-padding;
          word-break: break-word;
          word-wrap: break-word;

          + .e-toast-actions {
            padding-top: 0;
            @if $skin-name == 'bootstrap5' or $skin-name == 'bootstrap5.3' {
              padding: $toast-action-btn-bgr-padding;
            }
          }
        }

        .e-toast-actions {
          @if $skin-name == 'highcontrast' {
            margin: 1px 0 0 3px;
          }
          @else {
            margin: 1px;
          }
          @if $skin-name == 'bootstrap5' or $skin-name == 'bootstrap5.3' {
            border-top: 1px solid $border;
            margin-left: 12px;
            margin-right: 12px;
          }
          @if $skin-name != 'tailwind3' {
            padding: $toast-action-btn-nrml-padding;
          }
          text-align: right;

          > * {
            margin-left: $toast-action-btn-nrml-margin;
          }
        }
      }

      &.e-toast-header-icon {
        .e-toast-message {
          .e-toast-title,
          .e-toast-content {
            &:first-child {
              @if $skin-name == 'bootstrap5' or $skin-name == 'bootstrap5.3' {
                padding-left: 48px;
              }
            }
          }
        }
      }

      &.e-toast-header-close-icon {
        .e-toast-message {
          .e-toast-title,
          .e-toast-content {
            &:first-child {
              @if $skin-name == 'bootstrap5' or $skin-name == 'bootstrap5.3' {
                padding-right: 30px;
              }
            }
          }
        }
      }

      .e-toast-close-icon {
        align-items: center;
        cursor: pointer;
        display: flex;
        font-size: $toast-close-icon-nrml-size;
        height: $toast-close-icon-nrml-height;
        justify-content: center;
        margin-left: auto;
        width: $toast-close-icon-nrml-width;
        @if $skin-name == 'material' {
          opacity: .7;
        }
        @if $skin-name == 'bootstrap5' or $skin-name == 'bootstrap5.3' {
          margin-top: 13px;
          position: absolute;
          right: 8px;
        }
      }

      .e-toast-icon {
        align-items: center;
        font-size: $toast-icon-nrml-size;
        height: $toast-icon-nrml-height;
        justify-content: center;
        margin-right: $toast-icon-nrml-right-margin;
        width: $toast-icon-nrml-width;
        @if $skin-name == 'bootstrap5' or $skin-name == 'bootstrap5.3' {
          left: 16px;
          margin-top: 13px;
          position: absolute;
        }
      }

      .e-toast-progress {
        bottom: 0;
        height: $toast-progressbar-nrml-height;
        left: 0;
        position: absolute;
      }
    }
  }

  .e-content-placeholder.e-toast.e-placeholder-toast {
    background-size: 400px 100px;
    min-height: 100px;
  }

  .e-blazor-toast-hidden {
    visibility: hidden;
  }

  .e-toast-container .e-toast .e-toast-close-icon.blazor-toast-close-icon {
    background-color: transparent;
    border-color: transparent;
    border-radius: 50%;
    bottom: 6px;
    height: 20px;
    position: relative;
    width: 22px;
  }
}


.e-toast-container {
  .e-toast {
    background-color: $toast-bg-color;
    border: $toast-border;
    box-shadow: $toast-box-shadow;
    color: $toast-font-color;

    .e-toast-close-icon {
      color: $toast-close-icon-color;

      &.e-blazor-toast-close-icon,
      &.e-blazor-toast-close-icon:focus,
      &.e-blazor-toast-close-icon:active {
        @if $skin-name == 'Material3' {
          background: transparent;
        }
        @else {
          background-color: transparent;
        }
        border: 0;
        box-shadow: none;
        outline: 0;
      }

      &.e-blazor-toast-close-icon:focus,
      &.e-blazor-toast-close-icon:hover {
        @if $skin-name == 'Material3' {
          background: $toast-close-icon-hover-bg-color;
        }
        @else {
          background-color: $toast-close-icon-hover-bg-color;
        }
        color: $toast-close-icon-hover-color;
      }
    }
    
    .e-toast-close-icon.e-icons:hover,
    .e-toast-close-icon.e-icons:focus{
      @if $skin-name == 'Material3' {
        background: $toast-close-icon-hover-bg-color;
        border-radius: $toast-icon-hover-border-radius;
        height: 32px;
      }
      @else {
        background-color: $toast-close-icon-hover-bg-color;
      }
      @if $skin-name == 'material' {
        border-radius: $toast-icon-hover-border-radius;
      }
      color: $toast-close-icon-hover-color;
    }

    &.e-toast-success {
      background-color: $toast-success-bg-color;
      color: $toast-success-color;

      @if $skin-name == 'highcontrast' or $skin-name == 'bootstrap' or $skin-name == 'bootstrap4' {
        border-color: $toast-success-border-color;
      }

      .e-toast-message .e-toast-title {
        color: $toast-success-title-color;
        @if $skin-name == 'bootstrap5' or $skin-name == 'bootstrap5.3' {
          border-color: $toast-success-title-border-color;
        }
      }

      .e-toast-message .e-toast-content {
        color: $toast-success-content-color;
      }

      .e-toast-icon {
        color: $toast-success-icon-color;
      }

      .e-toast-close-icon {
        color: $toast-success-icon-color;
      }

      &:hover {
        background-color: $toast-success-hover-bg-color;
        box-shadow: $toast-success-hover-box-shadow;
        color: $toast-success-hover-color;

        @if $skin-name == 'highcontrast' or $skin-name == 'bootstrap' or $skin-name == 'bootstrap4' {
          border-color: $toast-success-hover-border-color;
        }
      }
    }

    &.e-toast-info {
      background-color: $toast-info-bg-color;
      color: $toast-info-color;

      @if $skin-name == 'highcontrast' or $skin-name == 'bootstrap' or $skin-name == 'bootstrap4' {
        border-color: $toast-info-border-color;
      }

      .e-toast-message .e-toast-title {
        color: $toast-info-title-color;
        @if $skin-name == 'bootstrap5' or $skin-name == 'bootstrap5.3' {
          border-color: $toast-info-title-border-color;
        }
      }

      .e-toast-message .e-toast-content {
        color: $toast-info-content-color;
      }

      .e-toast-icon {
        color: $toast-info-icon-color;
      }

      .e-toast-close-icon {
        color: $toast-info-icon-color;
      }

      &:hover {
        background-color: $toast-info-hover-bg-color;
        box-shadow: $toast-info-hover-box-shadow;
        color: $toast-info-hover-color;

        @if $skin-name == 'highcontrast' or $skin-name == 'bootstrap' or $skin-name == 'bootstrap4' {
          border-color: $toast-info-hover-border-color;
        }
      }
    }

    &.e-toast-warning {
      background-color: $toast-warning-bg-color;
      color: $toast-warning-color;

      @if $skin-name == 'highcontrast' or $skin-name == 'bootstrap' or $skin-name == 'bootstrap4' {
        border-color: $toast-warning-border-color;
      }

      .e-toast-message .e-toast-title {
        color: $toast-warning-title-color;
        @if $skin-name == 'bootstrap5' or $skin-name == 'bootstrap5.3' {
          border-color: $toast-warning-title-border-color;
        }
      }

      .e-toast-message .e-toast-content {
        color: $toast-warning-content-color;
      }

      .e-toast-icon {
        color: $toast-warning-icon-color;
      }

      .e-toast-close-icon {
        color: $toast-warning-icon-color;
      }

      &:hover {
        background-color: $toast-warning-hover-bg-color;
        box-shadow: $toast-warning-hover-box-shadow;
        color: $toast-warning-hover-color;

        @if $skin-name == 'highcontrast' or $skin-name == 'bootstrap' or $skin-name == 'bootstrap4' {
          border-color: $toast-warning-hover-border-color;
        }
      }
    }

    &.e-toast-danger {
      background-color: $toast-danger-bg-color;
      color: $toast-danger-color;

      @if $skin-name == 'highcontrast' {
        border-color: $toast-danger-border-color;
      }

      .e-toast-message .e-toast-title {
        color: $toast-danger-title-color;
        @if $skin-name == 'bootstrap5' or $skin-name == 'bootstrap5.3' {
          border-color: $toast-danger-title-border-color;
        }
      }

      .e-toast-message .e-toast-content {
        color: $toast-danger-content-color;
      }

      .e-toast-icon {
        color: $toast-danger-icon-color;
      }

      .e-toast-close-icon {
        color: $toast-danger-icon-color;
      }

      &:hover {
        background-color: $toast-danger-hover-bg-color;
        box-shadow: $toast-danger-hover-box-shadow;
        color: $toast-danger-hover-color;

        @if $skin-name == 'highcontrast' or $skin-name == 'bootstrap' or $skin-name == 'bootstrap4' {
          border-color: $toast-danger-hover-border-color;
        }
      }
    }

    &:hover {
      background-color: $toast-hover-bg-color;
      box-shadow: $toast-hover-box-shadow;

      @if $skin-name == 'highcontrast' {
        border-color: $toast-hover-border-color;
      }
    }

    .e-toast-icon {
      color: $toast-icon-color;
    }

    .e-toast-message {
      .e-toast-title {
        color: $toast-title-color;
      }

      .e-toast-content {
        color: $toast-content-color;
      }
    }

    .e-toast-progress {
      background-color: $toast-progress-color;
    }

    @if $skin-name == 'material' {
      .e-toast-actions {
        .e-btn {
          background-color: $toast-btn-flat-bgcolor;
          border-color: $toast-btn-flat-border-color;
          box-shadow: $toast-btn-flat-box-shadow;
          color: $toast-btn-flat-color;

          &:hover {
            background-color: $toast-btn-flat-hover-bgcolor;
            color: $toast-btn-flat-hover-color;
          }

          &:focus {
            background-color: $toast-btn-flat-focus-bgcolor;
            color: $toast-btn-flat-focus-color;
          }

          &:active {
            background-color: $toast-btn-flat-active-bgcolor;
            color: $toast-btn-flat-active-color;
          }
        }
      }
    }
  }
}


@include export-module('toast-material-icons') {
  .e-toast {
    .e-toast-close-icon::before {
      content: '\e7e7';
      font-family: 'e-icons';
    }

    .e-toast-success-icon::before {
      content: '\e727';
      font-family: 'e-icons';
    }

    .e-toast-error-icon::before {
      content: '\e878';
      font-family: 'e-icons';
    }

    .e-toast-info-icon::before {
      content: '\e800';
      font-family: 'e-icons';
    }

    .e-toast-warning-icon::before {
      content: '\e88b';
      font-family: 'e-icons';
    }
  }
}

