@import "tailwindcss";

@plugin "tailwindcss-animate";
@plugin "tailwindcss-react-aria-components";

@theme {
  --blur-xs: 2px;

  --height-editor: calc(100vh - 20rem);

  --font-sans: Inter, -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;

  --transition-duration-25: 25ms;
  --transition-duration-50: 50ms;

  /* Design tokens: border-radius */
  --radius-sm: 0.375rem; /* 6px — chips, badges, inline elements */
  --radius-md: 0.5rem; /* 8px — buttons, inputs, interactive controls */
  --radius-lg: 0.75rem; /* 12px — cards, panels, dialogs, popovers */

  /* Design tokens: box-shadow */
  --shadow-surface: 0 1px 2px 0 rgb(0 0 0 / 0.04), 0 1px 3px 0 rgb(0 0 0 / 0.06);
  --shadow-overlay: 0 4px 12px -2px rgb(0 0 0 / 0.08), 0 2px 6px -1px rgb(0 0 0 / 0.06);

  --animate-loading: loader 0.8s infinite ease-in-out;

  @keyframes loader {
    from {
      transform: translateX(-100%);
    }
    to {
      transform: translateX(100%);
    }
  }
}

@utility container {
  margin-inline: auto;
  padding-inline: 1rem;
  width: 100%;
  max-width: 96rem; /* 1536px - constrain on large displays */

  @media (width >= theme(--breakpoint-sm)) {
    padding-inline: 2rem;
  }
  @media (width >= theme(--breakpoint-lg)) {
    padding-inline: 4rem;
  }

  @media (width >= theme(--breakpoint-xl)) {
    padding-inline: 5rem;
  }

  @media (width >= theme(--breakpoint-2xl)) {
    padding-inline: 6rem;
  }
}

@supports (scrollbar-gutter: stable) {
  html {
    scrollbar-gutter: stable;
  }
}

.cm-merge-theme {
  height: 100% !important;
}

.cm-mergeView {
  height: 100% !important;
}

.cm-mergeViewEditors {
  height: 100%;
}

.cm-mergeViewEditor {
  height: 100% !important;
}

.toast-viewport {
  position: fixed;
  z-index: 50;
  bottom: 2rem;
  right: 1rem;
  left: auto;
  top: auto;
  width: 20rem;
}

.toast-root {
  --gap: 0.75rem;
  --peek: 0.75rem;
  --scale: calc(max(0, 1 - (var(--toast-index) * 0.1)));
  --shrink: calc(1 - var(--scale));
  --height: var(--toast-frontmost-height, var(--toast-height));
  --offset-y: calc(
    var(--toast-offset-y) * -1 + (var(--toast-index) * var(--gap) * -1) +
      var(--toast-swipe-movement-y)
  );

  position: absolute;
  right: 0;
  bottom: 0;
  left: auto;
  width: 100%;
  height: var(--height);
  z-index: calc(1000 - var(--toast-index));
  transform-origin: bottom center;
  user-select: none;

  transform: translateX(var(--toast-swipe-movement-x))
    translateY(
      calc(
        var(--toast-swipe-movement-y) - (var(--toast-index) * var(--peek)) -
          (var(--shrink) * var(--height))
      )
    )
    scale(var(--scale));

  transition:
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.5s,
    height 0.15s;

  &[data-expanded] {
    transform: translateX(var(--toast-swipe-movement-x)) translateY(var(--offset-y));
    height: var(--toast-height);
  }

  &[data-starting-style] {
    transform: translateY(150%);
  }

  &[data-ending-style] {
    opacity: 0;
    transform: translateY(150%);

    &[data-swipe-direction="up"] {
      transform: translateY(calc(var(--toast-swipe-movement-y) - 150%));
    }
    &[data-swipe-direction="down"] {
      transform: translateY(calc(var(--toast-swipe-movement-y) + 150%));
    }
    &[data-swipe-direction="left"] {
      transform: translateX(calc(var(--toast-swipe-movement-x) - 150%)) translateY(var(--offset-y));
    }
    &[data-swipe-direction="right"] {
      transform: translateX(calc(var(--toast-swipe-movement-x) + 150%)) translateY(var(--offset-y));
    }
  }

  &[data-limited] {
    opacity: 0;
  }

  /* Invisible hit area to bridge hover gap between toasts */
  &::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: calc(var(--gap) + 1px);
  }
}

.toast-content {
  overflow: hidden;
  transition: opacity 0.25s;

  &[data-behind] {
    opacity: 0;
  }

  &[data-expanded] {
    opacity: 1;
  }
}

/* Weirdest class name characters but ok */
.cm-mergeView .ͼ1 .cm-scroller,
.cm-mergeView .ͼ1 {
  height: 100% !important;
}
