/* Global Toast Notification System Stylesheet */

/* Fixed Position Toast Container at Bottom-Right */
#global-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  max-width: 420px;
  width: calc(100vw - 48px);
}

/* Individual Toast Card - Dark Theme (#1a1a1f) */
.global-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background-color: #1a1a1f;
  color: #F3F4F6;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left-width: 4px;
  border-left-style: solid;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  line-height: 1.4;
  word-break: break-word;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.25s ease, transform 0.25s ease, margin-bottom 0.25s ease, max-height 0.25s ease;
  overflow: hidden;
}

/* Dynamic Left Border Colors per Type */
.global-toast-success,
.toast-success {
  border-left-color: #10B981 !important;
}

.global-toast-warning,
.toast-warning {
  border-left-color: #F59E0B !important;
}

.global-toast-error,
.toast-error {
  border-left-color: #EF4444 !important;
}

.global-toast-loading,
.toast-loading {
  border-left-color: #3B82F6 !important;
}

.global-toast-info,
.toast-info {
  border-left-color: #6366F1 !important;
}

/* Icon Container */
.global-toast-icon {
  font-size: 1.15rem;
  margin-top: 2px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Icon Colors */
.global-toast-success .global-toast-icon,
.toast-success .global-toast-icon {
  color: #10B981;
}

.global-toast-warning .global-toast-icon,
.toast-warning .global-toast-icon {
  color: #F59E0B;
}

.global-toast-error .global-toast-icon,
.toast-error .global-toast-icon {
  color: #EF4444;
}

.global-toast-loading .global-toast-icon,
.toast-loading .global-toast-icon {
  color: #3B82F6;
}

.global-toast-info .global-toast-icon,
.toast-info .global-toast-icon {
  color: #6366F1;
}

/* Content Body */
.global-toast-body {
  flex: 1;
  min-width: 0;
}

.global-toast-title {
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
  line-height: 1.3;
}

.global-toast-message {
  font-weight: 500;
  color: #E5E7EB;
  line-height: 1.4;
}

/* Close Button */
.toast-close,
.global-toast-close {
  background: transparent;
  border: none;
  color: #9CA3AF;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 4px;
  flex-shrink: 0;
  transition: color 0.15s ease, opacity 0.15s ease;
  opacity: 0.8;
}

.toast-close:hover,
.global-toast-close:hover {
  color: #FFFFFF;
  opacity: 1;
}

/* Exit Animation & Class */
.global-toast.hide,
.global-toast.toast-exit {
  opacity: 0;
  transform: translateX(100%);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-top-width: 0;
  border-bottom-width: 0;
  pointer-events: none;
}

/* Slide-In Entrance Keyframes */
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(120%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  #global-toast-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }
}
