/* Snack Apps Toast Notification Styles */

.snack-toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: calc(100vw - 2rem);
  pointer-events: none;
}

.snack-toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 280px;
  max-width: 400px;
  pointer-events: auto;
  animation: snack-toast-enter 0.3s ease-out;
}

.snack-toast-exit {
  animation: snack-toast-exit 0.2s ease-in forwards;
}

@keyframes snack-toast-enter {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes snack-toast-exit {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.snack-toast-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 700;
}

.snack-toast-message {
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #1f2937;
}

.snack-toast-close {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
  border-radius: 0.25rem;
  transition: color 0.15s, background 0.15s;
}

.snack-toast-close:hover {
  color: #374151;
  background: #f3f4f6;
}

.snack-toast-close:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

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

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

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

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

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

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

.snack-toast-info {
  border-left: 4px solid #6366f1;
}

.snack-toast-info .snack-toast-icon {
  background: #e0e7ff;
  color: #4f46e5;
}

/* Mobile Styles */
@media (max-width: 480px) {
  .snack-toast-container {
    top: auto;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
  }

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

  @keyframes snack-toast-enter {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes snack-toast-exit {
    from {
      opacity: 1;
      transform: translateY(0);
    }
    to {
      opacity: 0;
      transform: translateY(100%);
    }
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .snack-toast {
    animation: none;
  }

  .snack-toast-exit {
    animation: snack-toast-fade-exit 0.1s ease-out forwards;
  }

  @keyframes snack-toast-fade-exit {
    from { opacity: 1; }
    to { opacity: 0; }
  }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  .snack-toast {
    background: #1f2937;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }

  .snack-toast-message {
    color: #f9fafb;
  }

  .snack-toast-close {
    color: #6b7280;
  }

  .snack-toast-close:hover {
    color: #d1d5db;
    background: #374151;
  }

  .snack-toast-success .snack-toast-icon {
    background: #064e3b;
    color: #34d399;
  }

  .snack-toast-error .snack-toast-icon {
    background: #7f1d1d;
    color: #f87171;
  }

  .snack-toast-warning .snack-toast-icon {
    background: #78350f;
    color: #fbbf24;
  }

  .snack-toast-info .snack-toast-icon {
    background: #7C2D12;
    color: #FDBA74;
  }
}
