/* =========================================================
   OBM2 Pro — Documentation Design System
   Palette allineata all'app WPF M2 Pro
   ========================================================= */

:root {
  --bg-main:        #0E0E12;
  --bg-secondary:   #17171C;
  --bg-tertiary:    #1E1E25;
  --accent:         #8B5CF6;
  --accent-hover:   #7C3AED;
  --accent-dim:     rgba(139,92,246,.12);
  --border:         #2A2A35;
  --border-light:   #3A3A48;
  --text-main:      #E0E0E0;
  --text-muted:     #9CA3AF;
  --text-dim:       #6B7280;
  --green:          #22C55E;
  --red:            #EF4444;
  --amber:          #F59E0B;
  --cyan:           #06B6D4;
  --orange:         #F97316;
  --emerald:        #10B981;
  --violet-light:   #A78BFA;
  --gray-block:     #9CA3AF;
  --header-h:       56px;
  --sidebar-w:      260px;
  --content-max:    860px;
  --radius:         8px;
  --radius-sm:      4px;
  --mono:           'Consolas', 'Monaco', 'Courier New', monospace;
}

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

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

body {
  background: var(--bg-main);
  color: var(--text-main);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; border-radius: var(--radius); }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3A3A50; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(14,14,18,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1.5rem;
  z-index: 100;
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: .95rem;
  color: var(--text-main);
  white-space: nowrap;
}

.site-header .logo img { width: 28px; height: 28px; border-radius: 4px; }

.site-header .logo .version-badge {
  font-size: .65rem;
  font-weight: 600;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(139,92,246,.3);
  border-radius: 99px;
  padding: .15rem .5rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: .5rem;
}

.header-nav a {
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 500;
  padding: .35rem .65rem;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}

.header-nav a:hover, .header-nav a.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.header-spacer { flex: 1; }

/* Search bar */
.header-search {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search input {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-main);
  font-size: .82rem;
  padding: .4rem .75rem .4rem 2rem;
  width: 200px;
  outline: none;
  transition: border-color .15s, width .2s;
}

.header-search input:focus {
  border-color: var(--accent);
  width: 260px;
}

.header-search input::placeholder { color: var(--text-dim); }

.header-search .search-icon {
  position: absolute;
  left: .55rem;
  color: var(--text-dim);
  font-size: .8rem;
  pointer-events: none;
}

/* Search results dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 340px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  display: none;
  z-index: 200;
  max-height: 360px;
  overflow-y: auto;
}

.search-results.visible { display: block; }

.search-result-item {
  display: block;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
  cursor: pointer;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-tertiary); }

.search-result-item .sr-title {
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-main);
}

.search-result-item .sr-section {
  font-size: .73rem;
  color: var(--text-muted);
  margin-top: .15rem;
}

/* Sidebar toggle (mobile) */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: .35rem;
  font-size: 1.1rem;
}

/* ── 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;
  padding: 1.25rem .75rem 2rem;
  border-right: 1px solid var(--border);
  background: var(--bg-main);
  z-index: 50;
}

.sidebar-group { margin-bottom: 1.5rem; }

.sidebar-group-title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 .5rem;
  margin-bottom: .4rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .38rem .5rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  color: var(--text-muted);
  transition: background .12s, color .12s;
  line-height: 1.3;
  cursor: pointer;
}

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

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

/* Block badge dot in sidebar */
.block-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Sub-links (indented) */
.sidebar-sub { margin-left: .75rem; }

.sidebar-sub .sidebar-link {
  font-size: .78rem;
  padding: .28rem .5rem;
}

/* ── Main Content ─────────────────────────────────────────── */
.docs-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 2.5rem 3rem 4rem;
}

.docs-content-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* ── Typography ───────────────────────────────────────────── */
.docs-content h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: .5rem;
  line-height: 1.25;
}

.docs-content .page-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.docs-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 2.5rem 0 .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

.docs-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 1.5rem 0 .5rem;
}

.docs-content h4 {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 1rem 0 .35rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .72rem;
}

.docs-content p {
  color: var(--text-muted);
  margin-bottom: .9rem;
}

.docs-content ul, .docs-content ol {
  color: var(--text-muted);
  padding-left: 1.4rem;
  margin-bottom: .9rem;
}

.docs-content li { margin-bottom: .3rem; }

.docs-content strong { color: var(--text-main); font-weight: 600; }

/* ── Inline code ──────────────────────────────────────────── */
.docs-content code {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: .1em .35em;
  font-family: var(--mono);
  font-size: .82em;
  color: var(--violet-light);
}

/* ── Code blocks ──────────────────────────────────────────── */
.code-wrapper {
  position: relative;
  margin: 1rem 0;
}

.code-wrapper pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.7;
  color: var(--text-main);
}

.code-wrapper pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.copy-btn {
  position: absolute;
  top: .5rem;
  right: .5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: .7rem;
  padding: .25rem .55rem;
  transition: background .12s, color .12s;
}

