/* ============================================
   DeBugExPress - Main Stylesheet
   Design System & Global Styles
   ============================================ */

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
  /* Primary Colors */
  --primary-base: #FF6B35;
  --primary-light: #FF8C5C;
  --primary-dark: #E55A2B;

  /* Secondary Colors */
  --secondary-base: #004E89;
  --secondary-light: #006BB3;
  --secondary-dark: #003A66;

  /* Accent Colors */
  --accent-base: #00D9FF;
  --accent-light: #33E3FF;
  --accent-dark: #00B8D4;

  /* Semantic Colors */
  --success: #00C853;
  --success-light: #00E676;
  --success-dark: #00A844;

  --warning: #FFC107;
  --warning-light: #FFD54F;
  --warning-dark: #FFA000;

  --error: #F44336;
  --error-light: #FF6659;
  --error-dark: #D32F2F;

  /* Neutrals */
  --white: #FFFFFF;
  --background: #FFFFFF;
  --surface: #F5F5F5;
  --surface-dark: #EEEEEE;

  --text-primary: #212121;
  --text-secondary: #757575;
  --text-tertiary: #9E9E9E;

  --border: #E0E0E0;
  --border-dark: #BDBDBD;

  --code-bg: #1E1E1E;
  --code-text: #F5F5F5;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, 'Monaco', monospace;

  /* Type Scale */
  --h1-size: 48px;
  --h1-line-height: 60px;
  --h1-weight: 700;
  --h1-letter-spacing: -0.02em;

  --h2-size: 36px;
  --h2-line-height: 44px;
  --h2-weight: 700;
  --h2-letter-spacing: -0.01em;

  --h3-size: 28px;
  --h3-line-height: 36px;
  --h3-weight: 700;
  --h3-letter-spacing: -0.01em;

  --h4-size: 22px;
  --h4-line-height: 30px;
  --h4-weight: 600;

  --h5-size: 18px;
  --h5-line-height: 26px;
  --h5-weight: 600;

  --body-large-size: 18px;
  --body-large-line-height: 28px;

  --body-size: 16px;
  --body-line-height: 24px;
  --body-weight: 400;

  --body-small-size: 14px;
  --body-small-line-height: 20px;

  --caption-size: 12px;
  --caption-line-height: 16px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
  --space-5xl: 128px;

  /* Component Spacing */
  --section-padding-y: var(--space-4xl);
  --section-padding-x: var(--space-lg);
  --card-padding: var(--space-lg);
  --button-padding-x: var(--space-xl);
  --button-padding-y: var(--space-md);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.16);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.15);
  --focus-ring: 0 0 0 3px rgba(255, 107, 53, 0.2);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Container */
  --container-max-width: 1200px;
  --container-padding: var(--space-lg);
}

/* ============================================
   CSS RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--body-size);
  line-height: var(--body-line-height);
  font-weight: var(--body-weight);
  color: var(--text-primary);
  background-color: var(--background);
}

/* Responsive Typography */
@media (max-width: 768px) {
  :root {
    --h1-size: 36px;
    --h1-line-height: 44px;
    --h2-size: 28px;
    --h2-line-height: 36px;
    --h3-size: 22px;
    --h3-line-height: 30px;
  }
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--h1-weight);
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: var(--h1-size);
  line-height: var(--h1-line-height);
  letter-spacing: var(--h1-letter-spacing);
}

h2 {
  font-size: var(--h2-size);
  line-height: var(--h2-line-height);
  letter-spacing: var(--h2-letter-spacing);
}

h3 {
  font-size: var(--h3-size);
  line-height: var(--h3-line-height);
  letter-spacing: var(--h3-letter-spacing);
}

h4 {
  font-size: var(--h4-size);
  line-height: var(--h4-line-height);
  font-weight: var(--h4-weight);
}

h5 {
  font-size: var(--h5-size);
  line-height: var(--h5-line-height);
  font-weight: var(--h5-weight);
}

p {
  margin-bottom: var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

.lead, .body-large {
  font-size: var(--body-large-size);
  line-height: var(--body-large-line-height);
}

.text-small, .body-small {
  font-size: var(--body-small-size);
  line-height: var(--body-small-line-height);
}

.caption {
  font-size: var(--caption-size);
  line-height: var(--caption-line-height);
}

/* Text Colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-white { color: var(--white); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.centered { text-align: center; }

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

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

/* Lists */
ul, ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

li {
  margin-bottom: var(--space-xs);
}

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

.section {
  padding-top: var(--section-padding-y);
  padding-bottom: var(--section-padding-y);
}

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }

/* Grid Utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-5 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-cols-3, .grid-cols-4, .grid-cols-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   CODE BLOCKS
   ============================================ */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.code-inline {
  display: inline-block;
  background: var(--surface);
  color: var(--primary-base);
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  margin-bottom: var(--space-lg);
}

pre code {
  display: block;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: var(--font-mono);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  line-height: 1.5;
  font-size: 14px;
}

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

/* ============================================
   UTILITIES
   ============================================ */
.hidden { display: none !important; }
.visible { display: block !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Margin Utilities */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

/* Padding Utilities */
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fade-in {
  animation: fadeIn var(--transition-base) ease forwards;
}

.animate-fade-in-up {
  animation: fadeInUp var(--transition-base) ease forwards;
}

.animate-slide-in-right {
  animation: slideInRight var(--transition-base) ease forwards;
}

/* ============================================
   SKIP LINK (Accessibility)
   ============================================ */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-base);
  color: white;
  padding: var(--space-sm) var(--space-md);
  z-index: 10000;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: block !important; }
  
  .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
}

@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
  .show-desktop { display: block !important; }
}
</css>