@reference 'tailwindcss';

:host {
  --emr-drawer-transition-duration: 150ms;
  --emr-drawer-transition: cubic-bezier(.4,0,.2,1);

  display: block;

  .drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: color-mix(in oklab, var(--color-black) 32%, transparent);
    opacity: 0;
    visibility: hidden;
    z-index: 1030;
  }

  .drawer-container {
    position: fixed;
    z-index: 1040;
    top: 0;
    right: 0;
    max-width: 90vw;
    bottom: 0;
    transform: translateX(100%);
    visibility: hidden;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
  }

  .drawer-content {
    background-color: var(--mat-dialog-container-color);
    margin: --spacing(7);
    flex-grow: 1;
    box-shadow: var(--mat-dialog-container-elevation-shadow, none);
    border-radius: var(--mat-dialog-container-shape);
    overflow: hidden;
  }

  .drawer-backdrop:not(.open) {
    transition: opacity var(--emr-drawer-transition-duration) var(--emr-drawer-transition), visibility 0s linear var(--emr-drawer-transition-duration);
  }

  .drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--emr-drawer-transition-duration) var(--emr-drawer-transition), visibility 0s linear 0s;
  }

  .drawer-container:not(.open) {
    transition: transform 0.2s var(--emr-drawer-transition), visibility 0s linear 0.2s;
  }

  .drawer-container.open {
    transform: translateX(0%);
    visibility: visible;
    transition: transform 0.2s var(--emr-drawer-transition), visibility 0s linear 0s;
  }

  &.no-backdrop {
    .drawer-content {
      box-shadow: theme(--shadow-lg);
      border: 1px solid var(--color-surface-container-highest);
    }
  }
}
