/* ==========================================================================
   Suzuvchi flash toast — sahifani siljitmaydi (position: fixed), o'zi yo'qoladi.
   Barcha sahifalarda ishlatiladi (_flash_toast.html). base.html da global ulanadi.
   ========================================================================== */

.app-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 4000;
  display: flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  max-width: min(520px, calc(100vw - 28px));
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  background: #171717;
  color: #e2e2e2;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  transform: translateX(-50%);
  animation:
    app-toast-in 0.34s cubic-bezier(0.22, 1, 0.36, 1) both,
    app-toast-out 0.45s ease 4.8s forwards;
}

@keyframes app-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes app-toast-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-14px); visibility: hidden; pointer-events: none; }
}

.app-toast-ic { display: inline-flex; flex-shrink: 0; }
.app-toast-msg { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }

.app-toast-x {
  flex-shrink: 0;
  margin-left: 4px;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: inherit;
  font-size: 19px; line-height: 1; cursor: pointer;
  border-radius: 7px; opacity: 0.65;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.app-toast-x:hover { opacity: 1; background: rgba(255, 255, 255, 0.08); }

/* Variantlar */
.app-toast--success {
  border-color: rgba(34, 197, 94, 0.4);
  background: #171717;
  color: #e2e2e2;
}
.app-toast--success .app-toast-ic { color: #22c55e; }

.app-toast--error,
.app-toast--danger {
  border-color: rgba(239, 68, 68, 0.4);
  background: #171717;
  color: #e2e2e2;
}
.app-toast--error .app-toast-ic,
.app-toast--danger .app-toast-ic { color: #ef4444; }

.app-toast--info {
  border-color: rgba(37, 99, 235, 0.4);
  background: #171717;
  color: #e2e2e2;
}
.app-toast--info .app-toast-ic { color: #2563eb; }

@media (prefers-reduced-motion: reduce) {
  .app-toast { animation: app-toast-out 0.4s ease 5s forwards; }
}

@media (max-width: 560px) {
  .app-toast { top: 12px; width: calc(100vw - 24px); max-width: none; }
}
