/* =========================================================
   TOAST CONTAINER
   ========================================================= */
/**
 * Fixed container that stacks toast notifications
 * in the top-right corner of the viewport.
 *
 * - Uses flex column layout for vertical stacking
 * - pointer-events: none prevents blocking UI interactions
 */
#toast-container {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 320px;
  pointer-events: none;
}

/* =========================================================
   TOAST BASE
   ========================================================= */
/**
 * Core toast component.
 *
 * - Flex layout for icon + content alignment
 * - Slide-in animation on mount
 * - pointer-events enabled for interaction
 */
.app-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e9ecef;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  animation: slideIn .25s ease;
  position: relative;
  overflow: hidden;
  pointer-events: all;
}

/**
 * Left vertical indicator bar (status color)
 */
.app-toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
}

/* Status variants */
.app-toast.success::before { background: #1db954; }
.app-toast.danger::before  { background: #dc3545; }
.app-toast.warning::before { background: #ffc107; }
.app-toast.info::before    { background: #17a2b8; }

/* =========================================================
   ICON
   ========================================================= */
/**
 * Circular icon container displayed on the left side.
 */
.app-toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

/* Status-based icon colors */
.app-toast.success .app-toast-icon { background: #d4edda; color: #155724; }
.app-toast.danger  .app-toast-icon { background: #f8d7da; color: #721c24; }
.app-toast.warning .app-toast-icon { background: #fff3cd; color: #856404; }
.app-toast.info    .app-toast-icon { background: #d1ecf1; color: #0c5460; }

/* =========================================================
   CONTENT
   ========================================================= */
/**
 * Wrapper for textual content inside the toast.
 */
.app-toast-body {
  flex: 1;
  min-width: 0;
}

/**
 * Toast title (primary message)
 */
.app-toast-title {
  font-size: 13px;
  font-weight: 700;
  color: #4e5257;
  margin-bottom: 2px;
}

/**
 * Toast secondary message (description)
 */
.app-toast-msg {
  font-size: 12px;
  color: #6c757d;
  line-height: 1.45;
  margin-bottom: 0;
}

/* =========================================================
   CLOSE BUTTON
   ========================================================= */
/**
 * Dismiss button (top-right).
 */
.app-toast-close {
  background: none;
  border: none;
  color: #adb5bd;
  cursor: pointer;
  align-items: start;
  font-size: 12px;
  flex-shrink: 0;
  margin-bottom: 38px;
}

/* =========================================================
   PROGRESS BAR
   ========================================================= */
/**
 * Bottom progress bar indicating remaining display time.
 */
.app-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 100%;
  animation: progress 3s linear forwards;
}

/* Status-based progress colors */
.app-toast.success .app-toast-progress { background: #1db954; }
.app-toast.danger  .app-toast-progress { background: #dc3545; }
.app-toast.warning .app-toast-progress { background: #ffc107; }
.app-toast.info    .app-toast-progress { background: #17a2b8; }

/* =========================================================
   EXIT STATE
   ========================================================= */
/**
 * Applied before removal to animate toast exit.
 */
.app-toast.hiding {
  animation: slideOut .2s ease forwards;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */
/**
 * Entry animation: slide in from right with fade.
 */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/**
 * Exit animation: slide out to right with fade.
 */
@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/**
 * Progress animation: shrinks width over time.
 */
@keyframes progress {
  from { width: 100%; }
  to   { width: 0%; }
}