:root {
  --bg-success: #ecfdf5;
  --border-success: #10b981;
  --text-success: #065f46;
  
  --bg-error: #fef2f2;
  --border-error: #ef4444;
  --text-error: #991b1b;
  
  --bg-info: #eff6ff;
  --border-info: #3b82f6;
  --text-info: #1e40af;
}

/* Force container layout prioritization */
.toast-container {
  position: fixed !important;
  top: 24px !important;
  right: 24px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  z-index: 999999 !important;
  pointer-events: none;
}

/* OVERRIDE BOOTSTRAP: Chain classes to beat Bootstrap specificity */
div.toast-container .toast {
  display: flex !important; /* Overrides Bootstrap display: none */
  opacity: 1 !important;    /* Overrides Bootstrap opacity: 0 */
  align-items: flex-start;
  width: 320px;
  max-width: 320px;
  padding: 16px;
  border-radius: 8px;
  border: none !important;
  border-left: 4px solid transparent !important;
  background-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-size: 14px;
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  
  /* Entry animation */
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(110%);
    opacity: 0 !important;
  }
  to {
    transform: translateX(0);
    opacity: 1 !important;
  }
}

/* Exit animation */
div.toast-container .toast.hide {
  display: flex !important;
  animation: toastSlideOut 0.3s ease forwards !important;
}

@keyframes toastSlideOut {
  to {
    transform: translateX(110%);
    opacity: 0 !important;
  }
}

/* Variant Themes */
div.toast-container .toast.success { background-color: var(--bg-success) !important; border-left-color: var(--border-success) !important; }
div.toast-container .toast.success .toast-title { color: var(--text-success) !important; }
div.toast-container .toast.success svg { fill: var(--border-success) !important; }

div.toast-container .toast.error { background-color: var(--bg-error) !important; border-left-color: var(--border-error) !important; }
div.toast-container .toast.error .toast-title { color: var(--text-error) !important; }
div.toast-container .toast.error svg { fill: var(--border-error) !important; }

div.toast-container .toast.info { background-color: var(--bg-info) !important; border-left-color: var(--border-info) !important; }
div.toast-container .toast.info .toast-title { color: var(--text-info) !important; }
div.toast-container .toast.info svg { fill: var(--border-info) !important; }

/* Elements Layout */
.toast-icon { margin-right: 12px; flex-shrink: 0; display: flex; align-items: center; height: 20px; }
.toast-icon svg { width: 20px; height: 20px; }
.toast-content { flex-grow: 1; padding-right: 12px; }
.toast-title { font-weight: 600; margin: 0 0 4px 0; }
.toast-message { color: #4b5563; margin: 0; line-height: 1.4; }

.toast-close {
  background: none !important;
  border: none !important;
  color: #9ca3af !important;
  cursor: pointer;
  padding: 0 !important;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: none !important;
}
.toast-close:hover { color: #4b5563 !important; }
