/**
 * CSS Variables / Theme - Pixel Style
 * Global design tokens for the application
 */

/* ==================== PIXEL FONTS ==================== */

@font-face {
    font-family: "AlimamaShuHeiTi";
    font-weight: 700;
    src: url("//at.alicdn.com/wf/webfont/kfq1sgJFWQ6g/cPCrTL8ewntCCMPMNgo40.woff2") format("woff2"),
    url("//at.alicdn.com/wf/webfont/kfq1sgJFWQ6g/fu9Q_dW8qzsGtfSSU60a3.woff") format("woff");
    font-display: swap;
}

@font-face {
    font-family: 'ZCOOLQingKeHuangYou';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url(https://cdn.jsdelivr.net/fontsource/fonts/zcool-qingke-huangyou@latest/chinese-simplified-400-normal.woff2) format('woff2'),
    url(https://cdn.jsdelivr.net/fontsource/fonts/zcool-qingke-huangyou@latest/chinese-simplified-400-normal.woff) format('woff');
    unicode-range: U+4E00-9FFF;
}

:root {
    /* Primary Colors */
    --primary: #1a56db;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    
    /* Success Colors */
    --success: #10b981;
    --success-light: #34d399;
    --success-dark: #047857;
    --success-50: #f0fdf4;
    --success-100: #dcfce7;
    --success-200: #bbf7d0;
    --success-300: #86efac;
    --success-400: #4ade80;
    --success-500: #22c55e;
    --success-600: #16a34a;
    --success-700: #15803d;
    --success-800: #166534;
    --success-900: #14532d;
    
    /* Warning Colors */
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --warning-dark: #b45309;
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-200: #fde68a;
    --warning-300: #fcd34d;
    --warning-400: #fbbf24;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --warning-700: #b45309;
    --warning-800: #92400e;
    --warning-900: #78350f;
    
    /* Danger Colors */
    --danger: #ef4444;
    --danger-light: #f87171;
    --danger-dark: #b91c1c;
    --danger-50: #fef2f2;
    --danger-100: #fee2e2;
    --danger-200: #fecaca;
    --danger-300: #fca5a5;
    --danger-400: #f87171;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --danger-700: #b91c1c;
    --danger-800: #991b1b;
    --danger-900: #7f1d1d;
    
    /* Info Colors */
    --info: #6366f1;
    --info-light: #818cf8;
    --info-dark: #4338ca;
    --info-50: #eef2ff;
    --info-100: #e0e7ff;
    --info-200: #c7d2fe;
    --info-300: #a5b4fc;
    --info-400: #818cf8;
    --info-500: #6366f1;
    --info-600: #4f46e5;
    --info-700: #4338ca;
    --info-800: #3730a3;
    --info-900: #312e81;
    
    /* Background Colors */
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --bg-body: #0f172a;
    --bg-surface: #1e293b;
    --bg-elevated: #334155;
    --bg-overlay: rgba(15, 23, 42, 0.8);
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-disabled: #475569;
    
    /* Border Colors */
    --border: #475569;
    --border-light: #64748b;
    --border-dark: #334155;
    --border-accent: #1a56db;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    
    /* Typography - Pixel Fonts */
    --font-sans: 'AlimamaShuHeiTi', 'ZCOOLQingKeHuangYou', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;
    
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;
    
    /* Border Radius - PIXEL STYLE: 0 or 2px only */
    --radius-xs: 0;
    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --radius-xl: 0;
    --radius-2xl: 0;
    --radius-full: 0;
    
    /* Shadows - PIXEL STYLE: Hard edge shadows only */
    --shadow-sm: 2px 2px 0px rgba(0, 0, 0, 0.4);
    --shadow-md: 4px 4px 0px rgba(0, 0, 0, 0.5);
    --shadow-lg: 6px 6px 0px rgba(0, 0, 0, 0.6);
    --shadow-xl: 8px 8px 0px rgba(0, 0, 0, 0.7);
    --shadow-2xl: 10px 10px 0px rgba(0, 0, 0, 0.8);
    --shadow-inner: inset 2px 2px 0px rgba(0, 0, 0, 0.3);
    
    /* Pixel Button Shadows */
    --shadow-btn-raised: inset -2px -2px 0px var(--primary-dark), inset 2px 2px 0px var(--primary-light);
    --shadow-btn-pressed: inset 2px 2px 0px var(--primary-dark);
    --shadow-btn-success-raised: inset -2px -2px 0px var(--success-dark), inset 2px 2px 0px var(--success-light);
    --shadow-btn-success-pressed: inset 2px 2px 0px var(--success-dark);
    --shadow-btn-danger-raised: inset -2px -2px 0px var(--danger-dark), inset 2px 2px 0px var(--danger-light);
    --shadow-btn-danger-pressed: inset 2px 2px 0px var(--danger-dark);
    
    /* Card Hard Shadow */
    --shadow-card: 4px 4px 0px var(--bg-elevated);
    --shadow-card-hover: 6px 6px 0px var(--bg-elevated);
    
    /* Input Inner Shadow */
    --shadow-input: inset 2px 2px 0px rgba(0, 0, 0, 0.3);
    
    /* Transitions - SIMPLIFIED */
    --transition-fast: 50ms;
    --transition-normal: 100ms;
    --transition-slow: 150ms;
    --transition-slower: 200ms;
    
    --ease-default: linear;
    --ease-in: linear;
    --ease-out: linear;
    --ease-in-out: linear;
    --ease-bounce: linear;
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    
    /* Layout */
    --container-max: 1200px;
    --header-height: 64px;
    --sidebar-width: 260px;
    --footer-height: 80px;
    
    /* CA Brand Colors */
    --ca-letsencrypt: #0a9e73;
    --ca-zerossl: #1b3a4b;
    --ca-litesssl: #6366f1;
    
    /* Status Colors */
    --status-pending: #f59e0b;
    --status-processing: #3b82f6;
    --status-issued: #10b981;
    --status-renewing: #6366f1;
    --status-expired: #ef4444;
    --status-revoked: #6b7280;
    --status-failed: #ef4444;
}

/* Light Theme Support */
[data-theme="light"] {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-elevated: #f1f5f9;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-disabled: #94a3b8;
    
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    --border-dark: #e2e8f0;
    
    --shadow-sm: 2px 2px 0px rgba(0, 0, 0, 0.1);
    --shadow-md: 4px 4px 0px rgba(0, 0, 0, 0.15);
    --shadow-lg: 6px 6px 0px rgba(0, 0, 0, 0.2);
    --shadow-xl: 8px 8px 0px rgba(0, 0, 0, 0.25);
    --shadow-2xl: 10px 10px 0px rgba(0, 0, 0, 0.3);
    --shadow-inner: inset 2px 2px 0px rgba(0, 0, 0, 0.08);
    --shadow-card: 4px 4px 0px #e2e8f0;
    --shadow-card-hover: 6px 6px 0px #cbd5e1;
}

/* Dark Theme (Default) */
[data-theme="dark"],
:root {
    /* Already defined above */
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border: #94a3b8;
        --text-primary: #ffffff;
        --text-secondary: #e2e8f0;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    :root {
        --transition-fast: 0ms;
        --transition-normal: 0ms;
        --transition-slow: 0ms;
        --transition-slower: 0ms;
    }
}

/* Print Styles */
@media print {
    :root {
        --bg-dark: #ffffff;
        --bg-card: #ffffff;
        --bg-body: #ffffff;
        --text-primary: #000000;
        --text-secondary: #333333;
        --shadow-sm: none;
        --shadow-md: none;
        --shadow-lg: none;
        --shadow-xl: none;
        --shadow-2xl: none;
    }
}
