/* ==========================================================================
   Base Styles
   CSS variables, reset, body/html, typography, dark theme variable overrides,
   system font stack
   ========================================================================== */

/* Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --color-bg: #f5f5f7;
    --color-surface: #ffffff;
    --color-primary: #5856d6;
    --color-primary-hover: #4745b5;
    --color-secondary: #6b7280;
    --color-text: #1f2937;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;

    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
}

/* Dark Theme */
[data-theme="dark"] {
    --color-bg: #0f1117;
    --color-surface: #1a1d29;
    --color-primary: #7c7aff;
    --color-primary-hover: #9896ff;
    --color-secondary: #9ca3af;
    --color-text: #e5e7eb;
    --color-text-muted: #9ca3af;
    --color-border: #2d3142;
    --color-success: #34d399;
    --color-warning: #fbbf24;
    --color-error: #f87171;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-bg: #0f1117;
        --color-surface: #1a1d29;
        --color-primary: #7c7aff;
        --color-primary-hover: #9896ff;
        --color-secondary: #9ca3af;
        --color-text: #e5e7eb;
        --color-text-muted: #9ca3af;
        --color-border: #2d3142;
        --color-success: #34d399;
        --color-warning: #fbbf24;
        --color-error: #f87171;

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    }
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}
