import { cva } from "class-variance-authority";

/** Where the dialog sits in the viewport. */
export const modalVariants = cva("fixed inset-0 z-[99] flex", {
  variants: {
    position: {
      default: "items-center justify-center py-16 sm:py-8",
      top: "items-start justify-center pt-16 sm:pt-8",
      bottom: "items-end justify-center pb-16 sm:pb-8",
    },
  },
  defaultVariants: {
    position: "default",
  },
});

/**
 * The panel's width. `sm` and `md` are wider than their names suggest and both
 * carry `rounded-[30px]`, which `lg`/`xl`/`2xl` do not — they are the two sizes
 * the designs actually use, and the others are generic fallbacks.
 */
export const modalContentVariants = cva(
  "bg-white rounded-md shadow-lg relative overflow-hidden flex flex-col",
  {
    variants: {
      size: {
        sm: "w-full 2xl:w-[811px] lg:w-[811px] md:w-[811px] ml-5 mr-5 rounded-[30px]",
        md: "2xl:w-[1140px] lg:w-[1000px] md:w-[900px] w-full ml-5 mr-5 rounded-[30px]",
        lg: "w-full max-w-lg",
        xl: "w-full max-w-xl",
        "2xl": "w-full max-w-2xl",
        full: "w-full max-w-[95vw]",
        small: "w-[800px] ml-5 mr-5 rounded-[30px]",
      },
    },
    defaultVariants: {
      size: "md",
    },
  }
);
