/* Toast Notification Styles */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  max-width: 420px;
  pointer-events: none;
}

.toast {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  pointer-events: auto;
  animation: toastSlideIn 0.3s ease-out;
  border-left: 4px solid #3498db;
  position: relative;
  overflow: hidden;
}

.toast.toast-success {
  border-left-color: #27ae60;
}

.toast.toast-error {
  border-left-color: #e74c3c;
}

.toast.toast-info {
  border-left-color: #3498db;
}

.toast.toast-warning {
  border-left-color: #f39c12;
}

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

.toast.toast-success .toast-icon {
  color: #27ae60;
}

.toast.toast-error .toast-icon {
  color: #e74c3c;
}

.toast.toast-info .toast-icon {
  color: #3498db;
}

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

.toast-loading {
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: toastSpin 1s linear infinite;
  flex-shrink: 0;
}

.toast.toast-success .toast-loading {
  border-top-color: #27ae60;
}

.toast.toast-error .toast-loading {
  border-top-color: #e74c3c;
}

.toast.toast-info .toast-loading {
  border-top-color: #3498db;
}

.toast.toast-warning .toast-loading {
  border-top-color: #f39c12;
}

.toast-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.toast-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
  color: #2c3e50;
  line-height: 1.3;
}

.toast-message {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  word-wrap: break-word;
}

.toast-close {
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  padding: 0;
  margin-left: 8px;
  color: #555;
  font-size: 16px;
  line-height: 0;
  font-weight: 400;
  opacity: 0.7;
  transition: all 0.2s ease;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  position: relative;
}

.toast-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
  width: 100%;
  transform-origin: left;
  animation: toastProgress linear;
}

.toast.toast-success .toast-progress {
  background: rgba(39, 174, 96, 0.3);
}

.toast.toast-error .toast-progress {
  background: rgba(231, 76, 60, 0.3);
}

.toast.toast-info .toast-progress {
  background: rgba(52, 152, 219, 0.3);
}

.toast.toast-warning .toast-progress {
  background: rgba(243, 156, 18, 0.3);
}

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

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

@keyframes toastSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

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

.toast.toast-sliding-out {
  animation: toastSlideOut 0.3s ease-in forwards;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  .toast {
    background: #2c3e50;
    color: #ecf0f1;
  }

  .toast-title {
    color: #ecf0f1;
  }

  .toast-message {
    color: #bdc3c7;
  }

  .toast-close {
    color: #95a5a6;
  }
}

/* Responsive */
@media (max-width: 480px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}
