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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #fff;
  color: #1a1a2e;
  height: 100vh;
  overflow: hidden;
}

/* ── Outer layout (left nav + content) ── */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Left navigation ── */
.leftnav {
  width: 200px;
  flex-shrink: 0;
  background: #1a1a2e;
  display: flex;
  flex-direction: column;
  padding: 20px 12px 16px;
  gap: 4px;
  overflow: visible;
  z-index: 100;
}
.leftnav .logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 0 8px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 8px;
}
.leftnav nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.leftnav nav button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
  width: 100%;
}
.leftnav nav button:hover { background: rgba(255,255,255,0.08); color: #fff; }
.leftnav nav button.active { background: rgba(0,194,184,0.15); color: #00c2b8; }
.nav-group-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  padding: 14px 10px 4px;
}

/* ── Search box ── */
.search-box {
  position: relative;
  margin: 0 0 8px;
}
.search-box input {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 7px;
  color: #fff;
  font-size: 13px;
  padding: 7px 10px 7px 30px;
  outline: none;
  transition: border-color .15s, background .15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 9px center;
}
.search-box input::placeholder { color: rgba(255,255,255,0.35); }
.search-box input:focus {
  border-color: rgba(0,194,184,0.5);
  background-color: rgba(255,255,255,0.12);
}
.search-box input::-webkit-search-cancel-button { cursor: pointer; }

/* ── Search results dropdown (opens to the right of the nav) ── */
.search-results {
  position: absolute;
  top: 0;
  bottom: auto;
  left: calc(100% + 8px);
  width: 340px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 4px 4px 24px rgba(0,0,0,0.18);
  z-index: 999;
  overflow: hidden;
  max-height: 420px;
  overflow-y: auto;
}
.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background .1s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover,
.search-result-item.focused { background: #f0fffe; }
.search-result-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  border-radius: 4px;
  width: fit-content;
}
.badge-guides,
.badge-api        { background: #dbeafe; color: #1d4ed8; }
.badge-fleet-guides,
.badge-fleet-api  { background: #dcfce7; color: #15803d; }
.badge-integrations { background: #fef3c7; color: #92400e; }
.badge-api        { background: #ede9fe; color: #6d28d9; }
.search-result-title {
  font-size: 13.5px;
  font-weight: 500;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-result-sub {
  font-size: 12px;
  color: #6b7280;
}
.search-no-results {
  padding: 16px 14px;
  font-size: 13px;
  color: #9ca3af;
  text-align: center;
}

/* ── Main layout (article sidebar + panels) ── */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: #f8f9fc;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-section { padding: 16px 12px 4px; }
.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  padding: 0 8px;
  margin-bottom: 4px;
}
.sidebar a {
  display: block;
  padding: 6px 12px;
  font-size: 13.5px;
  color: #374151;
  text-decoration: none;
  border-radius: 6px;
  transition: all .12s;
  line-height: 1.4;
}
.sidebar a:hover { background: #eff0f6; color: #1a1a2e; }
.sidebar a.active { background: #e8f9f8; color: #00a89e; font-weight: 600; }

/* ── Content panels ── */
.panel {
  flex: 1;
  overflow: hidden;
  display: none;
}
.panel.visible { display: flex; flex-direction: column; }

/* Articles panel (all guide sections) */
#articles-panel .article-content,
#fleet-articles-panel .article-content,
#integrations-panel .article-content {
  flex: 1;
  overflow-y: auto;
  padding: 48px 64px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

/* API Reference panel */
#api-panel,
#fleet-api-panel { overflow: hidden; flex: 1; min-height: 0; }
#api-panel elements-api,
#fleet-api-panel elements-api { flex: 1; height: 100%; display: block; min-height: 0; }

/* ── Article typography ── */
.article-content h1 { font-size: 28px; font-weight: 700; margin-bottom: 12px; color: #111; line-height: 1.3; }
.article-content h2 { font-size: 20px; font-weight: 600; margin: 32px 0 10px; color: #111; border-bottom: 1px solid #e5e7eb; padding-bottom: 6px; }
.article-content h3 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; color: #111; }
.article-content h4 { font-size: 14px; font-weight: 600; margin: 20px 0 6px; color: #111; }
.article-content p { font-size: 14.5px; line-height: 1.75; color: #374151; margin-bottom: 14px; }
.article-content ul, .article-content ol { padding-left: 22px; margin-bottom: 14px; list-style-position: outside; }
.article-content ul { list-style-type: disc; }
.article-content ol { list-style-type: decimal; }
.article-content ul ul { list-style-type: circle; }
.article-content li { font-size: 14.5px; line-height: 1.7; color: #374151; margin-bottom: 4px; }
.article-content code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: "SF Mono", "Fira Code", monospace;
  color: #c0392b;
}
.article-content pre {
  background: #1e1e2e;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
  overflow-x: auto;
  position: relative;
}
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  line-height: 1;
  transition: background .15s, color .15s, opacity .15s;
  opacity: 0;
}
.article-content pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.copy-btn.copied { background: rgba(0,194,184,0.25); border-color: rgba(0,194,184,0.4); color: #00c2b8; opacity: 1; }
.article-content pre code {
  background: transparent;
  color: #cdd6f4;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
}
.article-content blockquote {
  border-left: 4px solid #00c2b8;
  background: #f0fafa;
  padding: 10px 16px;
  margin-bottom: 14px;
  border-radius: 0 6px 6px 0;
}
.article-content blockquote p { color: #374151; margin-bottom: 0; }
.article-content table { border-collapse: collapse; width: 100%; margin-bottom: 16px; font-size: 14px; }
.article-content th { background: #f3f4f6; padding: 8px 12px; text-align: left; font-weight: 600; border: 1px solid #e5e7eb; }
.article-content td { padding: 8px 12px; border: 1px solid #e5e7eb; vertical-align: top; }
.article-content a { color: #00a89e; text-decoration: none; }
.article-content a:hover { text-decoration: underline; }
.article-content img { max-width: 56px; border-radius: 8px; margin: 12px 0; display: block; }
.article-content hr { border: none; border-top: 1px solid #e5e7eb; margin: 24px 0; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* ── Hide Stoplight branding ── */
elements-api a[href*="stoplight.io"] { display: none !important; }

/* ── Home page ── */
#home-panel {
  flex: 1;
  overflow-y: auto;
  background: #fff;
}
.home-hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  color: #fff;
  padding: 80px 64px 72px;
  text-align: center;
}
.home-hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,194,184,0.15);
  border: 1px solid rgba(0,194,184,0.3);
  color: #00c2b8;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 24px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.home-hero h1 {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 18px;
  letter-spacing: -1px;
}
.home-hero h1 span { color: #00c2b8; }
.home-hero p {
  font-size: 17px;
  color: rgba(255,255,255,0.72);
  max-width: 580px;
  margin: 0 auto 36px;
  line-height: 1.7;
}
.home-hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.home-hero-ctas button {
  padding: 11px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  border: none;
}
.btn-primary { background: #00c2b8; color: #1a1a2e; }
.btn-primary:hover { background: #00d4c8; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,194,184,0.35); }
.btn-secondary { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2) !important; }
.btn-secondary:hover { background: rgba(255,255,255,0.18); transform: translateY(-1px); }

.home-body { max-width: 1040px; margin: 0 auto; padding: 56px 40px 80px; }

/* ── Quick-start cards ── */
.home-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-bottom: 20px;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 52px;
}
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 22px 24px;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  display: block;
}
.card:hover { border-color: #00c2b8; box-shadow: 0 4px 20px rgba(0,0,0,0.07); transform: translateY(-2px); }
.card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}
.card-icon.teal   { background: #e8f9f8; }
.card-icon.blue   { background: #eff6ff; }
.card-icon.purple { background: #f5f3ff; }
.card-icon.amber  { background: #fffbeb; }
.card h3 { font-size: 15px; font-weight: 600; color: #111; margin-bottom: 6px; }
.card p  { font-size: 13px; color: #6b7280; line-height: 1.55; }

/* ── Endpoints quick list ── */
.endpoints-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  margin-bottom: 52px;
}
.ep-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all .12s;
  background: #fafafa;
}
.ep-row:hover { background: #f0fafa; border-color: #00c2b8; }
.method-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  min-width: 40px;
  text-align: center;
  letter-spacing: 0.04em;
}
.method-get    { background: #dcfce7; color: #166534; }
.method-post   { background: #dbeafe; color: #1e40af; }
.method-put    { background: #fef9c3; color: #854d0e; }
.method-patch  { background: #ffedd5; color: #9a3412; }
.method-delete { background: #fee2e2; color: #991b1b; }
.ep-path    { font-size: 13px; font-family: "SF Mono","Fira Code",monospace; color: #374151; flex: 1; }
.ep-summary { font-size: 12px; color: #9ca3af; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .article-content { padding: 24px 20px; }
  .home-hero { padding: 48px 24px; }
  .home-hero h1 { font-size: 30px; }
  .home-body { padding: 32px 20px 60px; }
}
