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

:root {
  --primary-color: #24292e;
  --accent-color: #0366d6;
  --background: #ffffff;
  --surface: #f6f8fa;
  --text: #24292e;
  --text-secondary: #586069;
  --border: #e1e4e8;
  --code-bg: #f6f8fa;
  --highlight-bg: #fff5b1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #c9d1d9;
    --accent-color: #58a6ff;
    --background: #0d1117;
    --surface: #161b22;
    --text: #c9d1d9;
    --text-secondary: #8b949e;
    --border: #30363d;
    --code-bg: #161b22;
    --highlight-bg: #3d2b00;
  }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header {
  background-color: var(--primary-color);
  color: #ffffff;
  padding: 3rem 2rem;
  text-align: center;
  border-bottom: 3px solid var(--accent-color);
}

header h1 {
  margin: 0 0 0.5rem;
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

header .subtitle {
  margin: 0;
  font-size: 1.25rem;
  opacity: 0.9;
  font-weight: 300;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

section {
  margin-bottom: 4rem;
}

section:last-child {
  margin-bottom: 2rem;
}

h2 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 1rem;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.5rem 0 0.75rem;
}

p {
  margin: 0 0 1rem;
  color: var(--text);
}

ul, ol {
  margin: 0 0 1rem;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.5rem;
  color: var(--text);
}

a {
  color: var(--accent-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  background-color: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
  color: var(--text);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background-color: var(--background);
  border: 1px solid var(--border);
}

thead {
  background-color: var(--surface);
}

th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  color: var(--text);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: var(--surface);
}

.highlight-box {
  background-color: var(--surface);
  border-left: 4px solid var(--accent-color);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}

.highlight-box h3 {
  margin-top: 0;
  color: var(--text);
}

.highlight-box ul {
  margin-bottom: 0;
}

article {
  margin-bottom: 2.5rem;
}

.capability, .use-case, .integration, .webhook-section, .getting-started-section {
  background-color: var(--surface);
  padding: 1.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.capability h3, .use-case h3, .integration h3, .webhook-section h3, .getting-started-section h3 {
  margin-top: 0;
  color: var(--accent-color);
}

.use-case .example {
  background-color: var(--background);
  border-left: 3px solid var(--accent-color);
  padding: 1rem;
  margin-top: 1rem;
  font-style: italic;
  color: var(--text-secondary);
  border-radius: 3px;
}

.example strong {
  color: var(--text);
  font-style: normal;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.resource {
  background-color: var(--surface);
  padding: 1.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.resource h3 {
  margin-top: 0;
  color: var(--accent-color);
  font-size: 1.25rem;
}

.resource ul {
  margin-bottom: 0;
}

footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  margin-top: 4rem;
}

footer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

  header .subtitle {
    font-size: 1rem;
  }

  main {
    padding: 1.5rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .resources-grid {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 0.9rem;
  }

  th, td {
    padding: 0.5rem;
  }
}

@media print {
  body {
    background-color: white;
    color: black;
  }

  header {
    background-color: #24292e;
    color: white;
    border-bottom: 3px solid #0366d6;
  }

  .highlight-box, .capability, .use-case, .integration, .webhook-section, .getting-started-section, .resource {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }

  a {
    color: #0366d6;
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  section {
    page-break-inside: avoid;
  }

  h2 {
    page-break-after: avoid;
  }

  h3 {
    page-break-after: avoid;
  }

  table {
    page-break-inside: avoid;
  }

  footer {
    background-color: #f9f9f9;
    border-top: 1px solid #ddd;
    margin-top: 2rem;
  }
}
