/* ==========================================================================
   Ariadne UI tokens — docs/design-ui-consolidation.md §4.2

   Page and component CSS refers to these semantic names ONLY for colour, radius and elevation.
   Dark mode is a second set of values for the same names, not a stylesheet of per-page overrides.

   The raw Kano palette (--kano-*) is still defined in app.css; these are named for what a colour is
   FOR, so a component never has to know which palette entry means "the thing you can click".

   Bootstrap 5.3's own variables are re-pointed here too, so stock components (.card, .modal,
   .form-control, .dropdown-menu, .list-group, .table…) take the Kano surfaces natively instead of
   needing a dark-mode.css rule each.
   ========================================================================== */

:root {
    /* Surfaces */
    --ui-bg: var(--kano-bg-main);                 /* the page behind everything */
    --ui-surface: #ffffff;                        /* cards, panels, modals, menus */
    --ui-surface-raised: #ffffff;                 /* a surface on a surface (popover on a card) */
    --ui-surface-sunken: var(--kano-bg-soft);     /* wells, code, table stripes, input groups */
    --ui-surface-hover: rgba(17, 24, 39, 0.04);
    --ui-surface-selected: var(--kano-glow-trans);
    --ui-overlay: rgba(0, 0, 0, 0.5);             /* modal backdrop */

    /* Lines */
    --ui-border: var(--kano-line);
    --ui-border-strong: #d1d5db;

    /* Text */
    --ui-text: var(--kano-text-main);
    --ui-text-muted: var(--kano-text-soft);
    --ui-text-subtle: #6b7280;                    /* captions, timestamps */
    --ui-text-on-accent: #ffffff;

    /* Accent (brand green) */
    --ui-accent: var(--kano-glow-strong);
    --ui-accent-hover: var(--kano-glow);
    --ui-accent-soft: var(--kano-glow-trans);

    /* Tones — fg is text/icon colour, bg is a soft fill behind it */
    --ui-info-fg: #0b6aa2;      --ui-info-bg: #e0f2fe;
    --ui-success-fg: #1f7a4c;   --ui-success-bg: #dcfce7;
    --ui-warning-fg: #92400e;   --ui-warning-bg: #fef3c7;
    --ui-danger-fg: #b91c1c;    --ui-danger-bg: #fee2e2;
    --ui-neutral-fg: #374151;   --ui-neutral-bg: #f3f4f6;

    /* Shape and elevation */
    --ui-radius-sm: 4px;
    --ui-radius: 8px;
    --ui-radius-lg: 12px;
    --ui-shadow-raised: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.06);
    --ui-shadow-overlay: 0 12px 40px rgba(0, 0, 0, 0.18);

    /* Spacing scale (matches Bootstrap's 0-5 so utilities and component CSS agree) */
    --ui-space-1: 0.25rem;
    --ui-space-2: 0.5rem;
    --ui-space-3: 1rem;
    --ui-space-4: 1.5rem;
    --ui-space-5: 3rem;

    /* Layout */
    --ui-page-max-narrow: 820px;
    --ui-page-max: 1320px;

    /* ── Bootstrap 5.3, light ── */
    --bs-body-bg: var(--ui-surface);
    --bs-body-color: var(--ui-text);
    --bs-secondary-color: var(--ui-text-muted);
    --bs-tertiary-bg: var(--ui-surface-sunken);
    --bs-border-color: var(--ui-border);
    --bs-emphasis-color: var(--ui-text);
}

[data-bs-theme="dark"] {
    --ui-bg: var(--kano-bg-main);
    --ui-surface: var(--kano-bg-soft);
    --ui-surface-raised: #1b1e27;
    --ui-surface-sunken: rgba(255, 255, 255, 0.04);
    --ui-surface-hover: rgba(134, 215, 168, 0.06);
    --ui-surface-selected: rgba(134, 215, 168, 0.14);
    --ui-overlay: rgba(0, 0, 0, 0.65);

    --ui-border: var(--kano-line);
    --ui-border-strong: #353a46;

    --ui-text: var(--kano-text-main);
    --ui-text-muted: var(--kano-text-soft);
    --ui-text-subtle: #7d8594;
    --ui-text-on-accent: #0b0d12;

    --ui-accent: var(--kano-glow);
    --ui-accent-hover: var(--kano-glow-strong);
    --ui-accent-soft: var(--kano-glow-trans);

    --ui-info-fg: #7cc4f0;      --ui-info-bg: rgba(56, 152, 214, 0.16);
    --ui-success-fg: #86d7a8;   --ui-success-bg: rgba(134, 215, 168, 0.14);
    --ui-warning-fg: #f3c56b;   --ui-warning-bg: rgba(243, 197, 107, 0.14);
    --ui-danger-fg: #f19a9a;    --ui-danger-bg: rgba(241, 154, 154, 0.14);
    --ui-neutral-fg: #c3c8d2;   --ui-neutral-bg: rgba(255, 255, 255, 0.07);

    --ui-shadow-raised: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
    --ui-shadow-overlay: 0 12px 40px rgba(0, 0, 0, 0.55);

    /* ── Bootstrap 5.3, dark ── */
    --bs-body-bg: var(--ui-surface);
    --bs-body-color: var(--ui-text);
    --bs-secondary-color: var(--ui-text-muted);
    --bs-secondary-bg: var(--ui-surface-raised);
    --bs-tertiary-bg: var(--ui-surface-sunken);
    --bs-border-color: var(--ui-border);
    --bs-emphasis-color: var(--ui-text);
}
