/**
 * Toast Notifications Styles for Django Templates
 */

/* 动画 */
@keyframes toast-slide-in {
  0% { opacity: 0; transform: translateX(100%) scale(0.9); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-slide-out {
  0% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(100%) scale(0.9); }
}

@keyframes toast-progress {
  0% { width: 100%; }
  100% { width: 0%; }
}

@keyframes toast-icon-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* 容器 */
.toast-notifications-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  z-index: 99999;
  max-width: 420px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

@media (max-width: 480px) {
  .toast-notifications-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }
}

/* 通知项 */
.toast-notification {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 10px 20px -5px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.05);
  animation: toast-slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.toast-notification:hover {
  transform: translateX(-4px);
  box-shadow: 0 8px 16px -4px rgba(0,0,0,0.15), 0 20px 40px -10px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.05);
}

.toast-notification.toast-exit {
  animation: toast-slide-out 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* 图标 */
.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  animation: toast-icon-bounce 0.5s ease 0.2s;
}

.toast-icon svg {
  width: 16px;
  height: 16px;
}

/* 内容 */
.toast-content {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.toast-message {
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: #1f2937;
  word-wrap: break-word;
}

/* 关闭按钮 */
.toast-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(0,0,0,0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #6b7280;
}

.toast-close svg {
  width: 14px;
  height: 14px;
}

.toast-close:hover {
  background: rgba(0,0,0,0.1);
  color: #374151;
  transform: rotate(90deg);
}

.toast-close:active {
  transform: rotate(90deg) scale(0.9);
}

/* 进度条 */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 16px 16px;
  animation: toast-progress linear forwards;
}

.toast-progress.paused {
  animation-play-state: paused;
}

/* 成功 */
.toast-success { border-left: 4px solid #10b981; }
.toast-success .toast-icon { background: rgba(16,185,129,0.15); color: #10b981; }
.toast-success .toast-progress { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }

/* 错误 */
.toast-error { border-left: 4px solid #ef4444; }
.toast-error .toast-icon { background: rgba(239,68,68,0.15); color: #ef4444; }
.toast-error .toast-progress { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }

/* 警告 */
.toast-warning { border-left: 4px solid #f59e0b; }
.toast-warning .toast-icon { background: rgba(245,158,11,0.15); color: #f59e0b; }
.toast-warning .toast-progress { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }

/* 信息 */
.toast-info { border-left: 4px solid #3b82f6; }
.toast-info .toast-icon { background: rgba(59,130,246,0.15); color: #3b82f6; }
.toast-info .toast-progress { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }

/* 暗黑模式 */
body.dark_theme .toast-notification,
[data-theme="dark"] .toast-notification {
  background: rgba(31, 41, 55, 0.98);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 10px 20px -5px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.1);
}

body.dark_theme .toast-notification:hover,
[data-theme="dark"] .toast-notification:hover {
  box-shadow: 0 8px 16px -4px rgba(0,0,0,0.4), 0 20px 40px -10px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.15);
}

body.dark_theme .toast-message,
[data-theme="dark"] .toast-message {
  color: #f3f4f6;
}

body.dark_theme .toast-close,
[data-theme="dark"] .toast-close {
  background: rgba(255,255,255,0.1);
  color: #9ca3af;
}

body.dark_theme .toast-close:hover,
[data-theme="dark"] .toast-close:hover {
  background: rgba(255,255,255,0.2);
  color: #f3f4f6;
}

body.dark_theme .toast-success .toast-icon,
[data-theme="dark"] .toast-success .toast-icon { background: rgba(16,185,129,0.25); }

body.dark_theme .toast-error .toast-icon,
[data-theme="dark"] .toast-error .toast-icon { background: rgba(239,68,68,0.25); }

body.dark_theme .toast-warning .toast-icon,
[data-theme="dark"] .toast-warning .toast-icon { background: rgba(245,158,11,0.25); }

body.dark_theme .toast-info .toast-icon,
[data-theme="dark"] .toast-info .toast-icon { background: rgba(59,130,246,0.25); }

