/**
 * Design Tokens - Foundation for DXfi Design System
 *
 * This file contains all design tokens (variables) used throughout the application.
 * All spacing, colors, typography, and other design values should reference these tokens.
 */

:root {
    /* ===== Color System ===== */

    /* Primary Colors */
    --color-primary: #1fddfe;
    --color-primary-dark: #0ea5e9;
    --color-primary-light: #67e8f9;
    --color-primary-darker: #0284c7;

    /* Secondary Colors */
    --color-secondary: #10b981;
    --color-secondary-dark: #059669;
    --color-secondary-light: #34d399;

    /* Status Colors */
    --color-success: #10b981;
    --color-success-dark: #059669;
    --color-success-light: #34d399;

    --color-danger: #ef4444;
    --color-danger-dark: #dc2626;
    --color-danger-light: #f87171;

    --color-warning: #f59e0b;
    --color-warning-dark: #d97706;
    --color-warning-light: #fbbf24;

    --color-info: #3b82f6;
    --color-info-dark: #2563eb;
    --color-info-light: #60a5fa;

    /* Neutral Colors (Dark Mode) */
    --color-background: #0a0e1a;
    --color-surface: #0f172a;
    --color-surface-elevated: #1e293b;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-light: rgba(255, 255, 255, 0.05);

    --color-text: rgba(255, 255, 255, 0.95);
    /* Improved: 0.9 → 0.95 for better contrast */
    --color-text-secondary: rgba(255, 255, 255, 0.75);
    /* Improved: 0.7 → 0.75 for better contrast */
    --color-text-tertiary: rgba(255, 255, 255, 0.6);
    /* Improved: 0.5 → 0.6 to meet WCAG AA (4.5:1) */
    --color-text-disabled: rgba(255, 255, 255, 0.3);

    /* Brand Colors */
    --dx-gold: #f4b73e;
    --dx-emerald: #10b981;

    /* ===== Spacing Scale (8px base) ===== */
    --space-0: 0;
    --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 */
    --space-20: 5rem;
    /* 80px */
    --space-24: 6rem;
    /* 96px */

    /* Legacy spacing (for gradual migration) */
    --spacing-xs: var(--space-1);
    --spacing-sm: var(--space-2);
    --spacing-md: var(--space-4);
    --spacing-lg: var(--space-6);
    --spacing-xl: var(--space-8);
    --spacing-2xl: var(--space-12);

    /* ===== Typography Scale ===== */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --font-family-mono: 'Courier New', 'Courier', monospace;

    /* Font Sizes */
    --font-size-xs: 0.75rem;
    /* 12px */
    --font-size-sm: 0.875rem;
    /* 14px */
    --font-size-base: 1rem;
    /* 16px */
    --font-size-lg: 1.125rem;
    /* 18px */
    --font-size-xl: 1.25rem;
    /* 20px */
    --font-size-2xl: 1.5rem;
    /* 24px */
    --font-size-3xl: 1.875rem;
    /* 30px */
    --font-size-4xl: 2.25rem;
    /* 36px */
    --font-size-5xl: 3rem;
    /* 48px */

    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Letter Spacing */
    --letter-spacing-tight: -0.02em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.02em;

    /* ===== Border Radius ===== */
    --radius-none: 0;
    --radius-sm: 0.25rem;
    /* 4px */
    --radius-md: 0.5rem;
    /* 8px */
    --radius-lg: 0.75rem;
    /* 12px */
    --radius-xl: 1rem;
    /* 16px */
    --radius-2xl: 1.5rem;
    /* 24px */
    --radius-full: 9999px;

    /* ===== Shadows ===== */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

    /* Colored Shadows */
    --shadow-primary: 0 10px 15px -3px rgba(31, 221, 254, 0.3), 0 4px 6px -2px rgba(31, 221, 254, 0.2);
    --shadow-success: 0 10px 15px -3px rgba(16, 185, 129, 0.3), 0 4px 6px -2px rgba(16, 185, 129, 0.2);
    --shadow-danger: 0 10px 15px -3px rgba(239, 68, 68, 0.3), 0 4px 6px -2px rgba(239, 68, 68, 0.2);

    /* ===== 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);
    --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Easing Functions */
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* ===== Z-Index Scale ===== */
    --z-base: 0;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;

    /* ===== Breakpoints ===== */
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;
}

