/* Seotica design tokens: the only colour, radius, shadow, spacing and font-size values. One source for both
   sides: the Django pages link this file before seotica.css (base.html, base_landing.html, the entrance and error
   pages), the React app imports it (frontend/src/styles/tailwind.css maps the theme onto these names). */
/* Inter, the brand's typeface (the brand sheet), self-hosted (no font CDN): a variable font, three subsets; the browser
   fetches only those a page's text needs. SIL Open Font License: static/fonts/inter/LICENSE.txt. */
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url("../fonts/inter/inter-latin-wght-normal.8e433c0592f7.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url("../fonts/inter/inter-latin-ext-wght-normal.ad4eb06671be.woff2") format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url("../fonts/inter/inter-cyrillic-wght-normal.06ab411342ac.woff2") format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
    /* brand (the brand sheet's palette: Navy #0B2A6B primary brand, Blue #2563FF key accent, Cyan #06B6FF gradient
       accent, Light Blue #E8F4FF background, Charcoal #0F172A text) */
    --brand-navy: #0b2a6b;
    --brand-blue: #2563ff;
    --brand-cyan: #06b6ff;
    --brand-light: #e8f4ff;
    --brand-charcoal: #0f172a;
    /* the brand Blue a shade deeper for text and buttons: 4.5:1 (WCAG AA) also on the Light Blue tints */
    --primary-color: #2160f5;
    --primary-dark: #1a4fd6;    /* hover, text on tints: 5.9:1 on white */
    --primary-darker: var(--brand-navy);
    --primary-light: var(--brand-cyan);
    --primary-subtle: var(--brand-light);
    --primary-hover: var(--primary-dark);
    --primary: var(--primary-color);
    --accent-color: var(--primary-color);
    --secondary-color: #5b8def;
    /* the app's chrome (header, sidebar): a deeper brand blue into Navy, as the brand sheet's icon; deeper than
       --brand-blue so white text on the translucent fields stays AA (4.5:1, axe in frontend/e2e/a11y.spec.ts) */
    --shell-from: var(--primary-dark);
    --shell-to: var(--brand-navy);
    --shell-header: var(--primary-dark);
    --header-height: 70px;  /* the top bar and the sidebar's logo row: one line under both */

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* semantic */
    --success-color: #10b981;
    --success-dark: #15803d;    /* success text: 4.5:1 on white and the page background (WCAG AA) */
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    /* soft status backgrounds and their text colours (tags, badges, notices) */
    --success-subtle: #d1fae5;
    --success-text: #065f46;
    --danger-subtle: #fee2e2;
    --danger-text: #991b1b;
    --warning-subtle: #fef3c7;
    --warning-text: #92400e;
    --info-subtle: #dbeafe;
    --info-text: #1e40af;

    /* neutrals (one grey scale for text, borders and backgrounds) */
    --white: #fff;
    /* Categories (clusters, tags, competitors): a hue per name, soft background + strong text, 4.5:1 or more
       (the React app's colorFor(), frontend/src/shared/ui/badge.tsx). Not for states: those are success/danger. */
    --cat-1-bg: #e0ecff; --cat-1-fg: #1d4ed8;
    --cat-2-bg: #efe6ff; --cat-2-fg: #6d28d9;
    --cat-3-bg: #d3f4ec; --cat-3-fg: #0f766e;
    --cat-4-bg: #fdf0d2; --cat-4-fg: #92400e;
    --cat-5-bg: #fce7f3; --cat-5-fg: #be185d;
    --cat-6-bg: #dcfce7; --cat-6-fg: #166534;
    --cat-7-bg: #ffe9d6; --cat-7-fg: #c2410c;
    --cat-8-bg: #e3e7ff; --cat-8-fg: #4338ca;
    --cat-9-bg: #d4f6fb; --cat-9-fg: #0e7490;
    --brand-tint: #f0f6ff;  /* a whisper of the brand blue: table headers, active rows */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --text-primary: var(--brand-charcoal);
    /* text greys: 4.5:1 or more (WCAG AA) on white, the page background and a selected row (axe, frontend/e2e) */
    --text-secondary: #646b78;
    --text-tertiary: var(--gray-500);
    --text-muted: var(--text-secondary);
    --text-light: rgba(255, 255, 255, 0.8);
    --text-lighter: rgba(255, 255, 255, 0.6);

    --bg-app: #f4f7fc;          /* page canvas (the brand sheet's panels) */
    --bg-primary: #ffffff;      /* cards, panels */
    --bg-white: #ffffff;
    --bg-secondary: var(--gray-50);
    --bg-tertiary: var(--gray-100);
    --bg-light: #f5f7fa;
    --bg-dark: var(--gray-900);
    --light-bg: #f8f9fa;

    --border-color: var(--gray-200);
    --border-light: var(--gray-100);

    /* shape */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.06);
    --shadow: 0 2px 4px 0 rgb(0 0 0 / 0.08);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.06);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.08);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.08);

    /* density (compact app) */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --font-size-xs: 0.7rem;
    --font-size-sm: 0.8rem;
    --font-size-base: 0.875rem;
    --font-size-lg: 1rem;
    --font-size-xl: 1.25rem;
    --input-height-sm: 32px;
    --btn-padding-y-sm: 4px;
    --btn-padding-x-sm: 8px;

    /* palette: hues used by charts, categories and status chips (pages.css and components) */
    --amber-100: #fff6e5;
    --amber-300: #fed7aa;
    --amber-500: #fbbf24;
    --amber-600: #d97706;
    --amber-700: #ca8a04;
    --amber-800: #9a5b00;
    --blue-100: #e0e7ff;
    --blue-400: #6c8cff;
    --blue-50: #f5f9ff;
    --blue-500: #0d6efd;
    --blue-600: #1d4ed8;
    --blue-700: #2563eb;
    --blue-800: #084298;
    --blue-900: #3949ab;
    --cyan-700: #06b6d4;
    --cyan-800: #0891b2;
    --green-50: #f0fdf4;
    --green-500: #4ade80;
    --green-700: #22c55e;
    --green-800: #1e7b47;
    --indigo-400: #6366f1;
    --indigo-700: #3730a3;
    --lime-800: #65a30d;
    --orange-400: #fb923c;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --orange-700: #b45309;
    --pink-500: #ec4899;
    --red-200: #f9d0cc;
    --red-400: #f87171;
    --red-500: #dc3545;
    --red-600: #dc2626;
    --red-700: #b42318;
    --sky-300: #93c5fd;
    --sky-600: #0ea5e9;
    --sky-700: #0088cc;
    --teal-300: #a7f3d0;
    --teal-800: #059669;
    --violet-100: #f3effd;
    --violet-200: #e2d8fa;
    --violet-500: #7c3aed;
    --violet-600: #a855f7;
    --violet-700: #6d3fc0;
    /* chart annotations (docs/annotations/FRONTEND.md): context behind the data, never a series' hue */
    --annotation-google: #7c3aed;
    --annotation-google-fill: rgba(124, 58, 237, 0.07);
    --annotation-reshuffle: #d97706;
    --annotation-reshuffle-fill: rgba(245, 158, 11, 0.12);
    --annotation-event: #94a3b8;
    --annotation-note: #2160f5;
}

