/**
 * Toast Notification System - Styles
 * Modern, responsive toast notifications
 */

/* Toast Container */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 11000;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 48px);
  width: 420px;
  max-width: 420px;
  min-width: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  /* Hide scrollbars */
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Ensure proper containment */
  contain: layout style paint;
  box-sizing: border-box;
}

/* Hide scrollbar for Chrome, Safari and Opera */
#toast-container::-webkit-scrollbar {
  display: none;
}

/* Toast animations */
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(400px) rotateZ(5deg);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotateZ(0deg);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) rotateZ(0deg);
  }
  to {
    opacity: 0;
    transform: translateX(400px) rotateZ(5deg);
  }
}

/* Individual toast styles */
.autoaid-toast {
  animation: toastSlideIn 0.3s ease-out forwards !important;
}

.autoaid-toast-success {
  border-left-color: #52c41a;
  background-color: #f6ffed !important;
}

.autoaid-toast-error {
  border-left-color: #dc2626;
  background-color: #fee2e2 !important;
  color: #991b1b !important;
}

.autoaid-toast-error i {
  color: #dc2626 !important;
}

.autoaid-toast-warning {
  border-left-color: #faad14;
  background-color: #fffbe6 !important;
}

.toast-info {
  border-left-color: #0066ff;
  background-color: #e6f7ff !important;
}

/* Toast hover effect */
.autoaid-toast:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  #toast-container {
    top: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
    width: calc(100vw - 32px);
  }

  .autoaid-toast {
    min-width: auto !important;
    max-width: 100% !important;
    width: 100% !important;
    font-size: 13px;
    padding: 14px 14px !important;
  }

  .toast-error {
    color: #991b1b !important;
  }
}

@media (max-width: 480px) {
  #toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
    width: calc(100vw - 24px);
    max-width: none;
  }

  .autoaid-toast {
    width: 100% !important;
    max-width: 100% !important;
    min-width: auto !important;
    font-size: 12px;
    padding: 12px 12px !important;
    gap: 8px !important;
  }

  .autoaid-toast i {
    font-size: 14px !important;
  }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  .toast {
    color: #f5f5f5;
  }

  .toast-success {
    background-color: #162312;
    border-left-color: #52c41a;
  }

  .toast-error {
    background-color: #2f1515;
    border-left-color: #ff4d4f;
  }

  .toast-warning {
    background-color: #332b1b;
    border-left-color: #faad14;
  }

  .toast-info {
    background-color: #0a1f35;
    border-left-color: #0066ff;
  }
}

/* Stacking animation for multiple toasts */
.toast:nth-child(2) {
  animation-delay: 0.1s;
}

.toast:nth-child(3) {
  animation-delay: 0.2s;
}

.toast:nth-child(4) {
  animation-delay: 0.3s;
}

.toast:nth-child(n+5) {
  animation-delay: 0.4s;
}
