/** css/components/toast.css **/

#alertContainer {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 9999;
  width: 600px;
  max-width: 90%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  pointer-events: none;
}

.alert-toast {
  color: #fff;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  animation: toast-slide-in-right 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.alert-toast .alert-icon {
  font-size: 1.25rem;
}

.alert-toast .alert-message {
  flex-grow: 1;
}

.alert-close-btn {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 0 0 0 1rem;
}

.alert-close-btn:hover {
  opacity: 1;
}

.alert-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.25);
  transform-origin: left;
  transform: scaleX(1);
}

.alert-toast.alert-success {
  background-color: #28a745;
}
.alert-toast.alert-error {
  background-color: #dc3545;
}
.alert-toast.alert-info {
  background-color: #0dcaf0;
}
.alert-toast.alert-warning {
  background-color: #ffc107;
  color: #1e293b;
}

.alert-toast.alert-warning .alert-progress-bar {
  background-color: rgba(255, 255, 255, 0.35);
}

.alert-toast.animate-fade-out {
  animation: toast-fade-out-right 0.4s ease-out forwards;
}

.alert-toast.animate-swipe-out {
  animation: toast-swipe-out-right 0.4s ease-out forwards;
}

@keyframes toast-slide-in-right {
  from {
    transform: translateX(120%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes toast-fade-out-right {
  to {
    opacity: 0;
    transform: translateX(50px);
  }
}

@keyframes toast-swipe-out-right {
  to {
    opacity: 0;
    transform: translateX(120%);
  }
}

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