/* Toast Notifications - iOS Liquid Glass Style */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  position: relative;
  min-width: 340px;
  max-width: 400px;
  padding: 18px 24px;
  border-radius: 20px;
  pointer-events: all;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 1px rgba(255, 255, 255, 0.9);
  animation: toastSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: top right;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.06),
    inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

.toast-content {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.toast-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.toast-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.toast-text {
  flex: 1;
  padding-top: 2px;
}

.toast-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 4px 0;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.toast-message {
  font-size: 13px;
  color: #666;
  margin: 0;
  line-height: 1.4;
  letter-spacing: -0.1px;
}

.toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 16px;
  transition: all 0.2s;
  margin-top: 2px;
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.08);
  transform: scale(1.1);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 20px 20px;
  overflow: hidden;
  width: 100%;
}

.toast-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.8) 0%, rgba(147, 51, 234, 0.8) 100%);
  backdrop-filter: blur(10px);
  animation: progressBar 3s linear forwards;
  transform-origin: left;
}

.toast.success {
  background: rgba(236, 253, 245, 0.75);
  border-color: rgba(167, 243, 208, 0.5);
}

.toast.success .toast-icon {
  background: linear-gradient(135deg, rgba(167, 243, 208, 0.6) 0%, rgba(134, 239, 172, 0.6) 100%);
  color: #059669;
  border-color: rgba(167, 243, 208, 0.8);
}

.toast.success .toast-progress-bar {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.8) 0%, rgba(5, 150, 105, 0.8) 100%);
}

.toast.error {
  background: rgba(254, 242, 242, 0.75);
  border-color: rgba(252, 165, 165, 0.5);
}

.toast.error .toast-icon {
  background: linear-gradient(135deg, rgba(252, 165, 165, 0.6) 0%, rgba(248, 113, 113, 0.6) 100%);
  color: #dc2626;
  border-color: rgba(252, 165, 165, 0.8);
}

.toast.error .toast-progress-bar {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.8) 0%, rgba(220, 38, 38, 0.8) 100%);
}

.toast.warning {
  background: rgba(255, 251, 235, 0.75);
  border-color: rgba(253, 224, 71, 0.5);
}

.toast.warning .toast-icon {
  background: linear-gradient(135deg, rgba(253, 224, 71, 0.6) 0%, rgba(251, 191, 36, 0.6) 100%);
  color: #d97706;
  border-color: rgba(253, 224, 71, 0.8);
}

.toast.warning .toast-progress-bar {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.8) 0%, rgba(217, 119, 6, 0.8) 100%);
}

.toast.info {
  background: rgba(239, 246, 255, 0.75);
  border-color: rgba(147, 197, 253, 0.5);
}

.toast.info .toast-icon {
  background: linear-gradient(135deg, rgba(147, 197, 253, 0.6) 0%, rgba(96, 165, 250, 0.6) 100%);
  color: #2563eb;
  border-color: rgba(147, 197, 253, 0.8);
}

.toast.info .toast-progress-bar {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.8) 0%, rgba(37, 99, 235, 0.8) 100%);
}

@keyframes toastSlideIn {
  0% {
    opacity: 0;
    transform: translateX(100%) scale(0.8) rotate(5deg);
    filter: blur(10px);
  }
  50% {
    transform: translateX(-10px) scale(1.05) rotate(-2deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1) rotate(0);
    filter: blur(0);
  }
}

@keyframes toastSlideOut {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateX(120%) scale(0.9);
    filter: blur(8px);
  }
}

.toast.removing {
  animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes progressBar {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.toast::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transition: left 0.5s;
}

.toast:hover::before {
  left: 100%;
}

@media (prefers-color-scheme: dark) {
  .toast {
    background: rgba(30, 30, 30, 0.85);
    border-color: rgba(60, 60, 60, 0.6);
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.4),
      0 2px 8px rgba(0, 0, 0, 0.2),
      inset 0 1px 1px rgba(255, 255, 255, 0.1);
  }

  .toast-title {
    color: #ffffff;
  }

  .toast-message {
    color: #a0a0a0;
  }

  .toast-icon {
    background: rgba(60, 60, 60, 0.6);
    border-color: rgba(80, 80, 80, 0.6);
  }

  .toast-close {
    background: rgba(255, 255, 255, 0.1);
    color: #a0a0a0;
  }

  .toast-close:hover {
    background: rgba(255, 255, 255, 0.15);
  }
}

@media (max-width: 768px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }

  .toast {
    min-width: auto;
    max-width: none;
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: toastFadeIn 0.3s ease;
  }

  @keyframes toastFadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}
