/* ==========================================================================
   AETHER 2.0 Official Documentation Stylesheet
   Modern, Cyberpunk Obsidian, Developer-Focused Design System
   ========================================================================== */

:root {
  --bg-main: #060913;
  --bg-surface: #0b1120;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  --bg-code: #0a0f1d;
  
  --primary: #8b5cf6;
  --primary-light: #a78bfa;
  --primary-glow: rgba(139, 92, 246, 0.25);
  
  --accent: #22d3ee;
  --accent-light: #67e8f9;
  --accent-glow: rgba(34, 211, 238, 0.2);
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-highlight: rgba(139, 92, 246, 0.35);
  
  --sidebar-width: 290px;
  --toc-width: 230px;
  --header-height: 64px;
  
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.65;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(34, 211, 238, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* ==========================================================================
   Header Navbar
   ========================================================================== */
.docs-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: rgba(6, 9, 19, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-img {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: var(--primary-light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.search-section {
  flex: 1;
  max-width: 440px;
  margin: 0 24px;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-input-wrapper input {
  width: 100%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 36px 8px 36px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  background: rgba(15, 23, 42, 0.95);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: #1e293b;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  pointer-events: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link-cta {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.nav-link-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--primary-glow);
}

/* ==========================================================================
   Documentation Layout (Sidebar + Content + TOC)
   ========================================================================== */
.docs-layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
}

/* Left Sidebar Navigation */
.docs-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  padding: 24px 16px 40px 24px;
  border-right: 1px solid var(--border-subtle);
  background: rgba(6, 9, 19, 0.4);
}

.sidebar-group {
  margin-bottom: 24px;
}

.sidebar-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 10px;
}

.sidebar-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.08);
  font-weight: 600;
  border-left: 2px solid var(--accent);
}

.sidebar-link-badge {
  margin-left: auto;
  font-size: 0.62rem;
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Center Documentation Main Content */
.docs-content {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px 48px;
  max-width: 980px;
}

/* Right Table of Contents (Desktop) */
.docs-toc {
  width: var(--toc-width);
  min-width: var(--toc-width);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  padding: 32px 16px 40px 16px;
  font-size: 0.8rem;
}

.toc-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.toc-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 1px solid var(--border-subtle);
  padding-left: 12px;
}

.toc-link {
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  line-height: 1.4;
  transition: color 0.15s;
}

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

.toc-link.active {
  color: var(--accent);
  font-weight: 600;
}

/* ==========================================================================
   Documentation Typography & Elements
   ========================================================================== */
.docs-content h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.docs-content .lead-p {
  font-size: 1.12rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

.docs-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.docs-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: #f1f5f9;
}

.docs-content h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--accent-light);
}

.docs-content p {
  margin-bottom: 18px;
  color: var(--text-secondary);
  font-size: 0.96rem;
}

.docs-content strong {
  color: #ffffff;
}

.docs-content ul, .docs-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
  color: var(--text-secondary);
}

.docs-content li {
  margin-bottom: 8px;
}

.docs-content code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Callout Alert Boxes */
.callout {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 24px 0;
  border-left: 4px solid;
  font-size: 0.92rem;
}

.callout-note {
  background: rgba(15, 23, 42, 0.8);
  border-left-color: var(--accent);
  color: #e0f2fe;
}

.callout-tip {
  background: rgba(16, 185, 129, 0.08);
  border-left-color: var(--success);
  color: #d1fae5;
}

.callout-important {
  background: rgba(139, 92, 246, 0.08);
  border-left-color: var(--primary);
  color: #ede9fe;
}

.callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border-left-color: var(--warning);
  color: #fef3c7;
}

.callout-title {
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Code Snippet Container */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  margin: 20px 0 28px 0;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.code-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 500;
}

.code-lang-tag {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-size: 0.65rem;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.72rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.copy-btn.copied {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--success);
  color: var(--success);
}

pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.55;
  color: #e2e8f0;
}

/* Syntax Highlighting Colors */
.kwd { color: #f43f5e; font-weight: 600; } /* Keywords: let, fn, intent, return, if, while */
.typ { color: #38bdf8; } /* Types: Int, Float, String, Qubit */
.fn { color: #a78bfa; font-weight: 500; } /* Functions: println, spawn, superpose */
.str { color: #34d399; } /* Strings */
.num { color: #fbbf24; } /* Numbers */
.cmt { color: #64748b; font-style: italic; } /* Comments */
.op { color: #ec4899; } /* Operators */

/* Benchmark & Data Tables */
.docs-table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.4);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.docs-table th {
  background: rgba(15, 23, 42, 0.9);
  padding: 12px 16px;
  font-weight: 600;
  color: #f1f5f9;
  border-bottom: 1px solid var(--border-subtle);
}

.docs-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.docs-table tr:last-child td {
  border-bottom: none;
}

.docs-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge-win {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-lose {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Feature Cards Grid inside docs */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.feature-doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 20px;
  transition: all 0.2s ease;
}

.feature-doc-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.card-icon {
  font-size: 1.75rem;
  margin-bottom: 12px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Interactive Project Filter */
.project-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Responsive queries */
@media (max-width: 1200px) {
  .docs-toc {
    display: none;
  }
  .docs-content {
    max-width: 100%;
    padding: 32px 32px 64px 32px;
  }
}

@media (max-width: 840px) {
  .docs-sidebar {
    display: none; /* Mobile toggle drawer */
  }
  .docs-content {
    padding: 24px 16px 48px 16px;
  }
  .search-section {
    display: none;
  }
}
