/* =========================================================
   Base-Theme Docs — Shared Stylesheet
   ========================================================= */

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

:root {
  --bg:        #0d0d1a;
  --surface:   #1a1a2e;
  --elevated:  #16213e;
  --border:    rgba(255,255,255,0.08);
  --accent:    #4f8ef7;
  --accent2:   #7c6af7;
  --success:   #10b981;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --text:      #f1f5f9;
  --text-muted:#94a3b8;
  --text-dim:  #64748b;
  --code-bg:   #0f1629;
  --radius:    10px;
  --radius-sm: 6px;
  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sidebar-w: 260px;
  --header-h:  60px;
  --trans:     0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Links ─────────────────────────────────────────────── */
a { color: var(--accent); text-decoration: none; }
a:hover { color: #7db4ff; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: #2d3f6a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(13,13,26,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  z-index: 1000;
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  white-space: nowrap;
}
.site-header .logo .badge {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.site-header nav { display: flex; align-items: center; gap: 4px; }

.site-header nav a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--trans);
  white-space: nowrap;
}
.site-header nav a:hover,
.site-header nav a.active {
  color: var(--text);
  background: var(--elevated);
}
.site-header nav a.active { color: var(--accent); }

.site-header .header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.site-header .gh-link {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-size: 13px;
  border: 1px solid var(--border);
  padding: 5px 12px; border-radius: var(--radius-sm);
  transition: all var(--trans);
}
.site-header .gh-link:hover { color: var(--text); border-color: var(--accent); }

/* ── Layout ─────────────────────────────────────────────── */
.docs-layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.docs-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
}

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

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 8px 20px 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 20px;
  font-size: 13.5px;
  color: var(--text-muted);
  transition: all var(--trans);
  border-left: 2px solid transparent;
}
.sidebar-link:hover { color: var(--text); background: rgba(79,142,247,0.06); }
.sidebar-link.active { color: var(--accent); border-left-color: var(--accent); background: rgba(79,142,247,0.08); }
.sidebar-link .icon { width: 16px; text-align: center; opacity: 0.7; }

/* ── Main Content ─────────────────────────────────────────── */
.docs-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 48px 60px;
  max-width: 960px;
}

@media (max-width: 900px) {
  .docs-sidebar { display: none; }
  .docs-main { margin-left: 0; padding: 24px 20px; }
}

/* ── Hero / Page Title ──────────────────────────────────── */
.page-hero {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.page-hero .eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 12px;
}
.page-hero h1 {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(135deg, #f1f5f9 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
}
.page-hero p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 580px;
  line-height: 1.7;
}

/* ── Section ─────────────────────────────────────────────── */
.docs-section {
  margin-bottom: 56px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.docs-section h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.docs-section h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 22px;
  background: linear-gradient(to bottom, var(--accent), var(--accent2));
  border-radius: 2px;
  flex-shrink: 0;
}
.docs-section .section-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
  margin-top: 4px;
}

.docs-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 28px 0 12px;
}

.docs-section p {
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.7;
}

.docs-section ul, .docs-section ol {
  color: var(--text-muted);
  padding-left: 20px;
  margin-bottom: 16px;
}
.docs-section li { margin-bottom: 6px; line-height: 1.6; }
.docs-section li code { color: var(--accent2); }

