/* Upland Hub Documentation - Style Sheet */

:root {
  --sage: #7C9082;
  --sage-light: #9AB0A0;
  --sage-dark: #5A6E60;
  --charcoal: #2A2A2A;
  --charcoal-light: #3A3A3A;
  --charcoal-lighter: #4A4A4A;
  --sand: #F5F0E8;
  --sand-dim: #E8E3DB;
  --sand-dark: #D4CFCA;
  --bg: #1E1E1E;
  --bg-sidebar: #242424;
  --bg-card: #2E2E2E;
  --bg-code: #1A1A1A;
  --text-primary: #F5F0E8;
  --text-secondary: #B8B3AB;
  --text-muted: #888580;
  --border: #3A3A3A;
  --border-light: #4A4A4A;
  --link: #9AB0A0;
  --link-hover: #B8CCC0;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--sage);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--charcoal);
}

.sidebar-logo-text {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sidebar-logo-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.sidebar-nav {
  padding: 1rem 0;
  flex: 1;
}

.sidebar-nav a {
  display: block;
  padding: 0.55rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  color: var(--text-primary);
  background: rgba(124, 144, 130, 0.08);
}

.sidebar-nav a.active {
  color: var(--sage-light);
  border-left-color: var(--sage);
  background: rgba(124, 144, 130, 0.12);
  font-weight: 500;
}

.sidebar-section-label {
  padding: 1.2rem 1.5rem 0.4rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sidebar-footer a {
  color: var(--sage-light);
  text-decoration: none;
}

.sidebar-footer a:hover {
  text-decoration: underline;
}

/* Hamburger */
.hamburger {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
}

.hamburger svg {
  width: 22px;
  height: 22px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 90;
}

/* Main Content */
.main {
  flex: 1;
  margin-left: 280px;
  max-width: 100%;
}

.content {
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 2.5rem 6rem;
}

/* Typography */
h1 {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  color: var(--sand);
}

.page-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--sand);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--sage-light);
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s;
}

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

strong {
  color: var(--sand);
  font-weight: 600;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Lists */
ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

li ul, li ol {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

/* Checklist */
.checklist {
  list-style: none;
  padding-left: 0;
}

.checklist li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.5rem;
}

.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 14px;
  height: 14px;
  border: 2px solid var(--sage);
  border-radius: 3px;
  background: transparent;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

thead th {
  background: var(--charcoal-light);
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-weight: 600;
  color: var(--sage-light);
  border-bottom: 2px solid var(--sage-dark);
  white-space: nowrap;
}

tbody td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:hover {
  background: rgba(124, 144, 130, 0.04);
}

/* Code */
code {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  color: var(--sage-light);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* Syntax highlighting - simple */
.kw { color: #C792EA; }
.str { color: #C3E88D; }
.cm { color: #676E95; }
.num { color: #F78C6C; }
.fn { color: #82AAFF; }
.op { color: #89DDFF; }
.prop { color: #F07178; }

/* Blockquotes */
blockquote {
  border-left: 3px solid var(--sage);
  padding: 0.75rem 1.25rem;
  margin: 1rem 0 1.5rem;
  background: rgba(124, 144, 130, 0.06);
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
}

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

/* Info/Note boxes */
.note {
  background: rgba(124, 144, 130, 0.1);
  border: 1px solid var(--sage-dark);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.note-label {
  font-weight: 600;
  color: var(--sage-light);
  margin-bottom: 0.25rem;
}

/* Agent cards */
.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.agent-card h3 {
  margin-top: 0;
  color: var(--sand);
}

.agent-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.agent-meta-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  border-radius: 4px;
  font-weight: 500;
}

.tag-model {
  background: rgba(199, 146, 234, 0.15);
  color: #C792EA;
}

.tag-credits {
  background: rgba(247, 140, 108, 0.15);
  color: #F78C6C;
}

.tag-plan {
  background: rgba(124, 144, 130, 0.2);
  color: var(--sage-light);
}

.tag-category {
  background: rgba(130, 170, 255, 0.15);
  color: #82AAFF;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 42px;
  height: 42px;
  background: var(--sage-dark);
  color: var(--sand);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--sage);
  transform: translateY(-2px);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* Landing page */
.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
}

.hero .page-subtitle {
  max-width: 600px;
  margin: 0 auto 2.5rem;
  font-size: 1.15rem;
}

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

.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.doc-card:hover {
  border-color: var(--sage);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  text-decoration: none;
  color: var(--text-primary);
}

.doc-card-icon {
  width: 44px;
  height: 44px;
  background: rgba(124, 144, 130, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.doc-card h3 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  color: var(--sand);
}

.doc-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
  flex: 1;
}

.doc-card-arrow {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--sage-light);
  font-weight: 500;
}

/* Quick stats on landing page */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin: 2rem 0 3rem;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--sage-light);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .hamburger {
    display: flex;
  }

  .main {
    margin-left: 0;
  }

  .content {
    padding: 4.5rem 1.25rem 4rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

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

  .stats-row {
    gap: 1.5rem;
  }

  .back-to-top {
    bottom: 1.25rem;
    right: 1.25rem;
  }

  pre {
    font-size: 0.8rem;
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 4rem 1rem 3rem;
  }

  .agent-meta {
    gap: 0.35rem;
  }
}
