/*
 * Copyright (C) 2024 The ORT Server Authors (See <https://github.com/eclipse-apoapsis/ort-server/blob/main/NOTICE>)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * SPDX-License-Identifier: Apache-2.0
 * License-Filename: LICENSE
 */

@import 'tailwindcss';
@import 'tw-animate-css';

@config '../tailwind.config.js';

/*
  The default border color has changed to `currentColor` in Tailwind CSS v4,
  so we've added these compatibility styles to make sure everything still
  looks the same as it did with Tailwind CSS v3.

  If we ever want to remove these styles, we need to add an explicit border
  color utility to any element that depends on these defaults.
*/
@layer base {
  *,
  ::after,
  ::before,
  ::backdrop,
  ::file-selector-button {
    border-color: var(--color-gray-200, currentColor);
  }
}

@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-border: var(--border);
  --color-input: var(--input);
  --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);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);

  --font-sans: var(--font-sans);
  --font-mono: var(--font-mono);
  --font-serif: var(--font-serif);

  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

/* 
 * Default theme (shadcn-ui original from 2024) 
 */

:root {
  --background: hsl(0 0% 100%);
  --foreground: hsl(222.2 84% 4.9%);
  --card: hsl(0 0% 100%);
  --card-foreground: hsl(222.2 84% 4.9%);
  --popover: hsl(0 0% 100%);
  --popover-foreground: hsl(222.2 84% 4.9%);
  --primary: hsl(222.2 47.4% 11.2%);
  --primary-foreground: hsl(210 40% 98%);
  --secondary: hsl(210 40% 96.1%);
  --secondary-foreground: hsl(222.2 47.4% 11.2%);
  --muted: hsl(210 40% 96.1%);
  --muted-foreground: hsl(215.4 16.3% 46.9%);
  --accent: hsl(210 40% 96.1%);
  --accent-foreground: hsl(222.2 47.4% 11.2%);
  --destructive: hsl(0 84.2% 60.2%);
  --destructive-foreground: hsl(210 40% 98%);
  --border: hsl(214.3 31.8% 91.4%);
  --input: hsl(214.3 31.8% 91.4%);
  --ring: hsl(222.2 84% 4.9%);

  --chart-1: hsl(12 76% 61%);
  --chart-2: hsl(173 58% 39%);
  --chart-3: hsl(197 37% 24%);
  --chart-4: hsl(43 74% 66%);
  --chart-5: hsl(27 87% 67%);

  /* Custom colors for workers, taken from ORT brand colors */
  /* https://oss-review-toolkit.org/ort/                    */
  --analyzer: rgb(0, 175, 170);
  --advisor: rgb(153, 123, 183);
  --scanner: rgb(209, 78, 96);
  --evaluator: rgb(51, 153, 204);
  --reporter: rgb(242, 144, 86);
  --traffic-light-green: rgb(0, 164, 0);
  --traffic-light-yellow: rgb(255, 186, 0);
  --traffic-light-red: rgb(250, 56, 62);

  --radius: 0.5rem;
}

.dark {
  --background: hsl(222.2 84% 4.9%);
  --foreground: hsl(210 40% 98%);
  --card: hsl(222.2 84% 4.9%);
  --card-foreground: hsl(210 40% 98%);
  --popover: hsl(222.2 84% 4.9%);
  --popover-foreground: hsl(210 40% 98%);
  --primary: hsl(210 40% 98%);
  --primary-foreground: hsl(222.2 47.4% 11.2%);
  --secondary: hsl(217.2 32.6% 17.5%);
  --secondary-foreground: hsl(210 40% 98%);
  --muted: hsl(217.2 32.6% 17.5%);
  --muted-foreground: hsl(215 20.2% 65.1%);
  --accent: hsl(217.2 32.6% 17.5%);
  --accent-foreground: hsl(210 40% 98%);
  --destructive: hsl(0 62.8% 30.6%);
  --destructive-foreground: hsl(210 40% 98%);
  --border: hsl(217.2 32.6% 30%);
  --input: hsl(217.2 32.6% 30%);
  --ring: hsl(212.7 26.8% 83.9%);

  --chart-1: hsl(220 70% 50%);
  --chart-2: hsl(160 60% 45%);
  --chart-3: hsl(30 80% 55%);
  --chart-4: hsl(280 65% 60%);
  --chart-5: hsl(340 75% 55%);
}

