/**
 * Toast notification styles
 */

.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;
}

@media (max-width: 640px) {
  .toast-container {
    top: 0.5rem;
    right: 0.5rem;
    left: 0.5rem;
    max-width: none;
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(var(--glass-blur));
  pointer-events: auto;
  opacity: 0;
  transform: translateX(calc(100% + 1rem));
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.9375rem;
  line-height: 1.5;
  max-width: 100%;
  word-wrap: break-word;
}

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

.toast-hide {
  opacity: 0;
  transform: translateX(calc(100% + 1rem));
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.toast-content {
  flex: 1;
  color: var(--color-text);
}

.toast-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.toast-close:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

.toast-close:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Toast type variants */
.toast-success {
  border-left: 4px solid var(--color-success, #10b981);
}

.toast-success .toast-icon {
  color: var(--color-success, #10b981);
}

.toast-error {
  border-left: 4px solid var(--color-error, #ef4444);
}

.toast-error .toast-icon {
  color: var(--color-error, #ef4444);
}

.toast-warning {
  border-left: 4px solid var(--color-warning, #f59e0b);
}

.toast-warning .toast-icon {
  color: var(--color-warning, #f59e0b);
}

.toast-info {
  border-left: 4px solid var(--color-info, #3b82f6);
}

.toast-info .toast-icon {
  color: var(--color-info, #3b82f6);
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .toast {
    box-shadow: var(--shadow-medium);
  }
}

[data-theme="dark"] .toast {
  box-shadow: var(--shadow-medium);
}

/* Animation for stacking toasts */
@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(calc(100% + 1rem));
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-slide-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(calc(100% + 1rem));
  }
}
