/**
 * Shared styles for solidtime
 * This CSS file contains all the shared theme variables and base styles
 * used by both the main solidtime app and the desktop app.
 *
 * Font-face declarations are intentionally omitted here as they differ between apps:
 * - Main app uses 'Inter'
 * - Desktop app uses 'Outfit'
 * Each app should include their own font-face declarations.
 */

@tailwind base;
@tailwind components;
@tailwind utilities;

:root.dark {
    /* Linear/Raycast: cool blue-tinted neutrals, content surface at Material floor */
    --color-bg-primary: oklch(0.17 0 0);       /* content surface */
    --color-bg-secondary: oklch(0.20 0 0);     /* cards, input fills */
    --color-bg-tertiary: oklch(0.25 0 0);      /* hover / active row */
    --color-bg-quaternary: oklch(0.29 0 0);    /* pressed / selected */
    --color-bg-elevated: oklch(0.22 0 0);      /* popovers, modals, dropdowns */
    --color-bg-background: oklch(0.14 0 0);    /* sidebar / chrome — recessed */
    --color-text-primary: oklch(0.97 0 0);
    --color-text-secondary: oklch(0.85 0 0);
    --color-text-tertiary: oklch(0.70 0 0);
    --color-text-quaternary: oklch(0.55 0 0);

    --color-border-primary: oklch(0.24 0 0);    /* separators — above elevated */
    --color-border-secondary: oklch(0.28 0 0);  /* card borders */
    --color-border-tertiary: oklch(0.32 0 0);   /* input borders */
    --color-border-quaternary: oklch(0.36 0 0); /* emphasized borders */
    --color-input-border-active: rgba(255, 255, 255, 0.18);

    --theme-color-chart: var(--color-accent-200);

    --theme-color-menu-active: var(--color-bg-secondary);
    --theme-color-card-background: var(--color-bg-secondary);
    --theme-shadow-card: 0 4px 7px 0px rgb(0 0 0 / 15%);
    --theme-shadow-dropdown: 0 8px 24px -4px rgb(0 0 0 / 55%), 0 2px 6px 0 rgb(0 0 0 / 35%);

    --theme-color-card-background-active: var(--color-bg-tertiary);

    --theme-color-row-background: var(--color-bg-primary);
    --theme-color-row-heading-background: var(--color-bg-primary);
    --theme-color-row-heading-border: var(--theme-color-card-border);
    --theme-color-icon-default: var(--color-text-tertiary);

    --theme-color-ring: rgba(255, 255, 255, 0.5);

    --theme-color-button-primary-background: rgba(var(--color-accent-300), 0.1);
    --theme-color-button-primary-background-hover: rgba(var(--color-accent-300), 0.2);
    --theme-color-button-primary-border: rgba(var(--color-accent-300), 0.2);
    --theme-color-button-primary-text: var(--color-text-primary);

    --theme-color-input-background: var(--color-bg-secondary);

    --theme-color-input-select-active: rgb(var(--color-accent-300));
    --theme-color-input-select-active-hover: rgb(var(--color-accent-400));

    --color-accent-default: rgba(var(--color-accent-300), 0.2);
    --color-accent-foreground: rgb(var(--color-accent-100));
    --theme-color-default-background: var(--color-bg-primary);
}

:root.light {
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #fcfcfc;
    --color-bg-tertiary: #eeeeef;
    --color-bg-quaternary: #e1e1e3;
    --color-bg-background: #f5f5f5;
    --color-text-primary: #18181b;
    --color-text-secondary: #3f3f46;
    --color-text-tertiary: #57575c;
    --color-text-quaternary: #a1a1aa;
    --color-border-primary: #e7e7e7;
    --color-border-secondary: #e5e5e5;
    --color-border-tertiary: #dfdfdf;
    --color-border-quaternary: #d1d1d1;
    --color-input-border-active: rgba(0, 0, 0, 0.3);
    --theme-color-menu-active: var(--color-bg-quaternary);

    --theme-color-card-background: var(--color-bg-primary);
    --theme-color-card-background-active: var(--color-bg-tertiary);

    --theme-color-chart: var(--color-accent-400);

    --theme-shadow-card: lch(0 0 0 / 0.022) 0px 3px 6px -2px, lch(0 0 0 / 0.044) 0px 1px 1px;
    --theme-shadow-dropdown: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);

    --theme-color-row-background: var(--color-bg-primary);
    --theme-color-row-heading-background: var(--color-bg-primary);
    --theme-color-row-heading-border: var(--color-border-tertiary);
    --theme-color-icon-default: var(--color-text-quaternary);

    --theme-color-ring: rgba(0, 0, 0, 0.7);

    --theme-color-button-primary-background: rgba(var(--color-accent-600), 0.9);
    --theme-color-button-primary-background-hover: rgba(var(--color-accent-600), 1);
    --theme-color-button-primary-border: rgba(var(--color-accent-600), 1);
    --theme-color-button-primary-text: #ffffff;

    --theme-color-input-background: transparent;

    --theme-color-input-select-active: rgb(var(--color-accent-400));
    --theme-color-input-select-active-hover: rgb(var(--color-accent-500));

    --color-accent-default: rgb(var(--color-accent-100));
    --color-accent-foreground: rgb(var(--color-accent-800));
    --theme-color-default-background: #fcfcfc;
}

