/* file: public/assets/css/components.css */

/* Toast & modal responsive + stacking fixes */
@keyframes toast-slide-in-right {
  from {
    transform: translateX(12px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toast-slide-out-right {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(12px);
    opacity: 0;
  }
}

@keyframes toast-slide-in-up {
  from {
    transform: translateY(12px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toast-slide-out-up {
  from {
    transform: translateY(0);
    opacity: 1;
  }

  to {
    transform: translateY(12px);
    opacity: 0;
  }
}

#toast-container {
  position: fixed;
  z-index: 45;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100% - 32px);
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 14px;
  line-height: 1.2;
  width: 380px;
  max-width: calc(100vw - 40px);
}

.toast .icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.toast-success {
  background: linear-gradient(180deg, #16a34a, #15803d);
}

.toast-error {
  background: linear-gradient(180deg, #dc2626, #b91c1c);
}

.toast-info {
  background: linear-gradient(180deg, #4f46e5, #4338ca);
}

.toast-enter {
  animation: toast-slide-in-right 360ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.toast-leave {
  animation: toast-slide-out-right 300ms cubic-bezier(0.4, 0.9, 0.4, 1) both;
}

@media (max-width: 768px) {
  #toast-container {
    left: 50%;
    right: auto;
    top: auto;
    bottom: 16px;
    transform: translateX(-50%);
    align-items: center;
    width: calc(100% - 32px);
  }

  .toast {
    width: 100%;
    max-width: 720px;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
  }

  .toast-enter {
    animation: toast-slide-in-up 360ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
  }

  .toast-leave {
    animation: toast-slide-out-up 300ms cubic-bezier(0.4, 0.9, 0.4, 1) both;
  }
}

.toast-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.toast-close:active {
  transform: scale(0.98);
}