/* ── Code ─────────────────────────────────────────────────── */
code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--code-bg);
  color: #a78bfa;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(167,139,250,0.15);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 20px;
  position: relative;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: #c9d1d9;
  font-size: 13.5px;
  line-height: 1.7;
}
pre .comment { color: #6e7681; }
pre .string  { color: #a5d6ff; }
pre .keyword { color: #ff7b72; }
pre .number  { color: #79c0ff; }
pre .fn      { color: #d2a8ff; }

.code-block { position: relative; }
.code-block .copy-btn {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans);
  font-family: var(--font);
}
.code-block .copy-btn:hover { color: var(--text); border-color: var(--accent); }
.code-block .copy-btn.copied { color: var(--success); border-color: var(--success); }

/* ── Table ─────────────────────────────────────────────────── */
.docs-table-wrap { overflow-x: auto; margin-bottom: 24px; border-radius: var(--radius); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--elevated);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 16px;
  text-align: left;
  white-space: nowrap;
}
tbody td { padding: 10px 16px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 14px; }
tbody td:first-child code { color: var(--accent); }
tbody tr:hover td { background: rgba(79,142,247,0.04); }

/* ── Callout ─────────────────────────────────────────────── */
.callout {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  border-left: 3px solid;
  font-size: 14px;
  line-height: 1.6;
}
.callout-info { background: rgba(79,142,247,0.08); border-color: var(--accent); color: #93c5fd; }
.callout-warn { background: rgba(245,158,11,0.08); border-color: var(--warning); color: #fcd34d; }
.callout-success { background: rgba(16,185,129,0.08); border-color: var(--success); color: #6ee7b7; }
.callout strong { color: inherit; font-weight: 700; }

/* ── Badge ─────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-right: 4px;
}
.tag-blue { background: rgba(79,142,247,0.15); color: var(--accent); }
.tag-purple { background: rgba(124,106,247,0.15); color: #a78bfa; }
.tag-green { background: rgba(16,185,129,0.12); color: var(--success); }
.tag-yellow { background: rgba(245,158,11,0.12); color: var(--warning); }

/* ── Stack / Architecture cards ──────────────────────────── */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stack-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: all var(--trans);
}
.stack-card:hover { border-color: rgba(79,142,247,0.4); background: var(--elevated); }
.stack-card .sc-label { font-size: 11px; color: var(--text-dim); font-weight: 600; text-transform: uppercase; margin-bottom: 4px; }
.stack-card .sc-value { font-size: 14px; font-weight: 600; color: var(--text); }
.stack-card .sc-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Sass arch tree ──────────────────────────────────────── */
.file-tree {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-muted);
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  overflow-x: auto;
}
.file-tree .file-entry { color: var(--text-muted); }
.file-tree .file-highlight { color: #a78bfa; font-weight: 600; }
.file-tree .file-note { color: var(--text-dim); font-style: italic; }
.file-tree .file-root { color: var(--accent); font-weight: 700; }

/* ── Color Swatches ──────────────────────────────────────── */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.color-swatch {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.color-swatch .swatch-color { height: 60px; }
.color-swatch .swatch-info { padding: 10px 12px; background: var(--surface); }
.color-swatch .swatch-name { font-size: 13px; font-weight: 600; color: var(--text); }
.color-swatch .swatch-hex { font-size: 11px; font-family: var(--font-mono); color: var(--text-muted); }
.color-swatch .swatch-classes { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ── Breakpoint display ──────────────────────────────────── */
.bp-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.bp-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
}
.bp-key { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--accent); width: 36px; }
.bp-val { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.bp-prefixes { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }

/* ── Framework page specific ──────────────────────────────── */
.framework-layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

.framework-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 0;
}

.cat-filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all var(--trans);
  border-left: 2px solid transparent;
}
.cat-filter-btn:hover { color: var(--text); background: rgba(79,142,247,0.06); }
.cat-filter-btn.active { color: var(--accent); border-left-color: var(--accent); background: rgba(79,142,247,0.1); }
.cat-filter-btn .cat-count {
  margin-left: auto;
  font-size: 11px;
  background: var(--elevated);
  padding: 1px 7px;
  border-radius: 20px;
  color: var(--text-dim);
}
.cat-filter-btn.active .cat-count { background: rgba(79,142,247,0.2); color: var(--accent); }

/* ── Search Area ─────────────────────────────────────────── */
.framework-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.search-header {
  position: sticky;
  top: var(--header-h);
  z-index: 900;
  background: rgba(13,13,26,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 20px 40px;
}

.search-box-wrap {
  position: relative;
  max-width: 700px;
}
.search-icon {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 18px;
  pointer-events: none;
}
#searchInput {
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 14px 20px 14px 48px;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: all var(--trans);
}
#searchInput::placeholder { color: var(--text-dim); }
#searchInput:focus {
  border-color: var(--accent);
  background: var(--elevated);
  box-shadow: 0 0 0 4px rgba(79,142,247,0.12);
}

.search-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.search-hint span { cursor: pointer; padding: 2px 10px; border: 1px solid var(--border); border-radius: 20px; transition: all var(--trans); }
.search-hint span:hover { border-color: var(--accent); color: var(--accent); }

.search-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 10px;
  height: 18px;
}

/* ── Results Area ─────────────────────────────────────────── */
.results-area { padding: 24px 40px 60px; flex: 1; }

/* ── Class Card ──────────────────────────────────────────── */
.class-category-group { margin-bottom: 40px; }
.class-category-group h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.class-category-group h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.class-cards { display: flex; flex-direction: column; gap: 10px; }

.class-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--trans);
}
.class-card:hover { border-color: rgba(79,142,247,0.3); }

