/* ===== TOAST / ALERT COMPONENT ===== */

/* --- Toast notifications --- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, transparent, rgba(var(--glow-rgb), 0.55), transparent) bottom / 100% 1px no-repeat,
    var(--bg-white);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  font-size: 14px;
  color: var(--text-primary);
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  max-width: 400px;
  border-left: 4px solid var(--primary);
  position: relative;
  z-index: 0;
  contain: layout style paint;
}

/* --- Toast glow (dark theme) --- */
.toast::before {
  content: '';
  position: absolute;
  inset: -1px;
  z-index: -2;
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
  border-radius: calc(var(--radius) + 1px);
  background: radial-gradient(300px circle at var(--gx, 50%) var(--gy, 50%), rgba(var(--glow-rgb), .25), transparent 40%);
}

.toast::after {
  content: '';
  position: absolute;
  inset: 1px;
  z-index: -1;
  pointer-events: none;
  border-radius: calc(var(--radius) - 1px);
  background: var(--bg-white);
}

.toast:hover::before {
  opacity: 1;
}

[data-theme="light"] .toast::before,
[data-theme="light"] .toast::after {
  display: none;
}

[data-theme="light"] .toast {
  background: var(--bg-white);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.success {
  border-left-color: var(--success);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

[data-theme="light"] .toast {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* --- Alert container (EJS component) --- */
.alert-container {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  animation: sectionFadeIn 0.3s ease;
}

.alert-container .alert-dismiss {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
}

.alert-container .alert-dismiss:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}