/* Уведомления — в стиле navbar RED: тёмное стекло, красные акценты */

#toast-container.toast-container {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 10050;
  pointer-events: none;
  width: min(520px, calc(100vw - 32px));
}

.toast-message {
  --toast-accent: rgba(220, 53, 69, 0.95);
  --toast-icon-bg: rgba(220, 53, 69, 0.18);
  --toast-glow: rgba(220, 53, 69, 0.12);

  pointer-events: auto;
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(
    135deg,
    rgba(18, 20, 28, 0.97) 0%,
    rgba(12, 14, 20, 0.94) 100%
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.2) inset,
    0 0 40px var(--toast-glow);
  color: #f0f2f5;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0.01em;
  text-align: left;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-16px) scale(0.98);
  transition:
    opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast-message::before {
  content: "";
  flex: 0 0 4px;
  background: linear-gradient(180deg, var(--toast-accent), transparent);
  opacity: 0.95;
}

.toast-message--success {
  --toast-accent: #34d399;
  --toast-icon-bg: rgba(52, 211, 153, 0.15);
  --toast-glow: rgba(52, 211, 153, 0.1);
}

.toast-message--error {
  --toast-accent: #e63946;
  --toast-icon-bg: rgba(230, 57, 70, 0.2);
  --toast-glow: rgba(230, 57, 70, 0.14);
}

.toast-message--warning {
  --toast-accent: #f59e0b;
  --toast-icon-bg: rgba(245, 158, 11, 0.18);
  --toast-glow: rgba(245, 158, 11, 0.12);
}

.toast-message--info {
  --toast-accent: #38bdf8;
  --toast-icon-bg: rgba(56, 189, 248, 0.16);
  --toast-glow: rgba(56, 189, 248, 0.1);
}

.toast-message.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-message.hide {
  opacity: 0;
  transform: translateY(-12px) scale(0.98);
  transition:
    opacity 0.5s ease-in,
    transform 0.5s ease-in;
}

.toast-message__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 14px 12px;
  flex: 1;
  min-width: 0;
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--toast-icon-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--toast-accent);
}

.toast-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.toast-message__text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

@media (max-width: 480px) {
  #toast-container.toast-container {
    width: calc(100vw - 24px);
  }

  .toast-message {
    font-size: 14px;
  }

  .toast-message__inner {
    padding: 12px 14px 12px 10px;
    gap: 12px;
  }

  .toast-icon {
    width: 38px;
    height: 38px;
  }

  .toast-icon svg {
    width: 20px;
    height: 20px;
  }
}