/* ===== Light Mode Overrides ===== */
html.light {
    /* Neutral Colors (Light Mode) */
    --color-background: #ffffff;
    --color-surface: #f8fafc;
    --color-surface-elevated: #f1f5f9;
    --color-border: rgba(0, 0, 0, 0.1);
    --color-border-light: rgba(0, 0, 0, 0.05);

    --color-text: #0f172a;
    /* Slate 900 - Excellent contrast on white */
    --color-text-secondary: #334155;
    /* Slate 700 - Meets WCAG AA (4.5:1) on white */
    --color-text-tertiary: #475569;
    /* Slate 600 - Meets WCAG AA (4.5:1) on white, good for de-emphasized text */
    --color-text-disabled: #94a3b8;
    /* Slate 400 - Lower contrast for disabled state */

    /* Shadows (lighter in light mode) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ===== Utility Classes ===== */

/* Spacing Utilities */
.mt-0 {
    margin-top: var(--space-0);
}

.mt-1 {
    margin-top: var(--space-1);
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mb-0 {
    margin-bottom: var(--space-0);
}

.mb-1 {
    margin-bottom: var(--space-1);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.p-0 {
    padding: var(--space-0);
}

.p-1 {
    padding: var(--space-1);
}

.p-2 {
    padding: var(--space-2);
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

.p-8 {
    padding: var(--space-8);
}

/* Typography Utilities */
.text-xs {
    font-size: var(--font-size-xs);
}

.text-sm {
    font-size: var(--font-size-sm);
}

.text-base {
    font-size: var(--font-size-base);
}

.text-lg {
    font-size: var(--font-size-lg);
}

.text-xl {
    font-size: var(--font-size-xl);
}

.text-2xl {
    font-size: var(--font-size-2xl);
}

.text-3xl {
    font-size: var(--font-size-3xl);
}

.font-normal {
    font-weight: var(--font-weight-normal);
}

.font-medium {
    font-weight: var(--font-weight-medium);
}

.font-semibold {
    font-weight: var(--font-weight-semibold);
}

.font-bold {
    font-weight: var(--font-weight-bold);
}

/* Color Utilities */
.text-primary {
    color: var(--color-primary);
    /* Note: Primary color on dark backgrounds may need increased contrast */
    /* Use .text-primary-on-dark for better contrast on dark surfaces */
}

/* Ensure primary text has proper contrast on light backgrounds */
html.light .text-primary {
    color: var(--color-primary-dark, #0284c7);
    /* Use darker variant for better contrast on light backgrounds (4.5:1+) */
}

.text-primary-on-dark {
    color: var(--color-primary-light);
    /* Lighter variant for better contrast on dark */
}

.text-success {
    color: var(--color-success);
}

/* Ensure status colors have proper contrast on light backgrounds */
html.light .text-success {
    color: var(--color-success-dark, #059669);
    /* Use darker variant for better contrast on light backgrounds (5.2:1) */
}

.text-danger {
    color: var(--color-danger);
}

html.light .text-danger {
    color: var(--color-danger-dark, #dc2626);
    /* Use darker variant for better contrast on light backgrounds */
}

.text-warning {
    color: var(--color-warning);
}

html.light .text-warning {
    color: var(--color-warning-dark, #d97706);
    /* Use darker variant for better contrast on light backgrounds (4.7:1) */
}

.text-secondary {
    color: var(--color-text-secondary);
}

/* Transition Utilities */
.transition {
    transition: all var(--transition-base);
}

.transition-fast {
    transition: all var(--transition-fast);
}

.transition-slow {
    transition: all var(--transition-slow);
}
