import { Font, StyleSheet } from '@react-pdf/renderer';

export const PDF_BRAND_LABEL = 'azopus.hu';

export const pdfColors = {
  accent: '#b8dadd',
  body: '#4b5563',
  border: '#e5e7eb',
  gold: '#dfcf6d',
  heading: '#111827',
  logo: '#3b3f59',
  muted: '#6b7280',
  panelBackground: '#f8fafc',
  panelBorder: '#dbe3ec',
  strongBorder: '#1f2937',
  subtle: '#9ca3af',
  text: '#1f2937',
  textMuted: '#374151',
  white: '#ffffff',
} as const;

Font.register({
  family: 'Roboto',
  fonts: [
    {
      src: '/fonts/roboto/Roboto-Regular.ttf',
      fontWeight: 'normal',
    },
    {
      src: '/fonts/roboto/Roboto-Bold.ttf',
      fontWeight: 'bold',
    },
  ],
});

export const pdfStyles = StyleSheet.create({
  page: {
    padding: 35,
    fontFamily: 'Roboto',
    color: pdfColors.text,
  },
  header: {
    marginBottom: 18,
    paddingBottom: 14,
    borderBottomWidth: 1.5,
    borderBottomColor: pdfColors.panelBorder,
    flexDirection: 'row',
    alignItems: 'flex-start',
  },
  headerLogo: {
    width: 80,
    height: 18,
  },
  headerContent: {
    flex: 1,
    paddingRight: 18,
  },
  headerTitle: {
    fontSize: 20,
    fontWeight: 'bold',
    lineHeight: 1.1,
    color: pdfColors.heading,
  },
  headerSubtitle: {
    marginTop: 5,
    fontSize: 12,
    lineHeight: 1.3,
    color: pdfColors.muted,
    fontWeight: 'semibold',
  },
  headerRight: {
    width: 92,
    alignItems: 'flex-end',
  },
  headerSite: {
    marginTop: 5,
    fontSize: 10,
    fontWeight: 'bold',
    color: pdfColors.logo,
    textAlign: 'right',
  },
  headerMeta: {
    marginTop: 5,
    fontSize: 8,
    color: pdfColors.subtle,
    textAlign: 'right',
  },
  documentTitle: {
    marginBottom: 12,
    paddingTop: 6,
    paddingRight: 8,
    paddingBottom: 6,
    borderBottomWidth: 0.75,
    borderBottomColor: pdfColors.panelBorder,
    fontSize: 16,
    fontWeight: 'bold',
    letterSpacing: 0.6,
    textTransform: 'uppercase',
    color: pdfColors.heading,
  },
  contentBlock: {
    marginBottom: 12,
    paddingTop: 10,
    paddingRight: 12,
    paddingBottom: 10,
    paddingLeft: 12,
    borderWidth: 0.75,
    borderColor: pdfColors.panelBorder,
    borderLeftWidth: 4,
    borderLeftColor: pdfColors.accent,
  },
  contentHeader: {
    marginBottom: 8,
    flexDirection: 'row',
    justifyContent: 'space-between',
    alignItems: 'center',
  },
  contentTitleWrap: {
    flex: 1,
    paddingRight: 10,
  },
  contentTitle: {
    fontSize: 13,
    fontWeight: 'semibold',
    lineHeight: 1.25,
    color: pdfColors.heading,
  },
  contentSubtitle: {
    marginBottom: 10,
    fontSize: 11,
    fontWeight: 'semibold',
    lineHeight: 1.25,
    color: pdfColors.textMuted,
  },
  item: {
    marginBottom: 7,
    paddingTop: 6,
    paddingRight: 8,
    paddingBottom: 6,
    paddingLeft: 8,
    borderBottomWidth: 0.5,
    borderBottomColor: pdfColors.panelBorder,
    // backgroundColor: pdfColors.gold + '10',
  },
  itemDate: {
    marginBottom: 4,
    fontSize: 10,
    fontWeight: 'bold',
    color: pdfColors.textMuted,
  },
  itemTitle: {
    fontSize: 11,
    lineHeight: 1.25,
    color: pdfColors.heading,
  },
  itemMeta: {
    marginTop: 3,
    fontSize: 9,
    color: pdfColors.muted,
  },
  bodyText: {
    marginBottom: 5,
    fontSize: 10,
    lineHeight: 1.3,
    color: pdfColors.body,
  },
  label: {
    fontWeight: 'bold',
    color: pdfColors.textMuted,
  },
  link: {
    color: pdfColors.heading,
    textDecoration: 'underline',
    fontWeight: 'bold',
  },
});