/* Dark theme (the React app: <html data-theme="dark">, set by static/js/theme.js before the first paint; the Django
   pages never set it). The brand sheet's Charcoal #0F172A and Navy as the canvas; the grey scale turned around (so
   text-gray-900 stays the strongest text); soft status and category backgrounds become dark tints with light text. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --shell-from: var(--brand-navy);
    --shell-to: var(--brand-charcoal);
    --shell-header: #0d1f4d;
    --text-primary: var(--gray-900);
    --primary-color: #3b7bff;
    --primary-dark: #60a5fa;
    --primary-darker: #1d4ed8;
    --primary-light: #60a5fa;
    --primary-subtle: #172a4a;
    --secondary-color: #7aa2f7;

    --success-color: #34d399;
    --success-dark: #34d399;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
    --info-color: #60a5fa;
    --success-subtle: #0f2e24;
    --success-text: #6ee7b7;
    --danger-subtle: #3b1719;
    --danger-text: #fca5a5;
    --warning-subtle: #3a2a0d;
    --warning-text: #fcd34d;
    --info-subtle: #172a4a;
    --info-text: #93c5fd;

    --cat-1-bg: #1c2b4f; --cat-1-fg: #93b4ff;
    --cat-2-bg: #2b1f4a; --cat-2-fg: #c4b5fd;
    --cat-3-bg: #113530; --cat-3-fg: #5eead4;
    --cat-4-bg: #3a2b10; --cat-4-fg: #fcd34d;
    --cat-5-bg: #3d1a2e; --cat-5-fg: #f9a8d4;
    --cat-6-bg: #14341f; --cat-6-fg: #86efac;
    --cat-7-bg: #3d2512; --cat-7-fg: #fdba74;
    --cat-8-bg: #22264d; --cat-8-fg: #a5b4fc;
    --cat-9-bg: #10323a; --cat-9-fg: #67e8f9;
    --brand-tint: #15213a;

    --gray-50: #151e30;
    --gray-100: #1b2537;
    --gray-200: #263147;
    --gray-300: #34405a;
    --gray-400: #5d6a82;
    --gray-500: #8a95aa;
    --gray-600: #a8b1c2;
    --gray-700: #c5ccd8;
    --gray-800: #dde2ea;
    --gray-900: #f1f4f9;

    --text-secondary: #9ba5b8;

    --bg-app: #0b1120;
    --bg-primary: #111a2c;
    --bg-white: #111a2c;
    --bg-light: #141d30;
    --light-bg: #141d30;

    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.4);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.45), 0 1px 2px -1px rgb(0 0 0 / 0.4);
    --shadow: 0 2px 4px 0 rgb(0 0 0 / 0.45);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.55), 0 4px 6px -4px rgb(0 0 0 / 0.45);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6), 0 8px 10px -6px rgb(0 0 0 / 0.5);

    --amber-100: #3a2a0d;
    --amber-300: #7c5a1a;
    --blue-50: #13213a;
    --blue-100: #1c2b55;
    --green-50: #0f2e24;
    --red-200: #4a1d1f;
    --violet-100: #241b3f;
    --violet-200: #33275a;
    --annotation-google: #a78bfa;
    --annotation-google-fill: rgba(167, 139, 250, 0.14);
    --annotation-reshuffle: #fbbf24;
    --annotation-reshuffle-fill: rgba(251, 191, 36, 0.16);
    --annotation-event: #64748b;
    --annotation-note: #3d7bff;
}

@media (max-width: 768px) {
    :root { --font-size-base: 0.8rem; --spacing-md: 10px; --spacing-lg: 14px; }
}
