/**
 * CSS Variables - Design System
 *
 * @package SeriesWiki
 */

:root {
    /* Colors - Light Mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f5;
    --bg-tertiary: #efefed;
    --bg-hover: rgba(0, 0, 0, 0.03);

    --text-primary: #37352f;
    --text-secondary: #787774;
    --text-tertiary: #9b9a97;

    --border: #e9e9e7;
    --border-hover: #d3d3d1;

    --accent: #2383e2;
    --accent-hover: #1a6bbd;

    --success: #0f7b6c;
    --warning: #e17b00;
    --error: #d44c47;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SF Mono", Monaco, "Cascadia Code", Menlo, monospace;

    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 0.9375rem;  /* 15px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.5rem;       /* 24px */
    --text-2xl: 2rem;        /* 32px */
    --text-3xl: 2.5rem;      /* 40px */

    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Spacing - Compact Notion-style */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-5: 1.25rem;  /* 20px */
    --space-6: 1.5rem;   /* 24px */
    --space-8: 2rem;     /* 32px */
    --space-10: 2.5rem;  /* 40px */
    --space-12: 3rem;    /* 48px */
    --space-16: 4rem;    /* 64px */

    /* Border Radius */
    --radius-sm: 3px;
    --radius-md: 4px;
    --radius-lg: 6px;
    --radius-xl: 8px;
    --radius-2xl: 12px;
    --radius-full: 9999px;

    /* Layout */
    --sidebar-width: 240px;
    --infobox-width: 280px;
    --content-max-width: 900px;
    --container-max-width: 1400px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #191919;
    --bg-secondary: #202020;
    --bg-tertiary: #2a2a2a;
    --bg-hover: rgba(255, 255, 255, 0.03);

    --text-primary: #e3e2e0;
    --text-secondary: #9b9a97;
    --text-tertiary: #6f6e69;

    --border: #373737;
    --border-hover: #4a4a4a;

    --accent: #5291f7;
    --accent-hover: #6ba3f8;

    --success: #4dab9a;
    --warning: #f5a15d;
    --error: #eb7871;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Auto dark mode based on system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #191919;
        --bg-secondary: #202020;
        --bg-tertiary: #2a2a2a;
        --bg-hover: rgba(255, 255, 255, 0.03);

        --text-primary: #e3e2e0;
        --text-secondary: #9b9a97;
        --text-tertiary: #6f6e69;

        --border: #373737;
        --border-hover: #4a4a4a;

        --accent: #5291f7;
        --accent-hover: #6ba3f8;

        --success: #4dab9a;
        --warning: #f5a15d;
        --error: #eb7871;

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.5);
    }
}

/* Breakpoints (for reference in media queries) */
/*
--mobile: 640px
--tablet: 768px
--desktop: 1024px
--wide: 1280px
--ultra: 1536px
*/
