@import "tailwindcss";
@import "@fontsource/lato/400.css";
@import "@fontsource/lato/700.css";

@custom-variant dark (&:is(.dark *));

:root {
  --font-size: 16px;
  --font-family: 'Lato', sans-serif;
  
  /* Custom color palette */
  --background: #F4F7F9;
  --foreground: #252525;
  --card: #ffffff;
  --card-foreground: #252525;
  --popover: #ffffff;
  --popover-foreground: #252525;
  --primary: #FF3C28;
  --primary-foreground: #ffffff;
  --secondary: #ffffff;
  --secondary-foreground: #252525;
  --muted: #F4F7F9;
  --muted-foreground: #646C84;
  --accent: #F4F7F9;
  --accent-foreground: #252525;
  --destructive: #BE0A14;
  --destructive-foreground: #ffffff;
  --success: #3E7F24;
  --success-foreground: #ffffff;
  --info: #0288D1;
  --info-foreground: #ffffff;
  --border: #DCE6EB;
  --input: transparent;
  --input-background: #ffffff;
  --switch-background: #DCE6EB;
  --font-weight-medium: 700;
  --font-weight-normal: 400;
  --ring: #FF3C28;
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --radius: 0rem;
}

.dark {
  --background: #252525;
  --foreground: #F4F7F9;
  --card: #252525;
  --card-foreground: #F4F7F9;
  --popover: #252525;
  --popover-foreground: #F4F7F9;
  --primary: #FF3C28;
  --primary-foreground: #ffffff;
  --secondary: #646C84;
  --secondary-foreground: #F4F7F9;
  --muted: #646C84;
  --muted-foreground: #F4F7F9;
  --accent: #646C84;
  --accent-foreground: #F4F7F9;
  --destructive: #BE0A14;
  --destructive-foreground: #ffffff;
  --border: #646C84;
  --input: #646C84;
  --ring: #FF3C28;
  --font-weight-medium: 700;
  --font-weight-normal: 400;
  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-success: var(--success);
  --color-success-foreground: var(--success-foreground);
  --color-info: var(--info);
  --color-info-foreground: var(--info-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-input-background: var(--input-background);
  --color-switch-background: var(--switch-background);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --radius-sm: 0rem;
  --radius-md: 0rem;
  --radius-lg: 0rem;
  --radius-xl: 0rem;
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }

  body {
    @apply bg-background text-foreground;
    font-family: var(--font-family);
  }
}

/**
 * Base typography. This is not applied to elements which have an ancestor with a Tailwind text class.
 */
@layer base {
  :where(:not(:has([class*=' text-']), :not(:has([class^='text-'])))) {
    h1 {
      font-size: var(--text-2xl);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    h2 {
      font-size: var(--text-xl);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    h3 {
      font-size: var(--text-lg);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    h4 {
      font-size: var(--text-base);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    p {
      font-size: var(--text-base);
      font-weight: var(--font-weight-normal);
      line-height: 1.5;
    }

    label {
      font-size: var(--text-base);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    button {
      font-size: var(--text-base);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    input {
      font-size: var(--text-base);
      font-weight: var(--font-weight-normal);
      line-height: 1.5;
    }
  }
}

@theme {
  --text-heading-xl: 20px;
  --text-heading-lg: 18px;
  --text-heading-md: 16px;
}

@layer components {

  .area-color[data-area="planning"] {
    --area-color: #44BB99;
  }

  .area-color[data-area="pim"] {
    --area-color: #EEDD88;
  }

  .area-color[data-area="production"] {
    --area-color: #99DDFF;
  }

  .area-color[data-area="ecommerce"] {
    --area-color: #FFAABB;
  }

  .area-color[data-area="persons"] {
    --area-color: #EE8866;
  }

  .area-color[data-area="mercator"] {
    --area-color: #C3D9E8;
  }

  .area-color[data-area="administration"] {
    --area-color: #77AADD;
  }

  .area-accent-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0.25rem;
    background-color: var(--area-color);
  }

  .area-icon {
    @apply inline-flex w-12 h-12 items-center justify-center;
    background-color: var(--area-color);
  }

  .text-body-sm {
    @apply text-sm;
  }
}

html {
  font-size: var(--font-size);
}

/* German hyphenation support */
* {
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  overflow-wrap: break-word;
  word-wrap: break-word;
}