/* ======================================== */
/* TOAST                                     */
/* ======================================== */

.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

.toast {
  --toast-bg: #1D1832;
  --toast-border: rgba(255,255,255,0.08);
  --toast-accent: #C8F64C;
  --toast-icon: #C8F64C;

  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 320px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--toast-bg);
  border: 1px solid var(--toast-border);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.5),
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 1px 0 rgba(255,255,255,0.04) inset;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  overflow: hidden;
  animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.25s ease, opacity 0.25s ease, margin-bottom 0.25s ease;
}

.toast.removing {
  animation: toastOut 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* accent stripe */
.toast::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--toast-accent);
  border-radius: 0 2px 2px 0;
}

/* progress bar */
.toast::after {
  content: '';
  position: absolute;
  bottom: 0; left: 3px; right: 0;
  height: 3px;
  background: var(--toast-accent);
  transform-origin: left;
  border-radius: 0 0 16px 0;
  animation: toastProgress var(--toast-duration, 4000ms) linear forwards;
}

.toast.paused::after {
  animation-play-state: paused;
}

/* icon */
.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-top: 1px;
  position: relative;
  z-index: 1;
}

/* body */
.toast-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.toast-title {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
  line-height: 1.3;
}

.toast-message {
  font-size: 12px;
  color: #AAA6BD;
  line-height: 1.4;
}

/* close button */
.toast-close {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: none;
  color: #8F89A6;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: 1px;
  position: relative;
  z-index: 1;
  transition: background 0.15s, color 0.15s;
}

.toast-close:hover {
  background: rgba(255,255,255,0.1);
  color: #FFFFFF;
}

/* ======================================== */
/* VARIANTS                                  */
/* ======================================== */

.toast.success {
  --toast-accent: #C8F64C;
  --toast-icon: #C8F64C;
}

.toast.success .toast-icon {
  background: rgba(200,246,76,0.14);
  color: #C8F64C;
}

.toast.error {
  --toast-accent: #FF6B6B;
  --toast-icon: #FF6B6B;
}

.toast.error .toast-icon {
  background: rgba(255,107,107,0.14);
  color: #FF6B6B;
}

.toast.warning {
  --toast-accent: #FF9B6A;
  --toast-icon: #FF9B6A;
}

.toast.warning .toast-icon {
  background: rgba(255,155,106,0.14);
  color: #FF9B6A;
}

.toast.info {
  --toast-accent: #3CE0F1;
  --toast-icon: #3CE0F1;
}

.toast.info .toast-icon {
  background: rgba(60,224,241,0.14);
  color: #3CE0F1;
}

/* ======================================== */
/* ANIMATIONS                                */
/* ======================================== */

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.94);
  }
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ======================================== */
/* MOBILE                                    */
/* ======================================== */

@media (max-width: 480px) {
  .toast {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    transform: none;
    max-width: none;
  }
}
