/* PrimeTrainer portal shared toast */

.pt-shared-toast-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  width: min(360px, calc(100vw - 48px));
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.pt-shared-toast {
  position: relative;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: flex-start;
  min-height: 52px;
  padding: 14px 14px 14px 0;
  overflow: hidden;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0)),
    #101b2d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(210, 255, 31, 0.035);
  pointer-events: auto;
  animation: pt-shared-toast-in 220ms ease-out both;
}

.pt-shared-toast.is-leaving {
  animation: pt-shared-toast-out 220ms ease-in forwards;
}

.pt-shared-toast__marker {
  width: 4px;
  min-height: 100%;
  align-self: stretch;
  background: #d2ff1f;
  box-shadow: 0 0 16px rgba(210, 255, 31, 0.28);
}

.pt-shared-toast__message {
  min-width: 0;
  padding-top: 1px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

.pt-shared-toast__close {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  margin: -4px -4px 0 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.78);
  font: 700 16px/1 Arial, sans-serif;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.pt-shared-toast__close:hover,
.pt-shared-toast__close:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(210, 255, 31, 0.3);
  outline: none;
}

.pt-shared-toast--success,
.pt-shared-toast--info {
  background:
    linear-gradient(135deg, rgba(74, 158, 255, 0.16), rgba(74, 158, 255, 0.02)),
    #101b2d;
  border-color: rgba(74, 158, 255, 0.22);
}

.pt-shared-toast--success .pt-shared-toast__marker {
  background: #d2ff1f;
}

.pt-shared-toast--info .pt-shared-toast__marker {
  background: #4a9eff;
  box-shadow: 0 0 16px rgba(74, 158, 255, 0.28);
}

.pt-shared-toast--error {
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(239, 68, 68, 0.04)),
    #1d1017;
  border-color: rgba(239, 68, 68, 0.32);
}

.pt-shared-toast--error .pt-shared-toast__marker {
  background: #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.3);
}

.pt-shared-toast--warning {
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(245, 158, 11, 0.04)),
    #1e180d;
  border-color: rgba(245, 158, 11, 0.34);
}

.pt-shared-toast--warning .pt-shared-toast__marker {
  background: #f59e0b;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.3);
}

@keyframes pt-shared-toast-in {
  from {
    opacity: 0;
    transform: translate3d(28px, 8px, 0) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes pt-shared-toast-out {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(28px, 8px, 0) scale(0.98);
  }
}

@media (max-width: 640px) {
  .pt-shared-toast-container {
    right: 16px;
    bottom: 16px;
    left: 16px;
    width: auto;
  }

  .pt-shared-toast {
    grid-template-columns: 4px minmax(0, 1fr) auto;
    width: 100%;
    padding-right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pt-shared-toast,
  .pt-shared-toast.is-leaving {
    animation-duration: 1ms;
  }
}
