/**
 * Glamorgan flash alerts + toast stack (overrides legacy cake.css floating bars).
 *
 * /home/fnjiaga/projects/CAS-UK/webroot/css/glamorgan-notifications.css
 * v1.0
 */

/* Neutralise legacy CakePHP flash bar inside Glamorgan hosts */
.glamorgan-flash .message,
.glamorgan-flash .casuk-flash-alert,
.member-tw-flash .message,
.member-tw-flash .casuk-flash-alert,
.ga-tw-flash .message,
.ga-tw-flash .casuk-flash-alert,
.admin-auth-flash .message,
.admin-auth-flash .casuk-flash-alert,
.public-auth-flash .message,
.public-auth-flash .casuk-flash-alert {
  position: static !important;
  top: auto !important;
  right: auto !important;
  z-index: auto !important;
  display: flex !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: inherit !important;
  text-align: left !important;
  overflow: visible !important;
  cursor: default !important;
  font-weight: 600 !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) !important;
}

.glamorgan-flash .message:before,
.glamorgan-flash .casuk-flash-alert:before,
.member-tw-flash .message:before,
.ga-tw-flash .message:before,
.admin-auth-flash .message:before,
.public-auth-flash .message:before {
  content: none !important;
  display: none !important;
}

.glamorgan-flash .message.hidden,
.casuk-flash-alert--dismissed {
  opacity: 0;
  transform: translateY(-4px);
  max-height: 0;
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
  overflow: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.25s ease, margin 0.25s ease;
}

/* Toast stack — top-right on desktop, full-width inset on narrow screens */
.casuk-toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(24rem, calc(100vw - 2rem));
  pointer-events: none;
}

.casuk-toast-stack .casuk-flash-alert {
  pointer-events: auto;
  margin-bottom: 0 !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12) !important;
  animation: casuk-toast-in 0.28s ease-out;
}

@keyframes casuk-toast-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 455px) {
  .casuk-toast-stack {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
  }
}

.casuk-flash-dismiss {
  flex-shrink: 0;
}

.casuk-flash-alert .min-w-0 {
  min-width: 0;
}
