:host(:not(:is([hydrated], .hydrated))) {
  @apply not-hydrated;
}


mds-button {
  &:not(:is([hydrated], .hydrated)) {
    @apply not-hydrated;
  }
}


/**
 * @prop --mds-push-notification-fadeout-delay: Public. Delay before the push notification starts fading out.
 * @prop --mds-push-notification-gap: Public. Gap between multiple push notifications.
 * @prop --mds-push-notification-items-intro-delay: Delay before items inside the notification animate in.
 * @prop --mds-push-notification-items-outro-delay: Delay before items inside the notification animate out.
 * @prop --mds-push-notification-items-duration: Duration of the item animation inside the notification.
 * @prop --mds-push-notification-items-gap: Gap between items inside the notification.
 * @prop --mds-push-notification-items-timing-function: Timing function used for item animations inside the notification.
 * @prop --mds-push-notification-background: Public. Background of the push notification, supports gradients.
 */

/* ❌ Not supported
@property --mds-push-notification-items-timing-function {
  inherits: false;
  initial-value: var(--ease-in-out-quint);
  syntax: "<timing-function>";
}
@property --mds-push-notification-background {
  inherits: false;
  initial-value: linear-gradient(to right, rgb(220 220 220 / 0) 0%, rgb(220 220 220 / 0.85) 100%);
  syntax: "<background>";
}
*/

:host {
  --mds-push-notification-fadeout-delay: 0s;
  --mds-push-notification-gap: --spacing(200);
  --mds-push-notification-items-intro-delay: var(--duration-300, 300ms);
  --mds-push-notification-items-outro-delay: 0ms;
  --mds-push-notification-items-duration: var(--duration-300, 300ms);
  --mds-push-notification-items-gap: var(--mds-push-notification-gap, --spacing(200));
  --mds-push-notification-items-timing-function: var(--ease-in-out-quint, cubic-bezier(0.86, 0, 0.07, 1));
  --mds-push-notification-background: linear-gradient(
    to right,
    rgb(var(--magma-surface-sunken, var(--surface-neutral-sunken, 235 235 235)) / 0) 0%,
    rgb(var(--magma-surface-sunken, var(--surface-neutral-sunken, 235 235 235)) / 0.85) 100%
  );

  @apply ease-in-out-expo
    hide-scrollbar;

  /* stylelint-disable-next-line property-disallowed-list */
  background: var(--mds-push-notification-background);
  bottom: 0;
  box-sizing: content-box !important;
  display: flex;
  flex-direction: column;
  gap: --spacing(200);
  max-width: --spacing(9000);
  min-width: --spacing(7200);
  overflow-x: hidden;
  padding: --spacing(400);
  padding-left: --spacing(2400);
  position: fixed;
  right: 0;
  top: 0;
  transform: translate(100%, 0);
  transition-delay: var(--mds-push-notification-fadeout-delay, 0s);
  transition-duration: var(--duration-500, 500ms);
  transition-property: transform;
  z-index: var(--magma-notification-z-index, 2000);
}

.notifications {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--mds-push-notification-items-gap);
}

.notifications ::slotted(mds-push-notification-item) {
  --mds-push-notification-item-duration: var(--mds-push-notification-items-duration, var(--duration-300, 300ms));
  --mds-push-notification-item-timing-function: var(--mds-push-notification-items-timing-function);

  position: absolute;
  transform: translate(
    calc(100% + calc(var(--mds-push-notification-gap, --spacing(200)) + var(--mds-push-notification-gap, --spacing(200)))),
    0
  );
  visibility: hidden;
}

/* Theme preference. The component reflects the resolved theme mode and scheme
 * from <html> onto its host as pref-mode + pref-theme-scheme (see
 * subscribePreference in @common/preference); these plain shadow selectors refine
 * for dark. `dark` is the explicit choice; `system` and no controller follow the
 * OS via @media; the scheme axis gates it. Cross-browser, no :host-context. */

:host([pref-mode='dark']:not([pref-theme-scheme='light'])),
:host([pref-theme-scheme='dark']) {
  --mds-push-notification-background: linear-gradient(
    to right,
    rgb(var(--magma-backdrop-color, 0 0 0) / 0) 0%,
    rgb(var(--magma-backdrop-color, 0 0 0) / 0.5) 20%,
    rgb(var(--magma-backdrop-color, 0 0 0) / 0.85) 100%
  );
}

@media (prefers-color-scheme: dark) {
  :host([pref-mode='system']:not([pref-theme-scheme='light'])),
  :host(:not([pref-mode]):not([pref-theme-scheme='light'])) {
    --mds-push-notification-background: linear-gradient(
      to right,
      rgb(var(--magma-backdrop-color, 0 0 0) / 0) 0%,
      rgb(var(--magma-backdrop-color, 0 0 0) / 0.5) 20%,
      rgb(var(--magma-backdrop-color, 0 0 0) / 0.85) 100%
    );
  }
}

:host([visible]) {
  transform: translate(0, 0);
  transition-delay: 0s;
}

