/* ===================================================================
   AxiomBlue Documentation Center
   Visual theme matched to the AxiomBlue Portal
   =================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-primary: #0a7a74;
  --color-primary-light: #0ec0b8;
  --color-primary-dark: #065f5a;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;
  --color-bg-page: #f8fafc;
  --color-bg-card: #ffffff;
  --color-bg-hover: #f1f5f9;
  --color-bg-active: #e2e8f0;
  --color-border: #e4e7ec;
  --color-border-light: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 45px rgba(15,23,42,0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --sidebar-width: 300px;
  --topbar-height: 64px;
  --sidebar-bg-start: #071427;
  --sidebar-bg-end: #0f1d35;
  --sidebar-text: #ffffff;
  --sidebar-text-muted: rgba(255,255,255,0.7);
  --sidebar-border: rgba(255,255,255,0.08);
  --sidebar-hover-bg: rgba(255,255,255,0.1);
  --sidebar-active-bg: rgba(255,255,255,0.15);
  --sidebar-accent: #0ec0b8;
  --content-max-width: 860px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--color-text);
  background: var(--color-bg-page);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Shell Layout --- */
.docs-shell {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.docs-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--sidebar-bg-start), var(--sidebar-bg-end));
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.sidebar-brand-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--sidebar-text);
  display: block;
}

.sidebar-brand-subtitle {
  font-size: 0.8rem;
  color: var(--sidebar-text-muted);
  display: block;
  margin-top: 1px;
}

/* Sidebar Search */
.sidebar-search {
  padding: 16px 20px 8px;
  position: relative;
  flex-shrink: 0;
}

.sidebar-search-icon {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sidebar-text-muted);
  pointer-events: none;
}

.sidebar-search-input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.sidebar-search-input::placeholder {
  color: var(--sidebar-text-muted);
}

.sidebar-search-input:focus {
  border-color: var(--sidebar-accent);
  background: rgba(14,192,184,0.06);
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.sidebar-section {
  margin-bottom: 4px;
}

.sidebar-section-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-align: left;
}

.sidebar-section-btn:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text);
}

.sidebar-section-btn.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text);
}

.sidebar-section-btn .section-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-section-btn .section-chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  opacity: 0.5;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.sidebar-section-btn.expanded .section-chevron {
  transform: rotate(90deg);
}

.sidebar-section-btn .section-tier {
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-left: 4px;
}

.sidebar-articles {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.sidebar-articles.expanded {
  grid-template-rows: 1fr;
}

.sidebar-articles-inner {
  overflow: hidden;
}

.sidebar-article-link {
  display: block;
  padding: 7px 12px 7px 42px;
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  font-weight: 400;
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-article-link:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text);
}

.sidebar-article-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text);
  font-weight: 500;
}

.sidebar-article-link.coming-soon {
  opacity: 0.4;
  cursor: default;
}

.sidebar-article-link.coming-soon:hover {
  background: transparent;
  color: rgba(255,255,255,0.7);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 20px 20px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sidebar-text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  padding: 8px 0;
  transition: color 0.2s;
}

.sidebar-footer-link:hover {
  color: var(--sidebar-accent);
}

/* --- Main Area --- */
.docs-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Topbar --- */
.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  padding: 0 40px;
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
}

.topbar-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-right: 12px;
}

.topbar-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: transform 0.2s;
}

.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  min-width: 0;
}

.breadcrumb-link {
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.breadcrumb-link:hover {
  color: var(--color-primary);
}

.breadcrumb-sep {
  color: var(--color-text-light);
  flex-shrink: 0;
}

.breadcrumb-current {
  color: var(--color-text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-action {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.topbar-action:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

/* --- Content --- */
.docs-content {
  flex: 1;
  padding: 40px;
  max-width: calc(var(--content-max-width) + 80px);
}

/* --- Article Styles --- */
.article {
  animation: fadeIn 0.2s ease;
}

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

.article-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.article-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
  background: rgba(14,192,184,0.1);
  color: var(--color-primary);
}

.article h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 8px;
}

.article-intro {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.article h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border-light);
}

.article h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 28px 0 12px;
}

.article p {
  margin-bottom: 16px;
  color: var(--color-text);
  line-height: 1.7;
}

