/* ============================================================
   AppStudio Docs — Shared Stylesheet
   Matches the design system from the main marketing site.
   ============================================================ */

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

/* ─── CSS VARIABLES ─── */
:root {
  --bg:          #080d16;
  --bg2:         #0d1424;
  --bg3:         #111827;
  --border:      rgba(255,255,255,0.07);
  --border2:     rgba(255,255,255,0.12);
  --cyan:        #06b6d4;
  --cyan-dim:    rgba(6,182,212,0.12);
  --violet:      #8b5cf6;
  --violet-dim:  rgba(139,92,246,0.12);
  --rose:        #f43f5e;
  --rose-dim:    rgba(244,63,94,0.12);
  --amber:       #f59e0b;
  --amber-dim:   rgba(245,158,11,0.12);
  --green:       #10b981;
  --green-dim:   rgba(16,185,129,0.12);
  --text:        #e2e8f0;
  --text-dim:    #94a3b8;
  --text-faint:  #475569;
  --mono:        'JetBrains Mono', monospace;
}

/* ─── BASE ─── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── NOISE OVERLAY ─── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0;
}

/* ─── NAV ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5%;
  height: 64px;
  background: rgba(8,13,22,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; letter-spacing: -0.3px;
  text-decoration: none; color: var(--text);
}
.nav-logo .dot {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: #fff;
  flex-shrink: 0;
}

.nav-links {
  display: flex; align-items: center; gap: 28px; list-style: none;
}
.nav-links a {
  font-size: 14px; color: var(--text-dim); text-decoration: none;
  transition: color .2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--cyan); }

.nav-cta {
  display: flex; gap: 10px; align-items: center;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer; text-decoration: none;
  transition: all .2s; border: none; font-family: inherit;
}
.btn-ghost {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #fff; border: none;
  box-shadow: 0 0 24px rgba(6,182,212,0.25);
}
.btn-primary:hover {
  box-shadow: 0 0 36px rgba(6,182,212,0.4);
  transform: translateY(-1px);
}

/* ─── DOCS LAYOUT ─── */
.docs-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ─── SIDEBAR ─── */
.docs-sidebar {
  position: fixed;
  top: 64px; left: 0; bottom: 0;
  width: 260px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px 0;
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.docs-sidebar .sidebar-section {
  padding: 20px 20px 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.7;
}
.docs-sidebar .sidebar-section:first-child { padding-top: 8px; }

.docs-sidebar a {
  display: block;
  padding: 6px 20px;
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all .15s;
}
.docs-sidebar a:hover {
  color: var(--cyan);
  background: var(--cyan-dim);
}
.docs-sidebar a.active {
  color: var(--cyan);
  background: var(--cyan-dim);
  border-left-color: var(--cyan);
}

/* ─── MAIN CONTENT ─── */
.docs-content {
  margin-left: 260px;
  padding: 80px 48px 80px;
  max-width: calc(260px + 780px);
  width: 100%;
  min-height: 100vh;
}

.docs-content-inner {
  max-width: 780px;
}

/* ─── TYPOGRAPHY ─── */
.docs-content h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 8px;
  margin-top: 80px;
}
.docs-content h1:first-child { margin-top: 0; }

.docs-content .page-subtitle {
  font-size: 16px;
  color: var(--text-dim);
  margin-bottom: 40px;
  line-height: 1.6;
}

.docs-content h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.docs-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--cyan);
  margin-top: 32px;
  margin-bottom: 10px;
}

.docs-content p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.docs-content ul,
.docs-content ol {
  margin: 12px 0 16px 20px;
}
.docs-content li {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.docs-content li strong { color: var(--text); }

/* ─── INLINE CODE ─── */
.docs-content code {
  font-family: var(--mono);
  font-size: 13px;
  background: rgba(6,182,212,0.08);
  color: var(--cyan);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(6,182,212,0.15);
}

/* ─── CODE BLOCKS ─── */
.docs-content pre {
  background: #07090f;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 16px 0;
  position: relative;
}
.docs-content pre code {
  background: none;
  border: none;
  color: #e2e8f0;
  font-size: 13px;
  padding: 0;
  border-radius: 0;
}

/* ─── STEP BLOCKS ─── */
.step-block {
  display: flex;
  gap: 16px;
  margin: 20px 0;
  align-items: flex-start;
}
.step-block .step-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  background: var(--cyan-dim);
  margin-top: 2px;
}
.step-block .step-body { flex: 1; }
.step-block .step-body strong {
  display: block;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}
.step-block .step-body p,
.step-block .step-body ul {
  margin-top: 4px;
}