/* 
 * Current shadcn-ui theme (as of 7.10.2025) 
 */

[data-theme='shadcn'] {
  --background: oklch(1 0 0);
  --foreground: oklch(0.14 0 285.86);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.14 0 285.86);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.14 0 285.86);
  --primary: oklch(0.21 0.01 285.93);
  --primary-foreground: oklch(0.99 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.21 0.01 285.93);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.55 0.02 285.93);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.21 0.01 285.93);
  --destructive: oklch(0.58 0.24 28.48);
  --border: oklch(0.92 0 286.61);
  --input: oklch(0.92 0 286.61);
  --ring: oklch(0.71 0.01 286.09);
  --chart-1: oklch(0.65 0.22 36.85);
  --chart-2: oklch(0.6 0.11 184.15);
  --chart-3: oklch(0.4 0.07 227.18);
  --chart-4: oklch(0.83 0.17 81.03);
  --chart-5: oklch(0.77 0.17 65.36);
  --sidebar: oklch(0.99 0 0);
  --sidebar-foreground: oklch(0.14 0 285.86);
  --sidebar-primary: oklch(0.21 0.01 285.93);
  --sidebar-primary-foreground: oklch(0.99 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.21 0.01 285.93);
  --sidebar-border: oklch(0.92 0 286.61);
  --sidebar-ring: oklch(0.71 0.01 286.09);

  --font-sans:
    'Geist', 'Geist Fallback', ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
    'Segoe UI Symbol', 'Noto Color Emoji';
  --font-serif:
    'Geist', 'Geist Fallback', ui-serif, Georgia, Cambria, 'Times New Roman',
    Times, serif;
  --font-mono:
    'Geist Mono', 'Geist Mono Fallback', ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

  --radius: 0.625rem;
}

.dark[data-theme='shadcn'] {
  --background: oklch(0.14 0 285.86);
  --foreground: oklch(0.99 0 0);
  --card: oklch(0.21 0.01 285.93);
  --card-foreground: oklch(0.99 0 0);
  --popover: oklch(0.21 0.01 285.93);
  --popover-foreground: oklch(0.99 0 0);
  --primary: oklch(0.92 0 286.61);
  --primary-foreground: oklch(0.21 0.01 285.93);
  --secondary: oklch(0.27 0.01 286.1);
  --secondary-foreground: oklch(0.99 0 0);
  --muted: oklch(0.27 0.01 286.1);
  --muted-foreground: oklch(0.71 0.01 286.09);
  --accent: oklch(0.27 0.01 286.1);
  --accent-foreground: oklch(0.99 0 0);
  --destructive: oklch(0.7 0.19 22.23);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.55 0.02 285.93);
  --chart-1: oklch(0.49 0.24 264.4);
  --chart-2: oklch(0.7 0.16 160.43);
  --chart-3: oklch(0.77 0.17 65.36);
  --chart-4: oklch(0.62 0.26 305.32);
  --chart-5: oklch(0.64 0.25 16.51);
  --sidebar: oklch(0.21 0.01 285.93);
  --sidebar-foreground: oklch(0.99 0 0);
  --sidebar-primary: oklch(0.49 0.24 264.4);
  --sidebar-primary-foreground: oklch(0.99 0 0);
  --sidebar-accent: oklch(0.27 0.01 286.1);
  --sidebar-accent-foreground: oklch(0.99 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.55 0.02 285.93);
}

/* 
 * Material design theme 
 */

