/* ========== TOAST NOTIFICATIONS - Purple Gradient Theme ========== */

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 1rem;
  pointer-events: none;
  max-width: 420px;
}

/* Individual Toast */
.toast {
  position: relative;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 1px rgba(139, 92, 246, 0.3);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  transform: translateX(calc(100% + 50px));
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: auto;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

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

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

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

.toast-success .toast-icon {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
  color: #10b981;
}

.toast-error .toast-icon {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
  color: #ef4444;
}

.toast-warning .toast-icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.2));
  color: #f59e0b;
}

.toast-info .toast-icon {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(124, 58, 237, 0.2));
  color: #8b5cf6;
}

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

.toast-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.toast-message {
  font-size: 0.875rem;
  color: #cbd5e1;
  line-height: 1.5;
  word-wrap: break-word;
}

/* Toast Close Button */
.toast-close {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #94a3b8;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 300;
  transition: all 0.2s ease;
  line-height: 1;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  transform: scale(1.1);
}

.toast-close:active {
  transform: scale(0.95);
}

/* Toast Progress Bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
  transform-origin: left;
}

.toast-success .toast-progress {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.toast-error .toast-progress {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.toast-warning .toast-progress {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.toast-info .toast-progress {
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

/* Progress Animation */
@keyframes progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* Toast Variants with Border Accent */
.toast-success {
  border-left: 3px solid #10b981;
}

.toast-error {
  border-left: 3px solid #ef4444;
}

.toast-warning {
  border-left: 3px solid #f59e0b;
}

.toast-info {
  border-left: 3px solid #8b5cf6;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .toast-container {
    right: 15px;
    left: 15px;
    max-width: none;
    bottom: 15px;
  }

  .toast {
    max-width: none;
    padding: 0.875rem 1rem;
  }

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

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

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

  .toast-close {
    width: 24px;
    height: 24px;
    font-size: 1.1rem;
  }
}

/* Accessibility */
.toast[role="alert"] {
  outline: none;
}

.toast:focus-within {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6),
              0 0 0 2px rgba(139, 92, 246, 0.5),
              0 0 1px rgba(139, 92, 246, 0.3);
}

/* Loading State (if needed) */
.toast.loading .toast-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
