/**
 * SismeServer Design Tokens
 * Story 0.4 - Frontend Foundation
 *
 * Apple-inspired sobriété design system with CSS custom properties.
 * These tokens establish the foundation for all UI components.
 */

:root {
  /* ========================================
     COLOR SYSTEM
     ======================================== */

  /* Neutral Base Palette */
  --color-white: #ffffff;
  --color-gray-50: #f9fafb;   /* Background surfaces */
  --color-gray-100: #f3f4f6;  /* Subtle backgrounds */
  --color-gray-200: #e5e7eb;  /* Borders, dividers */
  --color-gray-300: #d1d5db;  /* Disabled states */
  --color-gray-600: #4b5563;  /* Body text */
  --color-gray-800: #1f2937;  /* Headings */
  --color-gray-900: #111827;  /* High emphasis text */
  --color-black: #000000;

  /* Functional Accent Colors (Status Only) */
  --color-success: #10b981;   /* 🟢 Running, success states */
  --color-warning: #f59e0b;   /* 🟡 Warning states */
  --color-error: #ef4444;     /* 🔴 Error, danger actions */
  --color-info: #3b82f6;      /* Primary actions, links */

  /* Semantic Color Mapping */
  --color-primary: var(--color-info);
  --color-bg: var(--color-white);
  --color-surface: var(--color-gray-50);
  --color-border: var(--color-gray-200);
  --color-text: var(--color-gray-900);
  --color-text-muted: var(--color-gray-600);

  /* ========================================
     SPACING SCALE (4px base unit)
     ======================================== */

  --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 */

  /* Component-specific spacing (Apple-style generous spacing) */
  --spacing-card-padding: var(--spacing-lg);      /* 24px */
  --spacing-section-padding: var(--spacing-2xl);  /* 48px */
  --spacing-page-padding: var(--spacing-xl);      /* 32px */

  /* ========================================
     TYPOGRAPHY SYSTEM
     ======================================== */

  /* Font Family (System font stack) */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Font Sizes */
  --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 Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* ========================================
     SHADOWS (Subtle, purposeful)
     ======================================== */

  --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 (Smooth, Apple-style)
     ======================================== */

  --transition-fast: 150ms ease-in-out;
  --transition-base: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;

  /* ========================================
     BORDER RADIUS
     ======================================== */

  --radius-sm: 0.25rem;   /* 4px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-full: 9999px;  /* Full rounded */

  /* ========================================
     Z-INDEX SCALE
     ======================================== */

  --z-base: 1;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-modal-overlay: 40;
  --z-modal: 50;
  --z-toast: 60;
}

/* ========================================
   GLOBAL BASE STYLES
   ======================================== */

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-surface);
}

/* Typography defaults */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  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); }
h4 { font-size: var(--font-size-lg); }

p {
  color: var(--color-text-muted);
  line-height: var(--line-height-normal);
}

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

a:hover {
  color: var(--color-info);
  opacity: 0.8;
}

/* Focus styles (accessibility) */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