[data-theme='material-design'] {
  --background: oklch(0.98 0.01 335.69);
  --foreground: oklch(0.22 0 0);
  --card: oklch(0.96 0.01 335.69);
  --card-foreground: oklch(0.14 0 0);
  --popover: oklch(0.95 0.01 316.67);
  --popover-foreground: oklch(0.4 0.04 309.35);
  --primary: oklch(0.51 0.21 286.5);
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.49 0.04 300.23);
  --secondary-foreground: oklch(1 0 0);
  --muted: oklch(0.96 0.01 335.69);
  --muted-foreground: oklch(0.14 0 0);
  --accent: oklch(0.92 0.04 303.47);
  --accent-foreground: oklch(0.14 0 0);
  --destructive: oklch(0.57 0.23 29.21);
  --border: oklch(0.83 0.02 308.26);
  --input: oklch(0.57 0.02 309.68);
  --ring: oklch(0.5 0.13 293.77);
  --chart-1: oklch(0.61 0.21 279.42);
  --chart-2: oklch(0.72 0.15 157.67);
  --chart-3: oklch(0.66 0.17 324.24);
  --chart-4: oklch(0.81 0.15 127.91);
  --chart-5: oklch(0.68 0.17 258.25);
  --sidebar: oklch(0.99 0 0);
  --sidebar-foreground: oklch(0.15 0 0);
  --sidebar-primary: oklch(0.56 0.11 228.27);
  --sidebar-primary-foreground: oklch(0.98 0 0);
  --sidebar-accent: oklch(0.95 0 0);
  --sidebar-accent-foreground: oklch(0.25 0 0);
  --sidebar-border: oklch(0.9 0 0);
  --sidebar-ring: oklch(0.56 0.11 228.27);

  --font-sans: Roboto, sans-serif;
  --font-serif: Merriweather, serif;
  --font-mono:
    'Geist Mono', 'Geist Mono Fallback', ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

  --radius: 1rem;
}

.dark[data-theme='material-design'] {
  --background: oklch(0.15 0.01 317.69);
  --foreground: oklch(0.95 0.01 321.5);
  --card: oklch(0.22 0.02 322.13);
  --card-foreground: oklch(0.95 0.01 321.5);
  --popover: oklch(0.22 0.02 322.13);
  --popover-foreground: oklch(0.95 0.01 321.5);
  --primary: oklch(0.6 0.22 279.81);
  --primary-foreground: oklch(0.98 0.01 321.51);
  --secondary: oklch(0.45 0.03 294.79);
  --secondary-foreground: oklch(0.95 0.01 321.5);
  --muted: oklch(0.22 0.01 319.5);
  --muted-foreground: oklch(0.7 0.01 320.7);
  --accent: oklch(0.35 0.06 299.57);
  --accent-foreground: oklch(0.95 0.01 321.5);
  --destructive: oklch(0.57 0.23 29.21);
  --border: oklch(0.4 0.04 309.35);
  --input: oklch(0.4 0.04 309.35);
  --ring: oklch(0.5 0.15 294.97);
  --chart-1: oklch(0.5 0.25 274.99);
  --chart-2: oklch(0.6 0.15 150.16);
  --chart-3: oklch(0.65 0.2 309.96);
  --chart-4: oklch(0.6 0.17 132.98);
  --chart-5: oklch(0.6 0.2 255.25);
  --sidebar: oklch(0.2 0.01 317.74);
  --sidebar-foreground: oklch(0.95 0.01 321.5);
  --sidebar-primary: oklch(0.59 0.11 225.82);
  --sidebar-primary-foreground: oklch(0.95 0.01 321.5);
  --sidebar-accent: oklch(0.3 0.01 319.52);
  --sidebar-accent-foreground: oklch(0.95 0.01 321.5);
  --sidebar-border: oklch(0.35 0.01 319.53 / 30%);
  --sidebar-ring: oklch(0.59 0.11 225.82);
}

@layer base {
  * {
    @apply border-border;
  }
  button {
    cursor: pointer;
  }
  body {
    @apply bg-background text-foreground;
  }
}
