/* ============================================================================
   VS Code Dark Theme Defaults — Standalone Mode Foundation
   ============================================================================

   This file provides --vscode-* CSS variable values matching VS Code's
   "Dark+" theme. It is the SINGLE SOURCE OF TRUTH for standalone (browser)
   dark theming across all MAX apps.

   HOW IT WORKS:
   - Loaded via @import from core-design-system.css (which every app includes)
   - Defines ALL --vscode-* variables that any MAX app references
   - In VS Code: these values are overridden by VS Code's inline theme styles
     (inline styles on <html> have higher specificity than :root rules)
   - In Standalone: these values are the only definitions, so they apply

   ADDING NEW VARS:
   If a new app or component references a --vscode-* variable, add it here.
   Run this to find missing vars:
     grep -roh "var(--vscode-[a-zA-Z-]*" apps/ --include="*.css" --include="*.html" |
       sed 's/var(//g' | sort -u

   ========================================================================== */

:root {
    /* ── Editor ────────────────────────────────────────────────────────── */
    --vscode-editor-background: #1e1e1e;
    --vscode-editor-foreground: #d4d4d4;
    --vscode-editor-selectionBackground: #264f78;
    --vscode-foreground: #cccccc;

    /* ── Sidebar / Panels ──────────────────────────────────────────────── */
    --vscode-sideBar-background: #252526;
    --vscode-sideBar-foreground: #cccccc;
    --vscode-sideBarTitle-foreground: #bbbbbb;
    --vscode-sideBarSectionHeader-foreground: #bbbbbb;
    --vscode-panel-background: #1e1e1e;
    --vscode-panel-border: #80808059;
    --vscode-editorGroup-border: #444444;

    /* ── Widgets ───────────────────────────────────────────────────────── */
    --vscode-editorWidget-background: #252526;
    --vscode-editorWidget-foreground: #cccccc;
    --vscode-editorWidget-border: #454545;
    --vscode-widget-border: #303031;
    --vscode-widget-shadow: rgba(0, 0, 0, 0.36);

    /* ── Input ─────────────────────────────────────────────────────────── */
    --vscode-input-foreground: #cccccc;
    --vscode-input-border: #3c3c3c;
    --vscode-input-placeholderForeground: #a6a6a6;
    --vscode-inputOption-activeBorder: #007acc;
    --vscode-inputValidation-infoBackground: #063b49;
    --vscode-inputValidation-warningBackground: #352a05;

    /* ── Buttons ───────────────────────────────────────────────────────── */
    --vscode-button-background: #0e639c;
    --vscode-button-foreground: #ffffff;
    --vscode-button-hoverBackground: #1177bb;
    --vscode-button-secondaryBackground: #3a3d41;
    --vscode-button-secondaryForeground: #ffffff;

    /* ── Focus / Borders ───────────────────────────────────────────────── */
    --vscode-focusBorder: #007fd4;
    --vscode-contrastBorder: transparent;

    /* ── Text ──────────────────────────────────────────────────────────── */
    --vscode-descriptionForeground: #969696;
    --vscode-disabledForeground: #6b6b6b;
    --vscode-textLink-foreground: #3794ff;
    --vscode-textLink-activeForeground: #3794ff;
    --vscode-textPreformat-foreground: #d7ba7d;
    --vscode-textCodeBlock-background: #2a2a2a;

    /* ── Lists ─────────────────────────────────────────────────────────── */
    --vscode-list-activeSelectionBackground: #04395e;
    --vscode-list-activeSelectionForeground: #ffffff;
    --vscode-list-hoverBackground: #2a2d2e;
    --vscode-list-inactiveSelectionBackground: #37373d;
    --vscode-list-highlightForeground: #2aaaff;

    /* ── Badge ─────────────────────────────────────────────────────────── */
    --vscode-badge-background: #4d4d4d;
    --vscode-badge-foreground: #ffffff;

    /* ── Scrollbar ─────────────────────────────────────────────────────── */
    --vscode-scrollbarSlider-background: rgba(121, 121, 121, 0.4);
    --vscode-scrollbarSlider-hoverBackground: rgba(100, 100, 100, 0.7);
    --vscode-scrollbarSlider-activeBackground: rgba(191, 191, 191, 0.4);

    /* ── Progress ──────────────────────────────────────────────────────── */
    --vscode-progressBar-background: #0e70c0;

    /* ── Tabs ──────────────────────────────────────────────────────────── */
    --vscode-tab-activeBackground: #1e1e1e;
    --vscode-tab-activeForeground: #ffffff;
    --vscode-tab-inactiveBackground: #2d2d2d;
    --vscode-tab-inactiveForeground: #969696;

    /* ── Toolbar ───────────────────────────────────────────────────────── */
    --vscode-toolbar-hoverBackground: #2a2d2e;

    /* ── Notifications ─────────────────────────────────────────────────── */
    --vscode-notificationCenterHeader-background: #303031;
    --vscode-notifications-background: #252526;
    --vscode-notifications-foreground: #cccccc;
    --vscode-notificationsSuccessIcon-foreground: #4caf50;
    --vscode-notificationsErrorIcon-foreground: #f44336;
    --vscode-notificationsWarningIcon-foreground: #ff9800;
    --vscode-notificationsInfoIcon-foreground: #2196f3;

    /* ── Status Colors ─────────────────────────────────────────────────── */
    --vscode-testing-iconPassed: #22c55e;
    --vscode-editorWarning-foreground: #f59e0b;
    --vscode-errorForeground: #ef4444;
    --vscode-charts-green: #22c55e;
    --vscode-charts-red: #ef4444;

    /* ── Terminal ───────────────────────────────────────────────────────── */
    --vscode-terminal-foreground: #cccccc;
    --vscode-terminal-background: #1e1e1e;

    /* ── Font ──────────────────────────────────────────────────────────── */
    --vscode-font-family: var(--font-ui, system-ui, sans-serif);
    --vscode-font-size: 11px;
    --vscode-font-weight: normal;
    --vscode-editor-font-family: 'JetBrains Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
    --vscode-editor-font-size: 10px;

    /* ── Color Scheme ──────────────────────────────────────────────────── */
    color-scheme: dark;
}

