﻿/* ============================================================================
   CSS VARIABLES - THEME & DESIGN SYSTEM
   All colors, spacing, and sizing defined here for easy customization
   ============================================================================ */

:root {
    /* PRIMARY COLORS */
    --primary-color: #667eea;
    --primary-light: #8c9eff;
    --primary-dark: #4c5fc7;
    
    /* SECONDARY COLORS */
    --secondary-color: #764ba2;
    --secondary-light: #9d6bb5;
    --secondary-dark: #5a3a80;
    
    /* ACCENT & STATUS */
    --accent-color: #f39c12;
    --success-color: #27ae60;
    --warning-color: #e74c3c;
    --info-color: #3498db;
    
    /* UNIFIED THEME PALETTE (dark defaults) */
    --bg-darkest: #0a0a0a;
    --bg-darker: #1a1a1a;
    --bg-dark: #2a2a2a;
    --bg-light: #3a3a3a;
    --bg-lighter: #4a4a4a;
    --toolbar-bg: #2a2a2a;
    --toolbar-btn-bg: #3a3a3a;
    --toolbar-text: #e0e0e0;
    --text-on-darkest: #a8a8a8;
    --text-on-darker: #e0e0e0;
    --text-on-dark: #e0e0e0;
    --text-on-light: #f0f0f0;
    --text-on-lighter: #e8e8e8;
    --text-on-toolbar-btn: #e0e0e0;

    /* LAYOUT BACKGROUNDS (aliases) */
    --bg-primary: var(--toolbar-btn-bg);
    --bg-secondary: var(--toolbar-bg);
    --bg-tertiary: var(--bg-lighter);
    
    /* TEXT COLORS */
    --text-primary: var(--text-on-dark);
    --text-secondary: #b0b0b0;
    --text-color: var(--text-on-light);
    --text-dark: var(--toolbar-text);
    --text-light: var(--text-on-toolbar-btn);
    --text-muted: var(--text-secondary);
    --text-placeholder: var(--text-secondary);
    
    /* BORDERS & DIVIDERS */
    --border-color: #404040;
    --border-light: var(--border-color);
    --border-dark: var(--border-color);
    
    /* SHADOWS */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    
    /* SPACING SCALE */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* SIZING */
    --border-radius: 6px;
    --border-radius-sm: 4px;
    --border-radius-lg: 8px;
    --border-radius-round: 50%;
    
    /* TYPOGRAPHY */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'Courier New', Courier, monospace;
    --font-size-base: 14px;
    --font-size-sm: 12px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 20px;
    --font-size-3xl: 24px;
    
    --font-weight-normal: 400;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    --line-height: 1.5;
    --line-height-tight: 1.2;
    --line-height-loose: 1.8;
    
    /* TRANSITIONS */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
    
    /* Z-INDEX SCALE */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-bg: 900;
    --z-modal: 999;
    
    /* LAYOUT DIMENSIONS */
    --sidebar-width: 280px;
    --reference-width: 320px;
    --toolbar-height: 56px;
    --status-bar-height: 32px;
}

/* OS light preference only when user has not set a custom theme */
@media (prefers-color-scheme: light) {
    html:not([data-theme]) {
        --bg-darkest: #ffffff;
        --bg-darker: #f5f5f5;
        --bg-dark: #efefef;
        --bg-light: #e0e0e0;
        --bg-lighter: #d5d5d5;
        --toolbar-bg: #efefef;
        --toolbar-btn-bg: #ffffff;
        --toolbar-text: #2a2a2a;
        --text-on-darkest: #606060;
        --text-on-darker: #2a2a2a;
        --text-on-dark: #2a2a2a;
        --text-on-light: #1a1a1a;
        --text-on-lighter: #2a2a2a;
        --text-on-toolbar-btn: #2a2a2a;
        --text-primary: #2a2a2a;
        --text-secondary: #606060;
        --text-muted: #7f8c8d;
        --border-color: #c0c0c0;
    }
}

html[data-theme="custom"],
html[data-theme="preset"] {
    color-scheme: dark;
}
