/**
 * PYQ Master - Design System
 * Unified CSS Variables for consistent styling across the application
 * Mobile-first design tokens for native-like WebView app experience
 * 
 * Usage: Load FIRST before any other CSS (except reset/normalize)
 * Version: 1.0.0
 */

:root {
    /* ===================================
       COLOR SYSTEM
       =================================== */
    
    /* Primary Brand Colors */
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --primary-light: #6ea8fe;
    --primary-lighter: #cfe2ff;
    
    /* Semantic Colors */
    --success: #28a745;
    --success-dark: #1e7e34;
    --success-light: #71dd8a;
    
    --warning: #ffc107;
    --warning-dark: #ff9800;
    --warning-light: #ffe69c;
    
    --danger: #dc3545;
    --danger-dark: #c82333;
    --danger-light: #f1aeb5;
    
    --info: #17a2b8;
    --info-dark: #138496;
    --info-light: #9eeaf9;
    
    /* Neutral Grayscale */
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* Contextual Colors */
    --body-bg: #ffffff;
    --body-color: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --link-color: var(--primary);
    --link-hover-color: var(--primary-dark);
    
    /* ===================================
       SPACING SCALE
       =================================== */
    
    --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 */
    
    /* ===================================
       TYPOGRAPHY SCALE
       =================================== */
    
    /* Font Sizes (mobile-first, rem-based) */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 0.9375rem;  /* 15px */
    --text-md: 1rem;         /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.75rem;     /* 28px */
    --text-4xl: 2rem;        /* 32px */
    
    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    
    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;
    
    /* Letter Spacing */
    --tracking-tighter: -0.05em;
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;
    
    /* ===================================
       TOUCH TARGET SIZES
       =================================== */
    
    --touch-min: 44px;           /* WCAG minimum */
    --touch-comfortable: 48px;    /* Recommended */
    --touch-large: 56px;         /* Large buttons */
    
    /* ===================================
       BORDER RADIUS
       =================================== */
    
    --radius-none: 0;
    --radius-sm: 0.25rem;    /* 4px */
    --radius-base: 0.375rem; /* 6px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-2xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;   /* Pill shape */
    
    /* ===================================
       SHADOWS
       =================================== */
    
    --shadow-none: none;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-base: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15);
    
    /* ===================================
       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;
    --z-notification: 1080;
    
    /* ===================================
       TRANSITIONS
       =================================== */
    
    --transition-fast: 150ms;
    --transition-base: 200ms;
    --transition-slow: 300ms;
    --transition-slower: 500ms;
    
    --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);
    
    /* ===================================
       BREAKPOINTS (for reference)
       =================================== */
    
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --breakpoint-xxl: 1400px;
}

/* ===================================
   DARK MODE OVERRIDES
   =================================== */

[data-bs-theme="dark"] {
    /* Dark Mode Colors */
    --primary: #6ea8fe;
    --primary-dark: #3d8bfd;
    --primary-light: #9ec5fe;
    
    --success: #75b798;
    --warning: #ffda6a;
    --danger: #ea868f;
    --info: #6edff6;
    
    /* Neutral Grayscale (inverted) */
    --gray-100: #212529;
    --gray-200: #343a40;
    --gray-300: #495057;
    --gray-400: #6c757d;
    --gray-500: #adb5bd;
    --gray-600: #ced4da;
    --gray-700: #dee2e6;
    --gray-800: #e9ecef;
    --gray-900: #f8f9fa;
    
    /* Contextual Colors */
    --body-bg: #212529;
    --body-color: #adb5bd;
    --text-muted: #6c757d;
    --border-color: #495057;
    --link-color: var(--primary);
    --link-hover-color: var(--primary-light);
    
    /* Shadows (darker for dark mode) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-base: 0 1px 3px rgba(0, 0, 0, 0.4), 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.4), 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5), 0 10px 10px rgba(0, 0, 0, 0.3);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.6);
}

/* ===================================
   UTILITY CLASSES (Optional)
   =================================== */

/* Spacing Utilities */
.space-y-1 > * + * { margin-top: var(--space-1); }
.space-y-2 > * + * { margin-top: var(--space-2); }
.space-y-3 > * + * { margin-top: var(--space-3); }
.space-y-4 > * + * { margin-top: var(--space-4); }
.space-y-6 > * + * { margin-top: var(--space-6); }
.space-y-8 > * + * { margin-top: var(--space-8); }

/* Touch Target Utilities */
.touch-target {
    min-height: var(--touch-min);
    min-width: var(--touch-min);
}

.touch-target-comfortable {
    min-height: var(--touch-comfortable);
    min-width: var(--touch-comfortable);
}

/* Shadow Utilities */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-base { box-shadow: var(--shadow-base); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-none { box-shadow: var(--shadow-none); }

/* Radius Utilities */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-base { border-radius: var(--radius-base); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

