/**
 * CSS Custom Properties (Variables)
 * 
 * Unified design system variables for FreeconomyToday
 * 
 * @package FreeconomyToday
 * @subpackage CSS\Core
 */

:root {
  /* Design System Colors - Primary Brand Colors */
  --color-primary: #228B22;
  --color-primary-light: #32CD32;
  --color-primary-dark: #006400;
  --color-accent: #90EE90;
  
  /* Legacy Variable Names (for backward compatibility) */
  --primary-color: var(--color-primary);
  --primary-light: var(--color-primary-light);
  --primary-dark: var(--color-primary-dark);
  --accent-color: var(--color-accent);
  
  /* Semantic Colors */
  --color-text: #1a1a1a;
  --color-text-light: #4a5568;
  --color-text-muted: #718096;
  --color-background: #ffffff;
  --color-background-secondary: #f7fafc;
  --color-background-dark: #edf2f7;
  --color-border: #e2e8f0;
  
  /* Legacy Text/Background Variables (for backward compatibility) */
  --text-color: var(--color-text);
  --text-light: var(--color-text-light);
  --text-muted: var(--color-text-muted);
  --background-color: var(--color-background);
  --background-secondary: var(--color-background-secondary);
  --background-dark: var(--color-background-dark);
  --border-color: var(--color-border);
  
  /* Status Colors */
  --color-success: #38a169;
  --color-warning: #d69e2e;
  --color-error: #e53e3e;
  --color-info: #3182ce;
  
  /* Layout Variables */
  --header-height: 80px;
  --nav-height: 60px;
  --sidebar-width: 250px;
  --container-max-width: 1400px;
  
  /* Spacing System (8px base) */
  --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 Families */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-headings: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Typography Scale */
  --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;
  --font-weight-extrabold: 800;
  
  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;
  
  /* Border Radius */
  --radius-sm: 0.125rem;   /* 2px */
  --radius-base: 0.25rem;  /* 4px */
  --radius-md: 0.375rem;   /* 6px */
  --radius-lg: 0.5rem;     /* 8px */
  --radius-xl: 0.75rem;    /* 12px */
  --radius-2xl: 1rem;      /* 16px */
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --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);
  
  /* Glassmorphism Effects */
  --glass-background: rgba(255, 255, 255, 0.25);
  --glass-backdrop-filter: blur(10px);
  --glass-border: rgba(255, 255, 255, 0.18);
  
  /* Shadow System */
  --shadow-color: rgba(0, 0, 0, 0.1);
  
  /* Gradient System */
  --gradient-primary: linear-gradient(135deg, #228B22 0%, #32CD32 100%);
  --gradient-secondary: linear-gradient(135deg, #006400 0%, #228B22 100%);
  
  /* Legacy spacing and radius variables (for backward compatibility) */
  --section-padding: 2rem;
  --border-radius: 16px;
  --border-radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;
  
  /* Z-Index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1010;
  --z-fixed: 1020;
  --z-modal-backdrop: 1030;
  --z-modal: 1040;
  --z-popover: 1050;
  --z-tooltip: 1060;
  
  /* Responsive Breakpoints */
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --breakpoint-2xl: 1400px;
}

/* User Type Specific Variables */

/* Public Site Variables */
[data-user-type="public"] {
  --header-height: 80px;
  --nav-backdrop-filter: blur(10px);
  --show-branding: block;
  --show-marketing-cta: block;
  --footer-type: full;
  --container-max-width: 1200px;
  --enable-animated-background: true;
}

/* Authenticated User Variables */
[data-user-type="user"] {
  --header-height: 60px;
  --nav-background: var(--color-background);
  --nav-border: 1px solid var(--color-border);
  --show-branding: none;
  --show-user-menu: block;
  --footer-type: minimal;
  --container-max-width: 1400px;
  --enable-animated-background: false;
}

/* Admin User Variables */
[data-user-type="admin"] {
  --header-height: 60px;
  --nav-background: var(--color-background);
  --sidebar-enabled: true;
  --show-admin-tools: block;
  --show-system-status: block;
  --footer-type: minimal;
  --container-max-width: 1400px;
  --enable-animated-background: false;
  --admin-accent-color: #3182ce;
}

/* Authentication Pages */
[data-user-type="auth"] {
  --header-height: 60px;
  --nav-background: transparent;
  --show-minimal-nav: block;
  --center-content: true;
  --footer-type: legal;
  --container-max-width: 1200px;
  --enable-animated-background: true;
}

/* Dark Mode Support */
[data-theme="dark"] {
  --color-text: #ffffff;
  --color-text-light: #cbd5e0;
  --color-text-muted: #a0aec0;
  --color-background: #0a0e1a;
  --color-background-secondary: #1a202c;
  --color-background-dark: #2d3748;
  --color-border: #4a5568;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --glass-background: rgba(30, 41, 59, 0.25);
  --glass-border: rgba(148, 163, 184, 0.18);
  
  /* Update legacy variables for dark mode */
  --text-color: var(--color-text);
  --text-light: var(--color-text-light);
  --text-muted: var(--color-text-muted);
  --background-color: var(--color-background);
  --background-secondary: var(--color-background-secondary);
  --background-dark: var(--color-background-dark);
  --border-color: var(--color-border);
}

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