/* ============================================================================
   NAVY THEME — WorkLM's deep-navy --vscode-* palette.
   ----------------------------------------------------------------------------
   MIGRATION NOTE (2026-06-22, theme-system-refactor): This block is SCHEDULED
   FOR REMOVAL once all 72 direct --vscode-* consumers in CSS are migrated to
   --color-* semantic tokens. Navy's palette lives in themes.js
   THEMES.navy.vars (the navy.json copy this note once named as the source of
   truth was never read at runtime and was deleted, E-23922). This CSS block is
   kept temporarily so that CSS referencing --vscode-* directly (via
   design-system.css --app-* tokens and ~72 other sites) continues to resolve
   Navy colors instead of falling back to the Dark+ grey defaults above — and
   navy's --color-text-secondary resolves THROUGH it (#6BA3C0).

   When this block is removed, themes.js must also set these --vscode-* vars,
   or all --vscode-* consumers must be rewritten to use --color-* tokens. The
   latter is the target architecture.
   =========================================================================== */
html:root {
    --vscode-editor-background: #06182A;
    --vscode-sideBar-background: #071D2F;
    --vscode-editorWidget-background: #071D2F;
    /* E-48058: the field follows the ONE owner (core-design-system.css --color-input-bg, the
       theme's elevated rung) and the theme's own border; #081e30 / #0a2540 painted navy fields
       on the grey dark surfaces. */
    --vscode-input-background: var(--color-input-bg);
    --vscode-input-border: var(--color-border-normal);
    --vscode-input-foreground: #ffffff;
    --vscode-foreground: #D9D9D9;
    --vscode-descriptionForeground: #6BA3C0;
    --vscode-widget-border: #0a2540;
    --vscode-button-background: #1470a0;
    --vscode-button-foreground: #ffffff;
    --vscode-focusBorder: #1470a0;
    --vscode-list-activeSelectionBackground: #07253D;
    --vscode-list-hoverBackground: #081e30;
    --vscode-scrollbarSlider-background: rgba(20, 112, 160, 0.3);
    --vscode-scrollbarSlider-hoverBackground: rgba(20, 112, 160, 0.5);
    --vscode-scrollbarSlider-activeBackground: rgba(20, 112, 160, 0.7);
    --vscode-tab-activeBackground: #081e30;
    --vscode-tab-inactiveBackground: #030a14;
    --vscode-statusBar-background: #07253D;
    --vscode-titleBar-activeBackground: #07253D;
    --vscode-activityBar-background: #030a14;
    --vscode-icon-foreground: #5090b0;
}

/* ============================================================================
   STANDALONE ZOOM — Global scale boost for browser rendering.
   Many apps use hardcoded px values, so font-size changes alone don't help.
   CSS zoom scales everything uniformly. UNCONDITIONAL (2026-05-30) — was gated
   on `html:not([data-vscode-theme-kind])` for the dead VS Code path; a leaked
   data-vscode-theme-kind used to silently drop the zoom AND the background
   (→ black flash). CLM is always standalone; apply always.
   =========================================================================== */
html body {
    /* Normal 100% (2026-06-16, user: text was "too fucking gigantic" after a
       cold boot — the legacy 1.10 body zoom made everything exaggerated). UI
       should read at native size, matching the left chat-bar text. */
    zoom: 1.0;
    /* Explicit background so a transparent body never falls through to black. */
    background: var(--color-bg-primary) !important;
}
