/**
 * CSS Base Layer - Design Tokens & Base Styles
 *
 * Contains all design tokens (CSS custom properties) and base element styles
 * Load this file after setup.css
 *
 * @package WPAgent
 * @since 2.0.0 (CSS Architecture Refactor)
 */

@layer base {

  /* ==========================================================================
     Design Tokens - CSS Custom Properties
     ========================================================================== */

  :root {

    /* Primary Colors (Purple - Lavender Fields) */
    --primary-50: #f8fafc;
    --primary-100: #f1f5f9;
    --primary-300: #cbd5e1;
    --primary-400: #a78bfa;
    --primary-500: #8b5cf6;
    --primary-600: #7c3aed;
    --primary-700: #6d28d9;

    /* Neutral Colors (Grays) - Full palette */
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;

    /* Legacy gray scale aliases (for backward compatibility) */
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-900: #0f172a;

    /* Semantic Colors */
    --success-500: #22c55e;
    --success-100: #dcfce7;
    --success-700: #166534;

    --error-500: #ef4444;
    --error-100: #fee2e2;
    --error-700: #b91c1c;

    --warning-500: #f59e0b;
    --warning-100: #fef3c7;
    --warning-700: #d97706;

    --info-500: #3b82f6;
    --info-100: #dbeafe;
    --info-700: #1e40af;

    /* Border Radius Design Tokens */
    --radius-none: 0;
    --radius-sm: 0.25rem;
    /* 4px - Small inputs, badges */
    --radius-md: 0.5rem;
    /* 8px - Buttons, cards */
    --radius-lg: 0.75rem;
    /* 12px - Large cards, modals */
    --radius-xl: 1rem;
    /* 16px - Hero sections */
    --radius-2xl: 1.5rem;
    /* 24px - Large containers */
    --radius-pill: 9999px;
    /* Full rounded - Pills, avatars */

    /* Spacing Scale (consistent with Tailwind) */
    --spacing-0: 0;
    --spacing-1: 0.25rem;
    /* 4px */
    --spacing-2: 0.5rem;
    /* 8px */
    --spacing-3: 0.75rem;
    /* 12px */
    --spacing-4: 1rem;
    /* 16px */
    --spacing-5: 1.25rem;
    /* 20px */
    --spacing-6: 1.5rem;
    /* 24px */
    --spacing-8: 2rem;
    /* 32px */
    --spacing-10: 2.5rem;
    /* 40px */
    --spacing-12: 3rem;
    /* 48px */
    --spacing-16: 4rem;
    /* 64px */
    --spacing-20: 5rem;
    /* 80px */
    --spacing-24: 6rem;
    /* 96px */

    /* Typography Scale */
    --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 */
    --text-6xl: 3.75rem;
    /* 60px */
    --text-7xl: 4.5rem;
    /* 72px */

    /* Font Families (from Tailwind Design System) */
    --font-sans: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

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

    /* Line Heights */
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 1.75;

    /* Letter Spacing */
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;

    /* Shadows (aligned with Tailwind Design System) */
    --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);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
    /* Standard cards */
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    /* Card hover state */
    --shadow-button: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Button depth */

    /* 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: 100;
    --z-fixed: 200;
    --z-modal-backdrop: 500;
    --z-modal: 600;
    --z-popover: 700;
    --z-tooltip: 800;
    --z-toast: 900;

    /* Container Max Widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1536px;
  }


  /* ==========================================================================
     Base Element Styles
     ========================================================================== */

  /* Typography Base */
  body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--neutral-600);
    /* Body text color per design system */
  }

  /* Headings (use Plus Jakarta Sans) */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-family: var(--font-display);
    color: var(--neutral-800);
    /* Headings darker per design system */
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    margin-bottom: var(--spacing-4);
  }

  h1 {
    font-size: var(--text-4xl);
    letter-spacing: var(--tracking-tight);
  }

  h2 {
    font-size: var(--text-3xl);
    letter-spacing: var(--tracking-tight);
  }

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

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

  h5 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
  }

  h6 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
  }

  /* Paragraphs & Text */
  p {
    margin-bottom: var(--spacing-4);
  }

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

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

  a:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
  }

  /* Lists */
  ul,
  ol {
    margin-bottom: var(--spacing-4);
    padding-left: var(--spacing-6);
  }

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

  /* Code */
  code {
    font-family: 'Courier New', monospace;
    font-size: 0.875em;
    padding: 0.125rem 0.25rem;
    background-color: var(--neutral-100);
    border-radius: var(--radius-sm);
    color: var(--neutral-800);
  }

  pre {
    padding: var(--spacing-4);
    background-color: var(--neutral-900);
    color: var(--neutral-100);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: var(--spacing-4);
  }

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

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

  /* Horizontal Rule */
  hr {
    border: 0;
    border-top: 1px solid var(--neutral-200);
    margin: var(--spacing-8) 0;
  }

  /* Blockquote */
  blockquote {
    padding-left: var(--spacing-4);
    border-left: 4px solid var(--primary-500);
    color: var(--neutral-600);
    font-style: italic;
    margin-bottom: var(--spacing-4);
  }

  /* Tables */
  table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-4);
  }

  th {
    background-color: var(--neutral-100);
    padding: var(--spacing-3) var(--spacing-4);
    text-align: left;
    font-weight: var(--font-semibold);
    border-bottom: 2px solid var(--neutral-200);
  }

  td {
    padding: var(--spacing-3) var(--spacing-4);
    border-bottom: 1px solid var(--neutral-200);
  }

  /* Form Elements Base Styles */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="url"],
  input[type="tel"],
  input[type="number"],
  textarea,
  select {
    font-family: inherit;
    font-size: var(--text-base);
    padding: var(--spacing-2) var(--spacing-3);
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-md);
    background-color: white;
    color: var(--neutral-900);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  }

  input[type="text"]:focus,
  input[type="email"]:focus,
  input[type="password"]:focus,
  input[type="search"]:focus,
  input[type="url"]:focus,
  input[type="tel"]:focus,
  input[type="number"]:focus,
  textarea:focus,
  select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  }

  input::placeholder,
  textarea::placeholder {
    color: var(--neutral-400);
  }

  /* Disabled State */
  input:disabled,
  textarea:disabled,
  select:disabled {
    background-color: var(--neutral-50);
    color: var(--neutral-400);
    cursor: not-allowed;
  }

}

/**
 * Usage Notes:
 *
 * 1. GOOGLE FONTS REQUIRED:
 *    Add this to your <head> or enqueue in functions.php:
 *
 *    <link href="https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap" rel="stylesheet">
 *
 * 2. DESIGN TOKENS:
 *    All design tokens defined here should be used throughout the theme
 *    instead of hardcoded values.
 *
 *    Good:
 *      color: var(--primary-500);
 *      padding: var(--spacing-4);
 *      border-radius: var(--radius-md);
 *      font-family: var(--font-display);  /* For headings */
* box-shadow: var(--shadow-card);
* * Bad: * color: #8b5cf6;
* padding: 1rem;
* border-radius: 0.5rem;
* font-family: sans-serif;
* * 3. TYPOGRAPHY: * - Body text: Uses Rubik (var(--font-sans)) * - Headings: Uses Plus Jakarta Sans (var(--font-display)) * - Code: Uses JetBrains Mono (var(--font-mono)) * * 4. COLORS: * - Primary (purple): Use for CTAs,
brand elements * - Neutral: Body text (600),
headings (800) * - Semantic: success,
error,
warning,
info * * This ensures consistency and makes global design changes easy. */