.class-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
}

.class-name-badge {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: #a78bfa;
  background: rgba(167,139,250,0.1);
  border: 1px solid rgba(167,139,250,0.2);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
}
.class-name-badge.is-pattern { color: #4f8ef7; background: rgba(79,142,247,0.1); border-color: rgba(79,142,247,0.2); }

.class-card-desc { font-size: 13.5px; color: var(--text-muted); flex: 1; line-height: 1.4; }

.class-card-actions { display: flex; gap: 6px; flex-shrink: 0; margin-left: auto; }

.btn-copy {
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans);
  font-family: var(--font);
  white-space: nowrap;
}
.btn-copy:hover { color: var(--text); border-color: var(--accent); }
.btn-copy.copied { color: var(--success); border-color: var(--success); }

.class-card-body {
  border-top: 1px solid var(--border);
  padding: 0 18px 16px;
  display: none;
}
.class-card-body.open { display: block; }

.class-card-body .css-out {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #86efac;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 14px;
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

.class-card-body .responsive-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.resp-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 4px;
  background: rgba(79,142,247,0.08);
  border: 1px solid rgba(79,142,247,0.15);
  color: #7db4ff;
}
.resp-tag .bp-note { color: var(--text-dim); }

.class-card-body .range-info {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}
.class-card-body .range-info strong { color: var(--text-muted); }

.class-card-body .values-list {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}
.values-list .val-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* Pattern number input */
.pattern-demo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.pattern-demo label { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.pattern-demo input[type="number"] {
  width: 80px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
}
.pattern-demo input[type="number"]:focus { border-color: var(--accent); }
.pattern-demo .pattern-result {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #a78bfa;
  font-weight: 700;
  flex: 1;
}
.pattern-demo .pattern-css-result {
  font-size: 12px;
  color: #86efac;
}

/* ── Empty / Loading states ──────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-dim);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── Stats Row ──────────────────────────────────────────── */
.stats-row {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.stat-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 14px;
  font-size: 13px;
}
.stat-chip .s-num { font-weight: 700; color: var(--accent); font-size: 15px; }
.stat-chip .s-lbl { color: var(--text-dim); }

/* ── Responsive for framework ─────────────────────────────── */
@media (max-width: 900px) {
  .framework-sidebar { display: none; }
  .framework-main { margin-left: 0; }
  .search-header, .results-area { padding-left: 20px; padding-right: 20px; }
}

/* ── Utility Highlight ──────────────────────────────────── */
mark {
  background: rgba(79,142,247,0.25);
  color: #93c5fd;
  border-radius: 2px;
  padding: 0 2px;
}

/* ── Footer ─────────────────────────────────────────────── */
.docs-footer {
  margin-left: var(--sidebar-w);
  padding: 24px 60px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.docs-footer a { color: var(--accent); }

@media (max-width: 900px) {
  .docs-footer { margin-left: 0; padding: 20px; flex-direction: column; gap: 8px; text-align: center; }
}
