/* ══════════════════════════════════════════════════════════
   Flash Toasts — unified notification system
   ══════════════════════════════════════════════════════════ */

.flash-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 420px;
  max-width: 92vw;
  pointer-events: none;
}

/* ── single toast ── */
.flash-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.4;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
  animation: flashSlideIn 0.35s ease-out;
}

.flash-toast.removing {
  animation: flashSlideOut 0.3s ease-in forwards;
}

/* icon */
.flash-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* text */
.flash-text {
  flex: 1;
  min-width: 0;
}

/* close button */
.flash-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.4;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 2px;
  line-height: 1;
  transition: opacity 0.15s;
}
.flash-close:hover {
  opacity: 0.8;
}

/* ── category colors ── */
.flash-toast.success {
  background: rgba(22, 163, 74, 0.18);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.2);
}
.flash-toast.danger {
  background: rgba(220, 38, 38, 0.18);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}
.flash-toast.warning {
  background: rgba(202, 138, 4, 0.18);
  color: #fbbf24;
  border-color: rgba(234, 179, 8, 0.2);
}
.flash-toast.info {
  background: rgba(37, 99, 235, 0.18);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.2);
}

/* ── progress bar (auto-dismiss timer) ── */
.flash-progress {
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 1px;
  overflow: hidden;
}
.flash-progress-bar {
  height: 100%;
  border-radius: 1px;
  animation: flashCountdown var(--flash-duration, 5s) linear forwards;
}
.flash-toast.success .flash-progress-bar { background: rgba(74, 222, 128, 0.4); }
.flash-toast.danger  .flash-progress-bar { background: rgba(248, 113, 113, 0.4); }
.flash-toast.warning .flash-progress-bar { background: rgba(251, 191, 36, 0.4); }
.flash-toast.info    .flash-progress-bar { background: rgba(96, 165, 250, 0.4); }

/* ── animations ── */
@keyframes flashSlideIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes flashCountdown {
  from { width: 100%; }
  to   { width: 0%; }
}
