/* toast.css */

.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  translate: -50% 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 100%;
  margin-inline: auto;
  align-items: center;
}

.toast {
  min-width: 260px;
  max-width: 332px;
  padding: 12px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  transform: translateY(-20px);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  display: flex;
  align-items: center;
  gap: 8;
  min-height: 48px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.hide {
  transform: translatey(-20px);
  opacity: 0;
}

/* states */
.toast.success {
  background: #00AF3D;

  .toast-icon {

    &::before {
      mask-image: url('/src/img/icons/check.svg');
      -webkit-mask-image: url('/src/img/icons/check.svg');
    }
  }
}

.toast.error {
  background: #dc2626;

  .toast-icon {

    &::before {
      mask-image:  url('/src/img/icons/close.svg');
      -webkit-mask-image: url('/src/img/icons/close.svg');
    }
  }
}



.toast.info {
  background: #2563eb;
}

.toast.pending {
  background: #f59e0b;
}

.toast.warning {
  background: #f97316;

  .toast-icon {
    &::before {
      -webkit-mask-image:url('/src/img/icons/icon-warning-light.svg');
      mask-image:  url('/src/img/icons/icon-warning-light.svg');
    }
  }
}

.toast.toast--clipboard {
  .toast-icon {
    border: none;
    border-radius: 0;
    padding: 0;

    &::before {
      mask-image: url('/src/img/icons/copy.svg');
      -webkit-mask-image: url('/src/img/icons/copy.svg');
      mask-size: 16px;
      -webkit-mask-size: 16px;
    }
  }
}

/* icon (optional) */
.toast-icon {
  flex-shrink: 0;
  width: 18px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid #FFFFFF;
  display: flex;
  color: #fff;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;

  &::before {
    content: '';
    width: 100%;
    height: 100%;
    display: block;
    -webkit-mask-image: var(--toast-icon-url);
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: 8px;
    -webkit-mask-position: center;
    mask-image: var(--toast-icon-url);
    mask-repeat: no-repeat;
    mask-size: 8px;
    mask-position: center;
    background-color: currentColor;
  }

}

.toast-close {
  margin-left: auto;
  cursor: pointer;
  opacity: 0.7;
  display: none;
}

.toast-close:hover {
  opacity: 1;
}
