.notification-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding-left: 1rem;
  scrollbar-width: none;
  pointer-events: none; /* Allow clicking through the container */
}

.notification-container > * {
  pointer-events: auto; /* Restore pointer events on children */
}

.notification-container.hidden {
  opacity: 0;
}

.notification-container.visible {
  opacity: 1;
}

.notification {
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  max-width: 24rem;
  width: 100%;
  color: white;
  border-left: 4px solid;
  transform-origin: center right;
  will-change: transform, opacity;
  backface-visibility: hidden;
  animation: notification-enter 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) backwards;
}

.notification p {
  margin: 0;
  flex-grow: 1;
  font-weight: 500;
  line-height: 1.5;
}

.notification--error {
  background-color: #ef4444;
  border-color: #b91c1c;
}

.notification--success {
  background-color: #22c55e;
  border-color: #15803d;
}

.notification--info {
  background-color: #3b82f6;
  border-color: #1d4ed8;
}

.notification--warning {
  background-color: #f59e0b;
  border-color: #b45309;
}

.notification__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0;
  line-height: 1;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin: -0.25rem -0.5rem 0 0;
  flex-shrink: 0;
}

.notification__close:hover {
  color: white;
  transform: scale(1.1);
}

.notification__close:active {
  transform: scale(0.95);
}

.notification.removing {
  animation:
    notification-exit 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    notification-fade 0.3s ease-out forwards;
}

@keyframes notification-enter {
  from {
    transform: translate3d(120%, 0, 0) scale(0.9);
    opacity: 0;
  }
  50% {
    transform: translate3d(-5%, 0, 0) scale(1.02);
  }
  to {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }
}

@keyframes notification-exit {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(120%, 0, 0) scale(0.9);
  }
}

@keyframes notification-fade {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
