/* Toast Notification Container */
#toast-container {
  position: fixed;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  top: 1.25rem;
  right: 1.25rem;
  max-width: 22rem;
  width: calc(100% - 2.5rem);
}

@media (max-width: 640px) {
  #toast-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    width: calc(100% - 2rem);
    max-width: 100%;
  }
}

/* Toast Item (Flat Modern, No Exaggerated Shadows/Borders) */
.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-radius: 0.5rem;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0;
  transform: translateY(-0.5rem);
}

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

.toast-item.toast-hide {
  opacity: 0;
  transform: translateY(-0.5rem);
}

/* Dark Mode Flat Container */
.dark .toast-item {
  background-color: #0d131f;
  border-color: #1e293b;
  color: #f8fafc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Status Icon Wrapper */
.toast-icon-wrapper {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.0625rem;
}

.toast-success .toast-icon-wrapper {
  background-color: #ecfdf5;
  color: #059669;
}
.dark .toast-success .toast-icon-wrapper {
  background-color: rgba(5, 150, 105, 0.15);
  color: #34d399;
}

.toast-error .toast-icon-wrapper {
  background-color: #fef2f2;
  color: #dc2626;
}
.dark .toast-error .toast-icon-wrapper {
  background-color: rgba(220, 38, 38, 0.15);
  color: #f87171;
}

.toast-warning .toast-icon-wrapper {
  background-color: #fffbeb;
  color: #d97706;
}
.dark .toast-warning .toast-icon-wrapper {
  background-color: rgba(217, 119, 6, 0.15);
  color: #fbbf24;
}

.toast-info .toast-icon-wrapper {
  background-color: #eff6ff;
  color: #2563eb;
}
.dark .toast-info .toast-icon-wrapper {
  background-color: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
}

.toast-icon-svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* Toast Content */
.toast-content {
  flex-grow: 1;
  min-width: 0;
  padding-top: 0.0625rem;
}

.toast-title {
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: #0f172a;
}
.dark .toast-title {
  color: #f8fafc;
}

.toast-message {
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.4;
  margin-top: 0.125rem;
  word-break: break-word;
}
.dark .toast-message {
  color: #94a3b8;
}

/* Toast Close Button */
.toast-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background-color 0.15s ease;
  margin-top: -0.125rem;
  margin-right: -0.25rem;
}

.toast-close:hover {
  color: #0f172a;
  background-color: #f1f5f9;
}
.dark .toast-close:hover {
  color: #f8fafc;
  background-color: #1e293b;
}

.toast-close svg {
  width: 0.75rem;
  height: 0.75rem;
}
