/* ================================
   Simply Nerdy - Main Styles
   Design System & Global Styles
   ================================ */

/* CSS Variables - Design System */
:root {
    /* Brand Colors */
    --primary: #E60012;           /* Bold red */
    --primary-dark: #B30010;      /* Darker red for hover states */
    --accent: #F2F2F2;            /* Light gray */

    /* Neutral Colors */
    --neutral-900: #0F1419;       /* Text primary */
    --neutral-800: #1A1F2E;       /* Text secondary */
    --neutral-700: #2A3142;       /* Dark gray */
    --neutral-600: #4A5568;       /* Medium gray */
    --neutral-400: #8892B0;       /* Light gray text */
    --neutral-200: #CBD5E0;       /* Border gray */
    --neutral-100: #F5F7FA;       /* Background light */

    /* Background Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F7FA;
    --bg-dark: #0F1419;

    /* Border */
    --border: #E0E6ED;
    --border-light: #F0F2F5;

    /* Typography */
    --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

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

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

    /* Spacing */
    --spacing-xs: 0.25rem;    /* 4px */
    --spacing-sm: 0.5rem;     /* 8px */
    --spacing-md: 1rem;       /* 16px */
    --spacing-lg: 1.5rem;     /* 24px */
    --spacing-xl: 2rem;       /* 32px */
    --spacing-2xl: 3rem;      /* 48px */
    --spacing-3xl: 4rem;      /* 64px */

    /* Border Radius */
    --radius-sm: 0.25rem;     /* 4px */
    --radius-md: 0.5rem;      /* 8px */
    --radius-lg: 0.75rem;     /* 12px */
    --radius-xl: 1rem;        /* 16px */

    /* 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: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

/* ================================
   Reset & Base Styles
   ================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--neutral-900);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================
   Typography
   ================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-bold);
    line-height: 1.2;
    color: var(--neutral-900);
    margin-bottom: var(--spacing-md);
}

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

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

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

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

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

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

p {
    margin-bottom: var(--spacing-md);
    color: var(--neutral-800);
}

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

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

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

code {
    font-family: var(--font-family-mono);
    font-size: 0.9em;
    background-color: var(--accent);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-sm);
}

pre {
    font-family: var(--font-family-mono);
    font-size: var(--text-sm);
    background-color: var(--neutral-900);
    color: var(--accent);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: var(--spacing-md);
}

pre code {
    background: none;
    padding: 0;
}

blockquote {
    border-left: 4px solid var(--primary);
    padding-left: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
    font-style: italic;
    color: var(--neutral-700);
}

/* ================================
   Utilities
   ================================ */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.section {
    padding: var(--spacing-3xl) 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-2xl);
}

.view-all {
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--primary);
    transition: transform var(--transition-fast);
}

.view-all:hover {
    transform: translateX(4px);
}

.page-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--spacing-3xl) 0;
    text-align: center;
}

.page-hero h1 {
    color: white;
    margin-bottom: var(--spacing-md);
}

.page-subtitle {
    font-size: var(--text-xl);
    color: rgba(255, 255, 255, 0.9);
    font-weight: var(--font-normal);
}

/* Visually hidden but accessible to screen readers */
.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;
}

/* ================================
   Loading States
   ================================ */

.loading {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--neutral-600);
}

.error {
    background-color: #FEE;
    border: 1px solid #FCC;
    color: #C00;
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    margin: var(--spacing-lg) 0;
}