/* ─── CALLOUTS ─── */
.callout {
  padding: 14px 18px;
  border-left: 3px solid;
  border-radius: 6px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-dim);
}
.callout strong { color: var(--text); }
.callout.tip {
  background: var(--green-dim);
  border-color: var(--green);
  color: #a7f3d0;
}
.callout.tip strong { color: #6ee7b7; }
.callout.warning {
  background: var(--amber-dim);
  border-color: var(--amber);
  color: #fde68a;
}
.callout.warning strong { color: #fbbf24; }
.callout.danger {
  background: var(--rose-dim);
  border-color: var(--rose);
  color: #fda4af;
}
.callout.danger strong { color: #fb7185; }

/* ─── PLATFORM TABS ─── */
.platform-tabs {
  margin: 20px 0 0;
}
.platform-tab-buttons {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.platform-tab-btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: all .15s;
  margin-bottom: -1px;
}
.platform-tab-btn:hover { color: var(--text-dim); }
.platform-tab-btn.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}
.platform-tab-content {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 20px;
}
.platform-win,
.platform-mac,
.platform-linux { display: none; }
.platform-win.visible,
.platform-mac.visible,
.platform-linux.visible { display: block; }

/* ─── BADGE ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-cyan   { background: var(--cyan-dim);   color: var(--cyan);   border: 1px solid rgba(6,182,212,0.25); }
.badge-violet { background: var(--violet-dim); color: var(--violet); border: 1px solid rgba(139,92,246,0.25); }
.badge-amber  { background: var(--amber-dim);  color: var(--amber);  border: 1px solid rgba(245,158,11,0.25); }
.badge-green  { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(16,185,129,0.25); }
.badge-rose   { background: var(--rose-dim);   color: var(--rose);   border: 1px solid rgba(244,63,94,0.25); }

/* ─── TABLES ─── */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}
.docs-content table th {
  background: var(--bg2);
  color: var(--text);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--border);
  font-size: 13px;
}
.docs-content table td {
  padding: 9px 14px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  vertical-align: top;
}
.docs-content table tr:hover td { background: rgba(255,255,255,0.02); }

/* ─── DETAILS / ACCORDION (Troubleshooting) ─── */
.docs-content details {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 8px 0;
  overflow: hidden;
}
.docs-content details + details { margin-top: 8px; }
.docs-content summary {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
  transition: background .15s;
  user-select: none;
}
.docs-content summary::-webkit-details-marker { display: none; }
.docs-content summary::before {
  content: '▶';
  font-size: 10px;
  color: var(--text-faint);
  transition: transform .2s;
  flex-shrink: 0;
}
.docs-content details[open] summary::before {
  transform: rotate(90deg);
  color: var(--cyan);
}
.docs-content details[open] summary { background: var(--bg3); color: var(--cyan); }
.docs-content summary:hover { background: var(--bg3); }
.docs-content .details-body {
  padding: 16px 18px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.docs-content .details-body p,
.docs-content .details-body ul,
.docs-content .details-body li {
  font-size: 14px;
}

/* ─── DOCS HOME CARDS ─── */
.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}
.docs-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s;
}
.docs-card:hover {
  border-color: var(--border2);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.docs-card.card-cyan:hover  { border-color: rgba(6,182,212,0.4); box-shadow: 0 4px 24px rgba(6,182,212,0.08); }
.docs-card.card-violet:hover{ border-color: rgba(139,92,246,0.4); box-shadow: 0 4px 24px rgba(139,92,246,0.08); }
.docs-card.card-amber:hover { border-color: rgba(245,158,11,0.4); box-shadow: 0 4px 24px rgba(245,158,11,0.08); }

.docs-card .card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 14px;
}
.card-cyan .card-icon   { background: var(--cyan-dim);   color: var(--cyan); }
.card-violet .card-icon { background: var(--violet-dim); color: var(--violet); }
.card-amber .card-icon  { background: var(--amber-dim);  color: var(--amber); }

.docs-card .card-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  margin-bottom: 6px;
}
.docs-card .card-desc {
  font-size: 13px; color: var(--text-dim); line-height: 1.6;
  margin-bottom: 16px;
}
.docs-card .card-links {
  list-style: none; margin: 0; padding: 0;
}
.docs-card .card-links li { margin-bottom: 4px; }
.docs-card .card-links a {
  font-size: 13px; color: var(--text-faint); text-decoration: none;
  transition: color .15s;
  display: inline-flex; align-items: center; gap: 4px;
}
.docs-card .card-links a:hover { color: var(--text-dim); }
.card-cyan   .card-links a:hover { color: var(--cyan); }
.card-violet .card-links a:hover { color: var(--violet); }
.card-amber  .card-links a:hover { color: var(--amber); }

/* ─── CHANGELOG ─── */
.changelog-version {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.changelog-version h2 { margin: 0; border: none; padding: 0; }

/* ─── FOOTER ─── */
.docs-footer {
  margin-left: 260px;
  padding: 48px 48px 32px;
  border-top: 1px solid var(--border);
  text-align: center;
  position: relative; z-index: 1;
}
.docs-footer p {
  font-size: 13px;
  color: var(--text-faint);
  margin: 0;
}
.docs-footer a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color .2s;
}
.docs-footer a:hover { color: var(--cyan); }

/* ─── MOBILE RESPONSIVE ─── */
@media (max-width: 768px) {
  .docs-sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
  }
  .docs-sidebar a { padding: 6px 16px; }
  .docs-sidebar .sidebar-section { padding: 14px 16px 4px; }

  .docs-content {
    margin-left: 0;
    padding: 24px 20px 60px;
    max-width: 100%;
  }

  .docs-footer {
    margin-left: 0;
    padding: 32px 20px;
  }

  .docs-card-grid {
    grid-template-columns: 1fr;
  }

  .docs-layout {
    flex-direction: column;
  }

  .nav-links { display: none; }
  .nav-cta .btn-ghost { display: none; }
}
