/* ==========================================================================
   CSS Custom Properties (Variables)
   Central definition of all design tokens
   Load this file FIRST before all other CSS
   ========================================================================== */

:root {
    /* ===== Brand Colors ===== */
    --color-primary: #7611DA;
    --color-primary-hover: #6010b0;
    --color-primary-light: rgba(118, 17, 218, 0.1);
    --color-primary-dark: rgba(4, 57, 94, 1);

    /* ===== Neutral Colors ===== */
    --color-white: #FFFFFF;
    --color-black: #000000;
    --color-gray-50: #F8F9FA;
    --color-gray-100: #F5F5F5;
    --color-gray-200: #E9ECEF;
    --color-gray-300: #D9D9D9;
    --color-gray-400: #CFD4D9;
    --color-gray-500: #AEB6BF;
    --color-gray-600: #6C757D;
    --color-gray-700: #495057;
    --color-gray-800: #333333;
    --color-gray-900: #212529;

    /* ===== Semantic Colors ===== */
    --color-success: #5bb719;
    --color-success-light: #EAFFF6;
    --color-error: #ff0101;
    --color-error-light: #F3D8DB;
    --color-warning: #FF8832;
    --color-info: #56baed;

    /* ===== Background Colors ===== */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-tertiary: #F5F5F5;

    /* ===== Border Colors ===== */
    --border-color: #CFD4D9;
    --border-color-light: #E9ECEF;
    --border-color-dark: #D9D9D9;
    --border-color-accent: #D6BAF2;

    /* ===== Spacing Scale (based on 4px base unit) ===== */
    --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-7: 1.75rem;   /* 28px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */

    /* ===== Font Family ===== */
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'SF Pro Text', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Courier New', 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 Weights ===== */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* ===== Line Heights ===== */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.7;

    /* ===== Border Radius ===== */
    --radius-sm: 0.25rem;   /* 4px */
    --radius-md: 0.375rem;  /* 6px */
    --radius-lg: 0.5rem;    /* 8px */
    --radius-xl: 0.75rem;   /* 12px */
    --radius-full: 50%;

    /* ===== Shadows ===== */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 10px 30px rgba(0, 0, 0, 0.2);

    /* ===== Transitions ===== */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* ===== Z-Index Scale ===== */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;

    /* ===== Layout Widths ===== */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1536px;

    /* ===== Breakpoints (for reference in JS) ===== */
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;

    /* ===== Component-Specific Variables ===== */

    /* Sidebar */
    --sidebar-width: 250px;
    --sidebar-width-collapsed: 80px;
    --sidebar-bg: #F8F9FA;

    /* Header */
    --header-height: 4rem;

    /* Footer */
    --footer-height: 4rem;

    /* Buttons */
    --btn-height-sm: 36px;
    --btn-height-md: 40px;
    --btn-height-lg: 45px;

    /* Forms */
    --input-height: 45px;
    --input-border-width: 2px;

    /* DataTables */
    --table-header-bg: #f8f9fa;
    --table-border-color: #e9ecef;
    --table-hover-bg: #f8f9fa;
}

/* Dark mode support (future-proofing) */
@media (prefers-color-scheme: dark) {
    :root {
        /* Currently not implemented, but prepared for future */
        /* Uncomment when ready to support dark mode */
        /*
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --color-gray-800: #e0e0e0;
        */
    }
}

/* Reduced motion support (accessibility) */
@media (prefers-reduced-motion: reduce) {
    :root {
        --transition-fast: 0s;
        --transition-base: 0s;
        --transition-slow: 0s;
    }
}
