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

export const cardWrapper = cva(
  [
    'tw-p-8',
    'tw-rounded-2xl',
    'tw-flex',
    'tw-flex-col',
    'tw-gap-4',
    'tw-transition-all',
    'tw-duration-100',
    'tw-ease-in-out',
    'tw-relative',
    'tw-group',
  ],
  {
    variants: {
      type: {
        standard: [
          'tw-bg-gray-900',
          'tw-border-solid',
          'tw-border-2',
          'tw-border-common-transparent',
          'tw-border-b-purple-400',
          'hover:tw-border-purple-400',
          'hover:tw-bg-gradient-radial-purple',
        ],
        gradient: [],
        image: ['tw-bg-common-black', 'tw-bg-opacity-100', 'tw-backdrop-blur-0'],
        cta: [],
        blog: ['tw-p-0'],
      },
      backgroundGradient: {
        none: [],
        pink: [
          'tw-bg-gradient-black-pink',
          'hover:tw-bg-gradient-black-pink-hover',
          'tw-border-solid',
          'tw-border-2',
          'tw-border-common-black',
          'tw-border-b-pink-200',
          'hover:tw-border-pink-200',
        ],
        purple: [
          'tw-bg-gradient-black-purple',
          'hover:tw-bg-gradient-black-purple-hover',
          'tw-border-solid',
          'tw-border-2',
          'tw-border-common-black',
          'tw-border-b-lightPurple-100',
          'hover:tw-border-lightPurple-100',
        ],
        blue: [
          'tw-bg-gradient-black-blue',
          'hover:tw-bg-gradient-black-blue-hover',
          'tw-border-solid',
          'tw-border-2',
          'tw-border-common-black',
          'tw-border-b-blue-100',
          'hover:tw-border-blue-100',
        ],
        green: [
          'tw-bg-gradient-black-green',
          'hover:tw-bg-gradient-black-green-hover',
          'tw-border-solid',
          'tw-border-2',
          'tw-border-common-black',
          'tw-border-b-green-400',
          'hover:tw-border-green-400',
        ],
      },
      featured: {
        imageFeatured: ['tw-mb-7', 'tw-invisible', 'tw-hidden', 'sm:tw-visible', 'sm:tw-flex'],
        imageStandard: ['tw-h-[300px]', 'tw-justify-end'],
      },
      hiddenOnDesktop: {
        true: ['tw-visible', 'tw-block', 'sm:tw-invisible', 'sm:tw-hidden'],
        false: [],
      },
    },
  }
);

export const eyebrowStyles = cva([], {
  variants: {
    type: {
      standard: [
        'tw-tracking-wide',
        'tw-font-mono',
        'tw-text-sm',
        'tw-uppercase',
        'tw-font-diatype',
        'tw-text-purple-500',
      ],
      gradient: [
        'tw-tracking-wide',
        'tw-font-mono',
        'tw-text-sm',
        'tw-uppercase',
        'tw-font-diatype',
        'tw-text-purple-500',
      ],
      image: [
        'tw-w-max',
        'tw-rounded-2xl',
        'tw-p-2',
        'tw-font-mono',
        'tw-text-xs',
        'tw-uppercase',
        'tw-font-light',
        'tw-bg-purple-500',
      ],
      cta: ['tw-tracking-wide', 'tw-font-mono', 'tw-text-sm', 'tw-uppercase', 'tw-text-purple-500'],
      blog: ['tw-tracking-wide', 'tw-uppercase', 'tw-text-sm', '!tw-text-common-white'],
    },
  },
});

export const headingStyles = cva([], {
  variants: {
    type: {
      standard: ['tw-font-light', 'tw-text-display-sm'],
      gradient: ['tw-font-light', 'tw-text-display-md'],
      image: ['tw-font-bold', 'tw-text-display-sm'],
      cta: ['tw-font-light', 'tw-text-display-xs', 'md:tw-text-display-sm'],
      blog: [
        'tw-font-bold',
        'tw-text-display-sm',
        'group-hover:tw-text-common-transparent',
        'group-hover:tw-bg-clip-text',
        'group-hover:tw-bg-gradient-two',
        'tw-line-clamp-2',
        'tw-h-[66px]'
      ],
    },
    featured: {
      imageFeatured: ['tw-text-display-md'],
      imageStandard: ['tw-text-display-sm'],
    },
  },
});

export const bodyStyles = cva([], {
  variants: {
    type: {
      standard: ['tw-text-md', 'tw-text-gray-300'],
      gradient: ['tw-text-md', 'tw-text-common-white'],
      image: ['tw-text-common-white', 'tw-text-lg'],
      cta: ['tw-text-gray-300', 'tw-text-lg'],
      blog: ['tw-text-md', 'tw-text-common-white', 'tw-line-clamp-2', 'tw-mb-4', 'tw-h-12'],
    },
  },
});

export const headingRow = cva(['tw-flex', 'tw-justify-between'], {
  variants: {
    type: {
      standard: ['tw-flex-row'],
      gradient: ['tw-flex-row'],
      image: ['tw-flex-row'],
      cta: [
        'tw-pb-4',
        'tw-border-white',
        'tw-border-solid',
        'tw-border-b-2',
        'tw-flex-col',
        'tw-gap-2',
        'md:tw-gap-0',
        'md:tw-flex-row',
      ],
      blog: ['tw-flex-row'],
    },
  },
});

export const imageWrapper = cva([], {
  variants: {
    type: {
      standard: [],
      gradient: [],
      image: [],
      cta: [],
      blog: ['tw-relative', 'tw-h-[215px]'],
    },
  },
});

export const imageOverlay = cva([
  'group-hover:tw-opacity-0',
  '-tw-z-10',
  'tw-absolute',
  'tw-inset-0',
  'tw-w-full',
  'tw-h-full',
  'tw-bg-gradient-black-card',
  'tw-transition-all',
  'tw-duration-100',
  'tw-ease-in-out',
  'tw-opacity-100',
]);

export default cardWrapper;
