.flast-toast {
  will-change: transform, opacity;
  touch-action: pan-y;
}

/* Toast container */
#flash-toast-container {
  /* margin-top: 0px; */
  position: fixed;
  z-index: 999999;
  pointer-events: none;
}

/* ========= Toast positions ========= */
#flash-toast-container.top-right {
  top: 12px;
  right: 12px;
}
#flash-toast-container.top-left {
  top: 12px;
  left: 12px;
}
#flash-toast-container.bottom-right {
  bottom: 12px;
  right: 12px;
}
#flash-toast-container.bottom-left {
  bottom: 12px;
  left: 12px;
}

#flash-toast-container.top-center,
#flash-toast-container.bottom-center,
#flash-toast-container.top-full-width,
#flash-toast-container.bottom-full-width {
  left: 50%;
  transform: translateX(-50%);
}

#flash-toast-container.top-center {
  top: 12px;
}
#flash-toast-container.bottom-center {
  bottom: 12px;
}

#flash-toast-container.top-full-width,
#flash-toast-container.bottom-full-width {
  width: 96%;
}

#flash-toast-container.top-full-width {
  top: 12px;
}
#flash-toast-container.bottom-full-width {
  bottom: 12px;
}
/* ========= End Toast positions =========*/

/* Toast item */
#flash-toast-container .toast {
  width: fit-content;
  max-width: 400px;
  -moz-border-radius: 15px;
  -webkit-border-radius: 15px;
  border-radius: 15px;
  overflow: hidden;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  -moz-box-shadow: 0 0 12px #999;
  -webkit-box-shadow: 0 0 12px #999;
  box-shadow: 0 0 12px #999;
  padding: 0px 10px;
  pointer-events: auto;
  color: #fff;
  position: relative; /* cần cho nút X */
}

/* Khi toast được show */
#flash-toast-container .toast.animate-in {
  transform: translateX(0);
  opacity: 1;
}

/* Khi toast hide */
#flash-toast-container .toast.hideing {
  transform: translateX(120%);
  opacity: 0;
}

/* .btn-close {
  box-sizing: content-box;
  width: 1em;
  height: 1em;
  padding: 0.25em 0.25em;
  background: transparent url("data:image/svg+xml…");
  background-size: 1em;
  opacity: 0.5;
} */

#flash-toast-container .btn-close-white {
  position: relative;
  right: -0.3em;
  top: -0.3em;
  float: right;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  -webkit-text-shadow: 0 1px 0 #fff;
  text-shadow: 0 1px 0 #fff;
  opacity: 0.8;
  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
  filter: alpha(opacity=80);
  line-height: 1;
}
#flash-toast-container .btn-close-white {
  background: none !important; /* tắt icon mặc định */
  border: none;
  color: #fff !important;
  position: relative;
}

/* thêm ký tự × */
#flash-toast-container .btn-close-white::before {
  content: "×";
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 0 #fff;
  opacity: 0.9;
}
/* Toast levels */
.toast[data-level="success"] {
  background: linear-gradient(135deg, #28a745, #218838);
}

.toast[data-level="danger"] {
  background: linear-gradient(135deg, #dc3545, #c82333);
}

.toast[data-level="warning"] {
  background: linear-gradient(135deg, #ffc107, #e0a800);
  color: #000;
}

.toast[data-level="info"] {
  background: linear-gradient(135deg, #0dcaf0, #0aa2c0);
}

/* Body */
.toast .toast-body {
  font-size: 15px;
  line-height: 1.4;
}

/* Close button — giống hệt style bạn yêu cầu */
.toast .btn-close-white {
  position: absolute;
  top: 10px;
  right: 12px;

  font-size: 20px;
  font-weight: 700;
  color: #fff;

  opacity: 0.8;
  line-height: 1;
  cursor: pointer;

  padding: 0;
  background: none;
  border: none;

  text-shadow: 0 1px 0 #fff;
  filter: brightness(0) invert(1);
}

.toast .btn-close-white:hover {
  opacity: 0.4;
  color: #000;
}

/* Progress bar */
#flash-toast-container .toast .toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px !important;
  width: 100% !important;

  background: rgba(255, 255, 255, 0.7) !important; /* ép màu trắng */
  opacity: 1 !important; /* override opacity 0.4 của toastr */

  transform: scaleX(1);
  transform-origin: left;
  animation: toast-progress linear forwards;
  z-index: 10;
}

/* Animation của progress */
@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* Animation classes for different positions */
.slideInRight {
  animation: slideInRight 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.slideOutRight {
  animation: slideOutRight 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.slideInLeft {
  animation: slideInLeft 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.slideOutLeft {
  animation: slideOutLeft 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.slideInDown {
  animation: slideInDown 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.slideOutUp {
  animation: slideOutUp 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.slideInUp {
  animation: slideInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.slideOutDown {
  animation: slideOutDown 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.slideInRight,
.slideOutRight,
.slideInLeft,
.slideOutLeft,
.slideInDown,
.slideOutUp,
.slideInUp,
.slideOutDown {
  animation-fill-mode: forwards;
}

@keyframes slideInRight {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutLeft {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-120%);
    opacity: 0;
  }
}

@keyframes slideInDown {
  from {
    transform: translateY(-120%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutUp {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-120%);
    opacity: 0;
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(120%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(120%);
    opacity: 0;
  }
}
