/* ==============================================================================
   CodeLearn AI - Design System & Base Styles
   ============================================================================== */

/* Design System: CSS Variables (T006)
   ============================================================================== */

:root {
  /* Colors - Primary Palette */
  --color-primary: #2563eb;
  /* Blue 600 */
  --color-primary-dark: #1e40af;
  /* Blue 800 */
  --color-primary-light: #dbeafe;
  /* Blue 100 */
  
  /* Colors - Secondary Palette */
  --color-secondary: #7c3aed;
  /* Purple 600 */
  --color-secondary-dark: #5b21b6;
  /* Purple 800 */
  --color-secondary-light: #ede9fe;
  /* Purple 100 */
  
  /* Colors - Neutral Palette */
  --color-background: #ffffff;
  --color-background-alt: #f9fafb;
  /* Gray 50 */
  --color-text: #111827;
  /* Gray 900 */
  --color-text-secondary: #6b7280;
  /* Gray 500 */
  --color-text-inverse: #ffffff;
  --color-border: #e5e7eb;
  /* Gray 200 */
  
  /* Colors - Semantic */
  --color-success: #10b981;
  /* Green 500 */
  --color-error: #ef4444;
  /* Red 500 */
  --color-warning: #f59e0b;
  /* Amber 500 */
  
  /* Typography - Font Families */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  
  /* Typography - Font Sizes (Mobile-First) */
  --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 */
  
  /* Typography - Line Heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* Spacing Scale (8px base) */
  --spacing-1: 0.5rem;
  /* 8px */
  --spacing-2: 1rem;
  /* 16px */
  --spacing-3: 1.5rem;
  /* 24px */
  --spacing-4: 2rem;
  /* 32px */
  --spacing-5: 2.5rem;
  /* 40px */
  --spacing-6: 3rem;
  /* 48px */
  --spacing-8: 4rem;
  /* 64px */
  --spacing-10: 5rem;
  /* 80px */
  --spacing-12: 6rem;
  /* 96px */
  
  /* Layout - Breakpoints (for reference in media queries) */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  
  /* Layout - Containers */
  --container-max-width: 1280px;
  --container-padding: var(--spacing-2);
  
  /* Effects - Border Radius */
  --radius-sm: 0.25rem;
  /* 4px */
  --radius-md: 0.5rem;
  /* 8px */
  --radius-lg: 1rem;
  /* 16px */
  --radius-full: 9999px;
  
  /* Effects - 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);
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;
  
  /* Z-Index Scale */
  --z-base: 0;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-modal-backdrop: 40;
  --z-modal: 50;
}

/* CSS Reset & Base Styles (T007)
   ============================================================================== */

/* Box Sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Reset Margins & Padding */
* {
  margin: 0;
  padding: 0;
}

/* HTML & Body */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

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

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

h3 {
  font-size: var(--font-size-xl);
}

p {
  margin-bottom: var(--spacing-2);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Lists */
ul,
ol {
  list-style: none;
}

/* Images */
img,
picture,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Buttons */
button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Forms */
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* Container Utility */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* Screen Reader Only Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Responsive Typography (Desktop)
   ============================================================================== */

@media (min-width: 768px) {
  :root {
    --font-size-3xl: 2.25rem;
    /* 36px */
    --font-size-4xl: 3rem;
    /* 48px */
    --font-size-5xl: 4rem;
    /* 64px */
  }

  h1 {
    font-size: var(--font-size-4xl);
  }

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

@media (min-width: 1024px) {
  :root {
    --font-size-5xl: 4.5rem;
    /* 72px */
    --container-padding: var(--spacing-4);
  }

  h1 {
    font-size: var(--font-size-5xl);
  }
}
