/* static/css/toast.css */
/**
 * Toast Notification Styles
 * Красивые уведомления для Hotel Intelligence
 */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: var(--bg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
  min-width: 300px;
  max-width: 400px;
  pointer-events: all;
  opacity: 0;
  transform: translateX(120%);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-show {
  opacity: 1;
  transform: translateX(0);
}

.toast-hide {
  opacity: 0;
  transform: translateX(120%) scale(0.9);
  transition: all 0.2s ease-in;
}

.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-message {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
  word-wrap: break-word;
}

.toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 0.375rem;
  transition: all 0.2s;
  padding: 0;
  margin: -0.25rem -0.5rem -0.25rem 0;
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

/* Типы тостов */
.toast-success {
  border-left: 4px solid #22c55e;
}

.toast-success .toast-icon {
  color: #22c55e;
}

.toast-error {
  border-left: 4px solid #ef4444;
}

.toast-error .toast-icon {
  color: #ef4444;
}

.toast-warning {
  border-left: 4px solid #eab308;
}

.toast-warning .toast-icon {
  color: #eab308;
}

.toast-info {
  border-left: 4px solid #6366f1;
}

.toast-info .toast-icon {
  color: #6366f1;
}

/* Адаптивность */
@media (max-width: 640px) {
  .toast-container {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }

  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .toast {
    transform: translateY(120%);
  }

  .toast-show {
    transform: translateY(0);
  }

  .toast-hide {
    transform: translateY(120%) scale(0.9);
  }
}

/* Тёмная тема */
[data-theme="dark"] .toast {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .toast-close:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Анимация пульсации для важных уведомлений */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.9;
  }
}

.toast.toast-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Прогресс-бар для автозакрытия (опционально) */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.3;
  border-radius: 0 0 0.75rem 0.75rem;
  transform-origin: left;
  animation: toast-progress linear forwards;
}

@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* Скрываем старые flash сообщения (будут конвертированы в тосты) */
.flash-message {
  display: none;
}
