/* Import system-inspired fonts for a cleaner look that matches Letta docs */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');

/* Base styles with a digital parchment approach */
:root {
  --primary: #0707ac; /* Blue accent color from Letta */
  --background: #ffffff;
  --text: #111827;
  --text-light: #6b7280;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --border: #e5e7eb;
  --surface: #f9fafb;
  --code-bg: #f3f4f6;
  --max-width: 800px;
}

/* Dark mode variables */
:root.dark {
  --primary: #FF5533; /* Orange accent color from Letta */
  --background: #000000;
  --text: #f9fafb;
  --text-light: #9ca3af;
  --border: #374151;
  --surface: #111827;
  --code-bg: #1f2937;
}

/* System preference dark mode - will be overridden by manual selection */
@media (prefers-color-scheme: dark) {
  :root:not(.light):not(.dark) {
    --primary: #FF5533;
    --background: #000000;
    --text: #f9fafb;
    --text-light: #9ca3af;
    --border: #374151;
    --surface: #111827;
    --code-bg: #1f2937;
  }
}

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

/* HTML1.0-inspired but modern typography */
body {
  font-family: var(--sans);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--background);
  padding: 1rem;
  max-width: 100%;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Minimal header inspired by HTML 1.0 but clean */
header {
  margin: 2rem auto;
  max-width: var(--max-width);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

header h1 {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  letter-spacing: -0.03em;
}

header h1 .extension {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-left: auto;
}

nav a {
  font-family: var(--mono);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

nav a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Main content */
main {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Hero section - minimal and refined */
.hero-section {
  margin: 4rem 0;
  text-align: center;
}

.hero-section h1 {
  font-family: var(--mono);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--primary);
}

.hero-section p {
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 400;
  max-width: 32rem;
  margin: 0 auto 2rem;
  color: var(--text-light);
}

.cta-button a {
  font-family: var(--mono);
  display: inline-block;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.5rem 1.25rem;
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.cta-button a:hover {
  background-color: var(--primary);
  color: var(--background);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.3;
  margin: 2rem 0 1rem;
  color: var(--text);
}

h1 {
  font-size: 2rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1.5rem;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  opacity: 0.8;
}

/* Clean lists */
ul, ol {
  margin: 0 0 1.5rem 1rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Minimal, clean tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
  text-align: left;
}

th {
  font-weight: 600;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

/* Code blocks */
pre {
  background-color: var(--background);
  overflow-x: auto;
  margin: 0;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

pre code {
  display: block;
  padding: 1rem;
  color: var(--text);
  background: none;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

:not(pre) > code {
  background-color: var(--surface);
  padding: 0.2rem 0.3rem;
  font-family: var(--mono);
  font-size: 0.85rem;
}

/* Code group and tabs */
.code-group {
  margin: 1.5rem 0;
  border: none;
  background-color: var(--background);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.code-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background-color: var(--background);
}

.code-tab {
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.code-tab:hover {
  color: var(--text);
}

.code-tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  background-color: var(--background);
}

.code-group pre {
  margin: 0;
  border-radius: 0;
}

/* Schema sections */
.schema-section {
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin: 1rem 0 2rem;
  background: var(--surface);
}

/* Footer - simple and elegant */
footer {
  max-width: var(--max-width);
  margin: 4rem auto 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-light);
  font-size: 0.9rem;
  text-align: center;
}

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

/* Dark mode styles for code */
@media (prefers-color-scheme: dark) {
  .code-group,
  pre {
    background-color: var(--background);
  }
  
  .code-tab.active {
    background-color: var(--background);
  }
}

/* Theme toggle */
.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
}

.theme-toggle-button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 1.8rem;
  height: 1.8rem;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
  padding: 0;
  position: relative;
}

.theme-toggle-button:hover {
  background-color: var(--surface);
}

.material-symbols-outlined {
  font-variation-settings:
  'FILL' 1,
  'wght' 400,
  'GRAD' 0,
  'opsz' 24;
  font-size: 20px;
  line-height: 1;
}

.theme-toggle-button .theme-icon {
  display: none;
  font-size: 20px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Show system icon by default */
.theme-toggle-button #icon-system {
  display: block;
}

/* When light theme is active */
:root.light .theme-toggle-button #icon-light {
  display: block;
}

:root.light .theme-toggle-button #icon-system,
:root.light .theme-toggle-button #icon-dark {
  display: none;
}

/* When dark theme is active */
:root.dark .theme-toggle-button #icon-dark {
  display: block;
}

:root.dark .theme-toggle-button #icon-system,
:root.dark .theme-toggle-button #icon-light {
  display: none;
}

.theme-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: none;
  flex-direction: column;
  min-width: 8rem;
  z-index: 10;
}

.theme-dropdown.show {
  display: flex;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.theme-option .material-symbols-outlined {
  font-size: 18px;
  vertical-align: middle;
}

.theme-option:hover {
  background-color: var(--surface);
}

.theme-option.active {
  color: var(--primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    padding: 0.5rem;
  }
  
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  nav {
    width: 100%;
    gap: 1rem;
  }
  
  .theme-toggle {
    margin-left: auto;
  }
  
  .hero-section h1 {
    font-size: 2rem;
  }
}