.article ul, .article ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.article li {
  margin-bottom: 6px;
  line-height: 1.6;
}

.article strong {
  font-weight: 600;
  color: var(--color-text);
}

.article a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.article a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.article code {
  background: var(--color-bg-hover);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.875rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Screenshot Image */
.article-screenshot {
  margin: 24px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  background: var(--color-bg-card);
}

.article-screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

.article-screenshot figcaption {
  padding: 10px 16px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  background: var(--color-bg-hover);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

/* Callout Boxes */
.callout {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  font-size: 0.925rem;
  line-height: 1.6;
  display: flex;
  gap: 12px;
}

.callout-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.callout-content {
  flex: 1;
}

.callout-content p:last-child {
  margin-bottom: 0;
}

.callout-tip {
  background: rgba(14,192,184,0.08);
  border: 1px solid rgba(14,192,184,0.2);
  color: var(--color-text);
}

.callout-tip .callout-icon { color: var(--sidebar-accent); }

.callout-note {
  background: rgba(59,130,246,0.06);
  border: 1px solid rgba(59,130,246,0.15);
  color: var(--color-text);
}

.callout-note .callout-icon { color: #3b82f6; }

.callout-warning {
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.15);
  color: var(--color-text);
}

.callout-warning .callout-icon { color: #f59e0b; }

.callout-prereq {
  background: rgba(139,92,246,0.06);
  border: 1px solid rgba(139,92,246,0.15);
  color: var(--color-text);
}

.callout-prereq .callout-icon { color: #8b5cf6; }

/* Step Lists */
.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
  margin: 20px 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 48px;
  margin-bottom: 20px;
  min-height: 32px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Feature Grid (for welcome page) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.feature-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
  text-decoration: none;
  color: inherit;
}

.feature-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(14,192,184,0.1);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.feature-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.feature-card-desc {
  font-size: 0.825rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Article Navigation (prev/next) */
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.article-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  max-width: 48%;
  min-width: 0;
}

.article-nav-link:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.article-nav-link.next { margin-left: auto; text-align: right; }

.article-nav-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.article-nav-title {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Home Page --- */
.home-hero {
  text-align: center;
  padding: 48px 0 40px;
}

.home-hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-text), var(--color-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.home-hero p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto;
}

.home-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 40px 0 16px;
}

/* Tier Card (home page) */
.tier-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.tier-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.tier-card-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tier-card-body {
  min-width: 0;
}

.tier-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.tier-card-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.tier-card-count {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: 6px;
}

.tier-card-coming {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-text-light);
  background: var(--color-bg-hover);
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
  margin-top: 6px;
}

/* Search Results */
.search-results {
  padding: 4px 0;
}

.search-result-item {
  display: block;
  padding: 10px 20px;
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.search-result-item:hover {
  background: var(--sidebar-hover-bg);
}

.search-result-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--sidebar-text);
}

.search-result-section {
  font-size: 0.7rem;
  color: var(--sidebar-text-muted);
  margin-top: 2px;
}

.search-no-results {
  padding: 12px 20px;
  font-size: 0.85rem;
  color: var(--sidebar-text-muted);
  text-align: center;
}

/* --- Overlay (mobile) --- */
.docs-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
  backdrop-filter: blur(2px);
}

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

/* --- Responsive --- */
@media (max-width: 1023px) {
  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: min(78vw, 320px);
  }

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

  .docs-main {
    margin-left: 0;
  }

  .topbar-hamburger {
    display: flex;
  }

  .docs-topbar {
    padding: 0 16px;
  }

  .docs-content {
    padding: 24px 16px;
  }

  .article h1 { font-size: 1.6rem; }
  .article h2 { font-size: 1.2rem; }

  .home-hero h1 { font-size: 1.6rem; }

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

  .article-nav {
    flex-direction: column;
  }

  .article-nav-link { max-width: 100%; }
  .article-nav-link.next { text-align: left; }
}

/* --- Print --- */
@media print {
  .docs-sidebar, .docs-topbar, .article-nav, .sidebar-footer { display: none !important; }
  .docs-main { margin-left: 0 !important; }
  .docs-content { padding: 0 !important; max-width: 100% !important; }
  .article-screenshot { box-shadow: none !important; border: 1px solid #ddd !important; }
}