.copy-btn:hover { background: var(--accent-dim); color: var(--accent); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

/* ── Block Section ────────────────────────────────────────── */
.block-section {
  margin-bottom: 3.5rem;
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

/* Block header card */
.block-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.block-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.block-header-text h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  padding: 0;
  border: none;
}

.block-header-text .block-desc {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

/* Block color variants */
.block-amber  { background: rgba(245,158,11,.15); color: #F59E0B; }
.block-violet { background: rgba(139,92,246,.15); color: #8B5CF6; }
.block-green  { background: rgba(34,197,94,.15);  color: #22C55E; }
.block-red    { background: rgba(239,68,68,.15);   color: #EF4444; }
.block-gray   { background: rgba(156,163,175,.15); color: #9CA3AF; }
.block-cyan   { background: rgba(6,182,212,.15);   color: #06B6D4; }
.block-orange { background: rgba(249,115,22,.15);  color: #F97316; }
.block-emerald{ background: rgba(16,185,129,.15);  color: #10B981; }
.block-violet-light { background: rgba(167,139,250,.15); color: #A78BFA; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .75rem;
}

/* ── Tables ───────────────────────────────────────────────── */
.docs-table-wrap { overflow-x: auto; margin: 1rem 0; }

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

.docs-table th {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.docs-table td {
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}

.docs-table tr:last-child td { border-bottom: none; }
.docs-table tr:hover td { background: rgba(255,255,255,.02); }

.docs-table td code { font-size: .78em; }

/* ── Callouts ─────────────────────────────────────────────── */
.callout {
  display: flex;
  gap: .75rem;
  border-radius: var(--radius);
  padding: .85rem 1rem;
  margin: 1rem 0;
  font-size: .83rem;
  line-height: 1.55;
}

.callout-icon { font-size: 1rem; flex-shrink: 0; margin-top: .05rem; }
.callout p { margin: 0; }

.callout-info    { background: rgba(6,182,212,.08);   border: 1px solid rgba(6,182,212,.25);   color: #67E8F9; }
.callout-warning { background: rgba(245,158,11,.08);  border: 1px solid rgba(245,158,11,.25);  color: #FCD34D; }
.callout-danger  { background: rgba(239,68,68,.08);   border: 1px solid rgba(239,68,68,.25);   color: #FCA5A5; }
.callout-tip     { background: rgba(34,197,94,.08);   border: 1px solid rgba(34,197,94,.25);   color: #86EFAC; }

/* ── Variable badges ──────────────────────────────────────── */
.var-badge {
  display: inline-block;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  padding: .1em .4em;
  font-family: var(--mono);
  font-size: .78em;
  color: var(--amber);
  white-space: nowrap;
}

/* ── Output type pills ────────────────────────────────────── */
.pill {
  display: inline-block;
  border-radius: 99px;
  padding: .12rem .55rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.pill-single  { background: rgba(139,92,246,.18); color: var(--violet-light); border: 1px solid rgba(139,92,246,.3); }
.pill-list    { background: rgba(6,182,212,.15);   color: var(--cyan);         border: 1px solid rgba(6,182,212,.3); }
.pill-none    { background: rgba(156,163,175,.1);  color: var(--gray-block);   border: 1px solid rgba(156,163,175,.2); }

/* ── Screenshot placeholder ───────────────────────────────── */
.screenshot-placeholder {
  background: var(--bg-secondary);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 2.5rem;
  color: var(--text-dim);
  font-size: .8rem;
  text-align: center;
  margin: 1rem 0;
  min-height: 120px;
}

.screenshot-placeholder .ph-icon { font-size: 1.5rem; opacity: .4; }

.screenshot-real {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1rem 0;
  display: block;
  width: 100%;
}

/* ── Command tabs ─────────────────────────────────────────── */
.cmd-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: 1rem;
}

.cmd-tab {
  padding: .3rem .7rem;
  border-radius: var(--radius-sm);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-muted);
  transition: background .12s, color .12s, border-color .12s;
}

.cmd-tab.active, .cmd-tab:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(139,92,246,.4);
}

/* ── Back to top ──────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 36px;
  height: 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s, background .15s;
  z-index: 90;
}

#back-to-top.visible { opacity: 1; transform: translateY(0); }
#back-to-top:hover { background: var(--accent-dim); color: var(--accent); }

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

.docs-footer a { color: var(--text-dim); }
.docs-footer a:hover { color: var(--accent); }

/* ── Homepage hero ────────────────────────────────────────── */
.hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #E0E0E0 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .5rem;
}

.hero .subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.6;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
  margin: 2rem 0;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  transition: border-color .15s;
}

.feature-card:hover { border-color: var(--accent); }

.feature-card .fc-icon {
  font-size: 1.25rem;
  margin-bottom: .5rem;
}

.feature-card .fc-title {
  font-size: .87rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: .2rem;
}

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

/* Quick links */
.quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.5rem;
}

.ql-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--radius);
  font-size: .82rem;
  font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
}

.ql-btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.ql-btn-primary:hover { background: var(--accent-hover); color: #fff; }

.ql-btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.ql-btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: .4; }

/* ── LoliScript syntax highlighting custom ────────────────── */
.lang-loliscript .kw  { color: #C084FC; }
.lang-loliscript .str { color: #86EFAC; }
.lang-loliscript .cmt { color: #6B7280; font-style: italic; }
.lang-loliscript .num { color: #FCD34D; }
.lang-loliscript .op  { color: #67E8F9; }

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

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

  .docs-content { margin-left: 0; padding: 1.5rem 1.25rem 3rem; }

  .docs-footer { margin-left: 0; padding: 1.5rem 1.25rem; flex-direction: column; gap: .5rem; text-align: center; }

  .sidebar-toggle { display: flex; }

  .header-search input { width: 140px; }
  .header-search input:focus { width: 180px; }

  .header-nav { display: none; }

  .site-header { gap: .75rem; }
}

@media (max-width: 600px) {
  .docs-content h1 { font-size: 1.5rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
}