:root {
    --theme-color-icon-active: rgb(var(--color-text-tertiary));
    --theme-color-card-background-separator: var(--color-border-tertiary);
    --theme-color-card-border: var(--color-border-secondary);
    --theme-color-card-border-active: var(--color-border-tertiary);
    --theme-color-default-background-separator: var(--color-border-primary);
    --theme-color-primary-text: var(--color-text-primary);
    --theme-color-input-border: var(--color-border-quaternary);
    --theme-color-tab-background: var(--theme-color-card-background);
    --theme-color-tab-background-active: var(--theme-color-card-background-active);
    --theme-color-tab-border: var(--theme-color-card-border);
    --theme-color-row-separator-background: var(--theme-color-default-background-separator);
    --theme-color-row-border: var(--theme-color-card-border);

    --color-accent-50: 240, 249, 255; /* sky-50 */
    --color-accent-100: 224, 242, 254; /* sky-100 */
    --color-accent-200: 186, 230, 253; /* sky-200 */
    --color-accent-300: 125, 211, 252; /* sky-300 */
    --color-accent-400: 56, 189, 248; /* sky-400 */
    --color-accent-500: 14, 165, 233; /* sky-500 */
    --color-accent-600: 2, 132, 199; /* sky-600 */
    --color-accent-700: 3, 105, 161; /* sky-700 */
    --color-accent-800: 7, 89, 133; /* sky-800 */
    --color-accent-900: 12, 74, 110; /* sky-900 */
    --color-accent-950: 8, 47, 73; /* sky-950 */

    --theme-button-secondary-background: var(--theme-color-card-background);
    --theme-button-secondary-background-active: var(--theme-color-card-background-active);
    --popover-border: var(--color-border-secondary);
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scrollbar-width: thin;
    scrollbar-color: var(--color-bg-tertiary) transparent;
}

[x-cloak] {
    display: none;
}

body {
    background-color: var(--theme-color-default-background);
}

@layer base {
    :root {
        --background: var(--color-bg-background);
        --foreground: var(--color-text-primary);
        --card: var(--theme-color-card-background);
        --card-foreground: var(--color-text-primary);
        --popover: var(--theme-color-card-background);
        --popover-foreground: var(--color-text-primary);
        --primary: var(--color-bg-primary);
        --primary-foreground: var(--color-text-primary);
        --secondary: var(--color-bg-secondary);
        --secondary-foreground: var(--color-text-primary);
        --muted: var(--color-bg-tertiary);
        --muted-foreground: var(--color-text-tertiary);
        --accent: var(--color-bg-tertiary);
        --accent-foreground: var(--color-text-primary);
        --destructive: 0 84.2% 60.2%;
        --destructive-foreground: var(--color-text-primary);
        --border: var(--color-border-primary);
        --input: var(--color-border-tertiary);
        --ring: var(--theme-color-ring);
        --chart-1: var(--color-accent-400);
        --chart-2: var(--color-accent-500);
        --chart-3: var(--color-accent-600);
        --chart-4: var(--color-accent-700);
        --chart-5: var(--color-accent-800);
        --radius: 0.5rem;
    }
    .dark {
        --background: var(--color-bg-background);
        --foreground: var(--color-text-primary);
        --card: var(--theme-color-card-background);
        --card-foreground: var(--color-text-primary);
        --popover: var(--color-bg-elevated, var(--color-bg-secondary));
        --popover-foreground: var(--color-text-primary);
        --primary: var(--color-bg-primary);
        --primary-foreground: var(--color-text-primary);
        --secondary: var(--color-bg-secondary);
        --secondary-foreground: var(--color-text-primary);
        --muted: var(--color-bg-tertiary);
        --muted-foreground: var(--color-text-tertiary);
        --accent: var(--color-bg-tertiary);
        --accent-foreground: var(--color-text-primary);
        --destructive: 0 72% 60%;
        --destructive-foreground: var(--color-text-primary);
        --border: var(--color-border-primary);
        --input: var(--color-border-tertiary);
        --ring: var(--theme-color-ring);
        --chart-1: var(--color-accent-200);
        --chart-2: var(--color-accent-300);
        --chart-3: var(--color-accent-400);
        --chart-4: var(--color-accent-500);
        --chart-5: var(--color-accent-600);
    }
}

@layer base {
    * {
        @apply border-border;
    }
    body {
        @apply bg-background text-foreground;
    }
}
