/* =========================================================
   TOAST NOTIFICATION SYSTEM
   ========================================================= */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  position: relative;
  min-width: 300px;
  max-width: 400px;
  padding: 16px 20px;
  border-radius: var(--fom-radius);
  box-shadow: var(--fom-shadow-lg);
  background: white;
  border: 1px solid var(--fom-border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.toast.hide {
  transform: translateX(120%);
  opacity: 0;
}

.toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.toast__content {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fom-gray-900);
  margin-bottom: 4px;
}

.toast__message {
  font-size: 0.875rem;
  color: var(--fom-gray-700);
  line-height: 1.4;
}

.toast__close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--fom-gray-400);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.toast__close:hover {
  color: var(--fom-gray-700);
}

.toast__close svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

/* Toast Types */
.toast--success {
  border-left: 4px solid var(--fom-success);
  background: linear-gradient(to right, rgba(16, 185, 129, 0.05), white);
}

.toast--success .toast__icon {
  color: var(--fom-success);
}

.toast--info {
  border-left: 4px solid var(--fom-secondary);
  background: linear-gradient(to right, rgba(59, 130, 246, 0.05), white);
}

.toast--info .toast__icon {
  color: var(--fom-secondary);
}

.toast--warning {
  border-left: 4px solid var(--fom-warning);
  background: linear-gradient(to right, rgba(245, 158, 11, 0.05), white);
}

.toast--warning .toast__icon {
  color: var(--fom-warning);
}

.toast--error {
  border-left: 4px solid var(--fom-danger);
  background: linear-gradient(to right, rgba(239, 68, 68, 0.05), white);
}

.toast--error .toast__icon {
  color: var(--fom-danger);
}

/* Progress bar */
.toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 0 0 var(--fom-radius) var(--fom-radius);
  overflow: hidden;
}

.toast__progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left;
  animation: progress linear forwards;
}

.toast--success .toast__progress-bar {
  background: var(--fom-success);
}

.toast--info .toast__progress-bar {
  background: var(--fom-secondary);
}

.toast--warning .toast__progress-bar {
  background: var(--fom-warning);
}

.toast--error .toast__progress-bar {
  background: var(--fom-danger);
}

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

/* Responsive */
@media (max-width: 768px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    align-items: stretch;
  }
  
  .toast {
    min-width: auto;
    max-width: none;
    width: 100%;
  }
}

/* Optional: Stacking toasts with different delays */
.toast:nth-child(1) { z-index: 4; }
.toast:nth-child(2) { z-index: 3; }
.toast:nth-child(3) { z-index: 2; }
.toast:nth-child(4) { z-index: 1; }
