/**
 * Toast Notification Styles
 * A polished, non-blocking notification system
 */

/* Toast Container - holds all toasts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10001;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  pointer-events: none;
  max-width: calc(100vw - 3rem);
}

/* Individual Toast */
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--content-bg, white);
  border-radius: 12px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  
  /* Animation */
  opacity: 0;
  transform: translateX(100%) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.toast-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.toast.toast-leaving {
  opacity: 0;
  transform: translateX(100%) scale(0.95);
}

/* Toast Icon */
.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
}

/* Toast Content */
.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--content-text, #1f2937);
  margin: 0;
  line-height: 1.4;
}

.toast-message {
  font-size: 0.875rem;
  color: var(--content-text-secondary, #6b7280);
  margin: 0.125rem 0 0 0;
  line-height: 1.4;
}

/* Toast Close Button */
.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--content-text-secondary, #9ca3af);
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s ease;
  opacity: 0;
}

.toast:hover .toast-close {
  opacity: 1;
}

.toast-close:hover {
  background: var(--hover-bg, #f3f4f6);
  color: var(--content-text, #6b7280);
}

/* Toast Progress Bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: currentColor;
  border-radius: 0 0 0 12px;
  opacity: 0.3;
  transition: width linear;
}

/* Toast Types */
.toast-success {
  border-left: 4px solid #10b981;
}

.toast-success .toast-icon {
  background: #d1fae5;
  color: #059669;
}

.toast-success .toast-progress {
  color: #10b981;
}

.toast-error {
  border-left: 4px solid #ef4444;
}

.toast-error .toast-icon {
  background: #fee2e2;
  color: #dc2626;
}

.toast-error .toast-progress {
  color: #ef4444;
}

.toast-warning {
  border-left: 4px solid #f59e0b;
}

.toast-warning .toast-icon {
  background: #fef3c7;
  color: #d97706;
}

.toast-warning .toast-progress {
  color: #f59e0b;
}

.toast-info {
  border-left: 4px solid #667eea;
}

.toast-info .toast-icon {
  background: #e0e7ff;
  color: #5a67d8;
}

.toast-info .toast-progress {
  color: #667eea;
}

/* Toast with Action Button */
.toast-action {
  flex-shrink: 0;
  padding: 0.375rem 0.75rem;
  background: var(--hover-bg, #f3f4f6);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--content-text, #374151);
  cursor: pointer;
  transition: all 0.15s ease;
}

.toast-action:hover {
  background: var(--border-color, #e5e7eb);
}

/* Dark Mode adjustments */
[data-theme="dark"] .toast {
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 10px 15px -3px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

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

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

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

[data-theme="dark"] .toast-info .toast-icon {
  background: rgba(102, 126, 234, 0.2);
}

/* Responsive */
@media (max-width: 480px) {
  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .toast {
    min-width: 0;
    max-width: 100%;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: opacity 0.15s ease;
    transform: none;
  }
  
  .toast.toast-visible {
    transform: none;
  }
  
  .toast.toast-leaving {
    transform: none;
  }
}
