/*
 * BS-8044: the one set of design tokens for the Backstage admin (Admin Site and event admin pages).
 *
 * Palette (--bs-palette-*) holds every raw colour and is the same in both themes; the existing admin
 * variables (--cfbc-*, --bsa-*, --admin-brand-* defaults) point at it, so screens that are not yet
 * restyled keep their current dark look. Semantic tokens (--bs-color-*) are what restyled components
 * use: dark by default, light under [data-bs-theme="light"]. Client brand colours sit on top of both
 * through --admin-brand-* (printed later, inline); the light theme reads the readable shade
 * --admin-brand-*-on-light that AdminDesignTokens prints when a brand colour is too light for it.
 * Navigation stays dark in both themes.
 */
:root {
    --bs-palette-gray-1000: #000000;
    --bs-palette-gray-975: #0D0D0F;
    --bs-palette-gray-950: #121214;
    --bs-palette-gray-940: #141416;
    --bs-palette-gray-925: #17171A;
    --bs-palette-gray-900: #1D1D1F;
    --bs-palette-gray-890: #1E1E23;
    --bs-palette-gray-880: #212020;
    --bs-palette-gray-850: #23262F;
    --bs-palette-gray-840: #26262C;
    --bs-palette-gray-800: #2F2F31;
    --bs-palette-gray-780: #34373B;
    --bs-palette-gray-750: #3A3A4A;
    --bs-palette-gray-500: #777E90;
    --bs-palette-gray-450: #8B90A0;
    --bs-palette-gray-400: #999999;
    --bs-palette-gray-50: #F4F5F8;
    --bs-palette-gray-25: #F9F9F9;
    --bs-palette-gray-0: #FFFFFF;

    --bs-palette-indigo-500: #4323FF;
    --bs-palette-indigo-600: #3A1DD9;
    --bs-palette-violet-600: #6707FD;
    --bs-palette-lavender-300: #B9A6FF;
    --bs-palette-blue-400: #3E8CFF;
    --bs-palette-blue-700: #4070A0;
    --bs-palette-red-500: #EF4444;
    --bs-palette-red-550: #E74C3C;
    --bs-palette-green-600: #16A34A;
    --bs-palette-green-450: #2ECC71;
    --bs-palette-orange-500: #FD8D0A;
    --bs-palette-gold-300: #FFD166;
    --bs-palette-yellow-400: #FFCC00;

    --bs-font-family: var(--admin-brand-font, var(--event-font-family, "DM Sans"), sans-serif);
    --bs-font-size-xs: 12px;
    --bs-font-size-sm: 14px;
    --bs-font-size-md: 16px;
    --bs-font-size-lg: 20px;
    --bs-font-size-xl: 25px;
    --bs-font-weight-regular: 400;
    --bs-font-weight-medium: 500;
    --bs-font-weight-semibold: 600;
    --bs-font-weight-bold: 700;
    --bs-line-height-tight: 1.2;
    --bs-line-height-normal: 1.5;

    --bs-space-1: 4px;
    --bs-space-2: 8px;
    --bs-space-3: 12px;
    --bs-space-4: 16px;
    --bs-space-5: 20px;
    --bs-space-6: 24px;
    --bs-space-8: 32px;
    --bs-space-10: 40px;
    --bs-space-12: 48px;

    --bs-radius-sm: 6px;
    --bs-radius-md: 8px;
    --bs-radius-lg: 12px;
    --bs-radius-pill: 999px;

    --bs-color-nav-bg: var(--bs-palette-gray-940);
    --bs-color-nav-surface: var(--bs-palette-gray-900);
    --bs-color-nav-text: var(--bs-palette-gray-25);
    --bs-color-nav-border: color-mix(in srgb, var(--bs-palette-gray-25) 12%, var(--bs-palette-gray-940));
}

:root,
[data-bs-theme="dark"] {
    --bs-color-bg: var(--bs-palette-gray-940);
    --bs-color-surface: var(--bs-palette-gray-900);
    --bs-color-text: var(--bs-palette-gray-25);
    --bs-color-cta: var(--admin-brand-cta, var(--bs-palette-indigo-500));
    --bs-color-accent: var(--admin-brand-accent, var(--bs-palette-lavender-300));
    --bs-color-shadow: rgb(0 0 0 / 40%);
}

[data-bs-theme="light"] {
    --bs-color-bg: var(--bs-palette-gray-50);
    --bs-color-surface: var(--bs-palette-gray-0);
    --bs-color-text: var(--bs-palette-gray-900);
    --bs-color-cta: var(--admin-brand-cta-on-light, var(--bs-palette-indigo-500));
    --bs-color-accent: var(--admin-brand-accent-on-light, var(--bs-palette-indigo-500));
    --bs-color-shadow: rgb(29 29 31 / 12%);
}

/* Derived tokens are declared on every theme root so a nested [data-bs-theme] recomputes them. */
:root,
[data-bs-theme] {
    --bs-color-surface-raised: color-mix(in srgb, var(--bs-color-text) 8%, var(--bs-color-surface));
    --bs-color-border: color-mix(in srgb, var(--bs-color-text) 14%, var(--bs-color-surface));
    --bs-color-text-muted: color-mix(in srgb, var(--bs-color-text) 62%, var(--bs-color-bg));
    --bs-color-on-cta: var(--bs-palette-gray-0);
    --bs-color-brand: var(--bs-palette-violet-600);
    --bs-color-success: var(--admin-brand-success, var(--bs-palette-green-600));
    --bs-color-critical: var(--admin-brand-critical, var(--bs-palette-red-500));
    --bs-color-warning: var(--bs-palette-orange-500);
    --bs-color-focus-ring: var(--bs-color-accent);
    --bs-shadow-sm: 0 1px 2px var(--bs-color-shadow);
    --bs-shadow-md: 0 4px 12px var(--bs-color-shadow);
    --bs-shadow-lg: 0 12px 32px var(--bs-color-shadow);
}
