/* Floating Toast Notifications */

.toast-container {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  z-index: 9999 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  pointer-events: none !important;
  max-width: 420px !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}

.toast {
  background: white !important;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid #e5e7eb !important;
  min-width: 320px;
  max-width: 420px;
  overflow: hidden;
  pointer-events: auto;
  transform: translateX(100%);
  animation: slideInRight 0.3s ease-out forwards;
}

.toast-header {
  display: flex;
  align-items: center;
  padding: 12px 16px 8px 16px !important;
  gap: 8px;
  margin: 0 !important;
}

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

.toast-title {
  font-weight: 600 !important;
  font-size: 14px !important;
  flex-grow: 1;
  color: #1f2937 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.toast-close {
  background: none !important;
  border: none !important;
  padding: 4px !important;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  color: #6b7280 !important;
  flex-shrink: 0;
}

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

.toast-body {
  padding: 0 16px 16px 44px !important;
  font-size: 14px;
  line-height: 1.5;
  color: #4b5563 !important;
  margin: 0 !important;
}

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

.toast-success .toast-icon {
  color: #10b981;
}

.toast-success .toast-title {
  color: #065f46;
}

/* Error/Danger Toast */
.toast-error,
.toast-danger {
  border-left: 4px solid #ef4444;
}

.toast-error .toast-icon,
.toast-danger .toast-icon {
  color: #ef4444;
}

.toast-error .toast-title,
.toast-danger .toast-title {
  color: #7f1d1d;
}

/* Warning Toast */
.toast-warning {
  border-left: 4px solid #f59e0b;
}

.toast-warning .toast-icon {
  color: #f59e0b;
}

.toast-warning .toast-title {
  color: #78350f;
}

/* Info Toast */
.toast-info {
  border-left: 4px solid #3b82f6;
}

.toast-info .toast-icon {
  color: #3b82f6;
}

.toast-info .toast-title {
  color: #1e3a8a;
}

/* Animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast.hiding {
  animation: slideOutRight 0.3s ease-in forwards;
}

/* Dark theme support */
[data-theme="dark"] .toast {
  background: #374151;
  border-color: #4b5563;
}

[data-theme="dark"] .toast-title {
  color: #f9fafb;
}

[data-theme="dark"] .toast-body {
  color: #d1d5db;
}

[data-theme="dark"] .toast-close {
  color: #9ca3af;
}

[data-theme="dark"] .toast-close:hover {
  background-color: #4b5563;
  color: #f3f4f6;
}

[data-theme="dark"] .toast-success .toast-title {
  color: #6ee7b7;
}

[data-theme="dark"] .toast-error .toast-title,
[data-theme="dark"] .toast-danger .toast-title {
  color: #fca5a5;
}

[data-theme="dark"] .toast-warning .toast-title {
  color: #fcd34d;
}

[data-theme="dark"] .toast-info .toast-title {
  color: #93c5fd;
}

/* Responsive design */
@media (max-width: 480px) {
  .toast-container {
    left: 20px;
    right: 20px;
    bottom: 20px;
  }
  
  .toast {
    min-width: unset;
    max-width: 100%;
  }
  
  .toast-body {
    padding-left: 16px;
  }
}

/* Auto-hide progress bar (optional) */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.3;
  transform-origin: left;
  animation: progressBar 5s linear forwards;
}

@keyframes progressBar {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}
