.uik-alert {
  background-color: white;
  border-radius: 15px;
  box-shadow: var(--shadow-strong);
  padding: 20px 25px;
  display: flex;
  flex-flow: column nowrap;
  justify-content: flex-start;
  align-items: flex-start;
  z-index: 10;
  width: 30rem;
  position: relative;

  .uik-alert__content {
    display: flex;
    flex-flow: row nowrap;
    justify-content: flex-start;
    align-items: flex-start;
    padding-right: 15px;

    .uik-alert__text {
      margin-top: -0.063rem;
      font-size: 0.938rem;
      color: var(--text);
      font-weight: 600;
      line-height: 1.4;
      white-space: pre-line;
      text-align: left;
      word-break: break-word;
    }

    .uik-alert__close-btn {
      border: none;
      background-color: transparent;
      display: flex;
      justify-content: center;
      align-items: center;
      position: absolute;
      top: 5px;
      right: 5px;
      width: 30px;
      height: 30px;
      padding: 0;
      color: var(--text);
      transition: all 0.125s;
      opacity: 0.5;

      .uik-alert__close-btn-icon {
        width: 10px;
        min-width: 10px;
      }

      &:hover {
        opacity: 1;
        color: var(--primary);
        cursor: pointer;
      }
      
      &:active {
        opacity: 1;
        color: var(--primary);
        transform: scale(1.25);
      }
    }
  }

  .uik-alert__buttons {
    width: 100%;
    display: flex;
    flex-flow: row nowrap;
    justify-content: flex-end;
    align-items: center;
    padding: 15px 0 5px 0;

    > * {
      flex-grow: 1;
      flex-basis: 0;

      & + * {
        margin-left: 15px;
      }
    }
  }

  .uik-alert__icon {
    color: var(--primary);
    width: 20px;
    min-width: 20px;
    margin-right: 15px;
  }

  &--danger {
    .uik-alert__icon {
      color: var(--danger);
    }
  }

  &--success {
    .uik-alert__icon {
      color: var(--success);
    }
  }

  &--autoclose {
    overflow: hidden;

    &::after {
      content: "";
      position: absolute;
      z-index: 1;
      top: 0;
      left: 0;
      width: 0;
      height: 3px;
      background: linear-gradient(to right, #ae27a5, #742cb2);
      animation: uik-alert-timer var(--alive-for) linear forwards;
      pointer-events: none;
      opacity: 0.9;

      @keyframes uik-alert-timer {
        from {
          width: 0%;
        }

        to {
          width: 100%;
        }
      }
    }

    &::before {
      opacity: 0.4;
      width: 100%;
      animation: none;
    }

    .uik-alert__content {
      > * {
        z-index: 2;
  
        &:not(.uik-alert__close-btn) {
          position: relative;
        }
      }
    }

    &.uik-alert--danger {
      &::after {
        background: var(--danger);
      }
    }

    &.uik-alert--success {
      &::after {
        background: var(--success);
      }
    }
  }
}