/**
 * Toast Notification System Styles
 * Non-intrusive, stackable notifications
 */

/* Container */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 420px;
}

/* Toast */
.toast {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.toast.toast-hide {
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  transition: all 0.3s ease;
}

/* Toast Types */
.toast-success {
  border-left: 4px solid #4caf50;
}

.toast-error {
  border-left: 4px solid #f44336;
}

.toast-warning {
  border-left: 4px solid #ff9800;
}

.toast-info {
  border-left: 4px solid #2196f3;
}

/* Icon */
.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: bold;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  background: #e8f5e9;
  color: #4caf50;
}

.toast-error .toast-icon {
  background: #ffebee;
  color: #f44336;
}

.toast-warning .toast-icon {
  background: #fff3e0;
  color: #ff9800;
}

.toast-info .toast-icon {
  background: #e3f2fd;
  color: #2196f3;
}

/* Content */
.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-message {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #333;
  word-wrap: break-word;
}

/* Action Button */
.toast-action {
  background: none;
  border: none;
  color: #009b3a;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toast-action:hover {
  background: rgba(0, 155, 58, 0.1);
}

/* Close Button */
.toast-close {
  background: none;
  border: none;
  color: #999;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  flex-shrink: 0;
  line-height: 1;
}

.toast-close:hover {
  background: #f5f5f5;
  color: #333;
}

/* Progress Bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transition: width linear;
}

.toast-success .toast-progress {
  background: #4caf50;
}

.toast-error .toast-progress {
  background: #f44336;
}

.toast-warning .toast-progress {
  background: #ff9800;
}

.toast-info .toast-progress {
  background: #2196f3;
}

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

  .toast {
    padding: 14px 16px;
    min-height: 50px;
  }

  .toast-icon {
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
  }

  .toast-message {
    font-size: 0.9rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
  }
}

/* Stack limit - fade older toasts */
.toast-container .toast:nth-child(n + 4) {
  opacity: 0.6;
  transform: scale(0.95) translateY(-10px);
}

.toast-container .toast:nth-child(n + 5) {
  display: none;
}
