/* docs/www/docs.css — shared styles for documentation pages */

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

:root {
  --bg: #1a1a1a;
  --card-bg: #252525;
  --status-bar: #111111;
  --accent: #2870A8;
  --accent-dark: #1d5580;
  --green: #4CAF50;
  --red: #E53935;
  --text: #eee;
  --text-dim: #888;
  --text-sec: #aaa;
  --border: #444;
  --input-bg: #333;
  --radius: 8px;
  --radius-sm: 6px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ── Top navigation ── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--status-bar);
  border-bottom: 2px solid #333;
  padding: 0 16px;
}
.top-bar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
}
.top-bar h1 {
  font-size: 1.1em;
  white-space: nowrap;
  padding: 10px 12px 10px 0;
  border-right: 1px solid #333;
  margin-right: 4px;
  color: #fff;
}
.top-bar a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9em;
  padding: 10px 12px;
  white-space: nowrap;
  transition: color 0.15s;
}
.top-bar a:hover, .top-bar a:focus {
  color: #fff;
}

/* ── Dropdown nav ── */
.nav-item {
  position: relative;
}
.nav-item > a {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-item > a::after {
  content: "\25BE";
  font-size: 0.7em;
  color: var(--text-dim);
}
.nav-item:hover > a, .nav-item:focus-within > a {
  color: #fff;
}
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--status-bar);
  border: 1px solid #333;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  min-width: 180px;
  padding: 4px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  display: block;
}
.nav-dropdown a {
  display: block;
  padding: 8px 16px;
  font-size: 0.85em;
  color: var(--text-dim);
  transition: background 0.1s, color 0.1s;
}
.nav-dropdown a:hover, .nav-dropdown a:focus {
  background: #222;
  color: #fff;
}
.nav-link-plain {
  color: #4da6ff !important;
}

/* ── Tab badge (shared across guide pages) ── */
section > h2 .tab-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.55em;
  padding: 3px 10px;
  border-radius: 4px;
  vertical-align: middle;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}

/* ── Steps (numbered list) ── */
.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}
.steps li {
  counter-increment: step;
  padding-left: 36px;
  position: relative;
  margin-bottom: 12px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 0.8em;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Page layout ── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 48px 16px 40px;
  border-bottom: 1px solid #333;
  margin-bottom: 32px;
}
.hero h1 {
  font-size: 2em;
  color: #fff;
  margin-bottom: 8px;
}
.hero p {
  color: var(--text-sec);
  font-size: 1.05em;
  max-width: 640px;
  margin: 0 auto;
}

/* ── Section ── */
section {
  margin-bottom: 48px;
  scroll-margin-top: 52px;
}
section > h2 {
  font-size: 1.4em;
  color: #fff;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

h3 {
  font-size: 1.1em;
  color: #fff;
  margin: 20px 0 8px;
}

h4 {
  font-size: 1em;
  color: var(--text-sec);
  margin: 16px 0 6px;
}

p, li {
  color: var(--text);
  margin-bottom: 8px;
}

ul, ol {
  padding-left: 24px;
  margin-bottom: 12px;
}

/* ── Cards ── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}

/* ── Screenshots ── */
.screenshot {
  margin: 16px 0;
  text-align: center;
}
.screenshot img {
  max-width: 100%;
  display: inline-block;
  border-radius: var(--radius);
  image-rendering: auto;
}
.screenshot-caption {
  font-size: 0.85em;
  color: var(--text-dim);
  padding: 8px 12px;
}

/* ── Screenshot placeholder (no image yet) ── */
.screenshot-placeholder {
  margin: 16px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #111;
}
.screenshot-placeholder .placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(40,112,168,0.08) 10px,
    rgba(40,112,168,0.08) 20px
  );
  color: var(--text-dim);
  font-size: 0.9em;
  text-align: center;
  min-height: 160px;
  gap: 6px;
}
.screenshot-placeholder .ph-icon {
  font-size: 1.8em;
  opacity: 0.5;
  margin-bottom: 4px;
}
.screenshot-placeholder .ph-label {
  font-weight: 600;
  color: var(--text-sec);
  font-size: 0.95em;
}
.screenshot-placeholder .ph-desc {
  color: var(--text-dim);
  font-size: 0.85em;
  max-width: 520px;
  line-height: 1.5;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 0.95em;
}
th {
  text-align: left;
  color: var(--text-sec);
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
  background: var(--card-bg);
}
td {
  padding: 8px 12px;
  border-bottom: 1px solid #333;
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
td:first-child {
  white-space: nowrap;
  font-weight: 500;
  color: #fff;
}

/* ── Code blocks ── */
pre {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.5;
  margin: 12px 0 16px;
  color: var(--text);
}
code {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 0.9em;
}
p code, li code, td code {
  background: var(--input-bg);
  padding: 2px 6px;
  border-radius: 4px;
  color: #ddd;
}

/* ── Callouts ── */
.tip, .warning, .note {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 12px 0 16px;
  font-size: 0.95em;
  line-height: 1.5;
}
.tip {
  background: #2e4a2e;
  border-left: 3px solid var(--green);
}
.tip::before { content: "Tip: "; font-weight: 700; color: var(--green); }
.warning {
  background: #4a2e2e;
  border-left: 3px solid var(--red);
}
.warning::before { content: "Warning: "; font-weight: 700; color: var(--red); }
.note {
  background: #2e3a4a;
  border-left: 3px solid var(--accent);
}
.note::before { content: "Note: "; font-weight: 700; color: #4da6ff; }

/* ── Footer ── */
footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85em;
  padding: 32px 16px;
  border-top: 1px solid #333;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }
