/* PasteSuiteAI Documentation — Shared Styles */
/* SSoT for all doc page styling. Individual pages link here instead of inline <style>. */

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

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --color-bg: #ffffff;
  --color-bg-secondary: #f5f5f7;
  --color-text-primary: #1d1d1f;
  --color-text-secondary: #424245;
  --color-text-tertiary: #6e6e73;
  --color-accent: #0071e3;
  --color-separator: #d2d2d7;
  --color-nav-bg: rgba(251, 251, 253, 0.72);
  --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --max-width: 720px;
  --nav-height: 52px;
  --sidebar-width: 240px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #000000;
    --color-bg-secondary: #1c1c1e;
    --color-text-primary: #f5f5f7;
    --color-text-secondary: #a1a1a6;
    --color-text-tertiary: #86868b;
    --color-separator: #38383a;
    --color-nav-bg: rgba(22, 22, 23, 0.72);
    --color-screenshot-shadow: rgba(255,255,255,0.12);
  }
}

/* ── Base ───────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body { font-family: var(--font-family); background: var(--color-bg); color: var(--color-text-primary); line-height: 1.7; -webkit-font-smoothing: antialiased; }

/* ── Top Nav Bar ────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-height);
  background: var(--color-nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-separator);
  display: flex; align-items: center; padding: 0 22px;
}
.docs-nav-links { display: flex; align-items: center; gap: 8px; font-size: 13px; width: 100%; }
.docs-nav-links a { color: var(--color-text-tertiary); text-decoration: none; transition: color 0.2s; }
.docs-nav-links a:hover { color: var(--color-accent); }
.docs-nav-links .separator { color: var(--color-separator); }
.docs-nav-links .current { color: var(--color-text-primary); font-weight: 500; }

/* Sidebar toggle — mobile only */
.sidebar-toggle {
  display: none; background: none; border: none;
  color: var(--color-text-secondary); cursor: pointer;
  padding: 4px; margin-right: 8px; border-radius: 4px;
  line-height: 0;
}
.sidebar-toggle:hover { background: var(--color-bg-secondary); }

/* ── Layout ─────────────────────────────────────────────────── */
.docs-layout {
  display: flex;
  max-width: calc(var(--sidebar-width) + var(--max-width) + 80px);
  margin: 0 auto;
  min-height: calc(100vh - var(--nav-height));
}

/* ── Sidebar ────────────────────────────────────────────────── */
.docs-sidebar {
  width: var(--sidebar-width); flex-shrink: 0;
  position: sticky; top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto; padding: 24px 16px 32px 22px;
  border-right: 1px solid var(--color-separator);
}

.sidebar-section { margin-bottom: 24px; }
.sidebar-section-title {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  padding: 0 8px; margin-bottom: 6px;
}
.sidebar-links { list-style: none; padding: 0; }
.sidebar-links li { margin: 0; }
.sidebar-link {
  display: block; padding: 5px 8px;
  font-size: 13px; color: var(--color-text-secondary);
  text-decoration: none; border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.sidebar-link:hover { color: var(--color-text-primary); background: var(--color-bg-secondary); }
.sidebar-link.active { color: var(--color-accent); font-weight: 500; background: rgba(0, 113, 227, 0.08); }

/* Backdrop for mobile sidebar */
.sidebar-backdrop { display: none; }

/* ── Content ────────────────────────────────────────────────── */
.docs-content {
  flex: 1; min-width: 0;
  max-width: var(--max-width);
  padding: 48px 22px 80px 48px;
}
.docs-content h1 { font-size: 36px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 8px; }
.docs-content .subtitle { font-size: 14px; color: var(--color-text-tertiary); margin-bottom: 48px; }
.docs-content h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-top: 48px; margin-bottom: 16px; }
.docs-content h3 { font-size: 17px; font-weight: 600; margin-top: 32px; margin-bottom: 12px; }
.docs-content p { font-size: 15px; color: var(--color-text-secondary); margin-bottom: 16px; line-height: 1.7; }
.docs-content ul, .docs-content ol { padding-left: 20px; margin-bottom: 16px; }
.docs-content li { font-size: 15px; color: var(--color-text-secondary); padding: 4px 0; line-height: 1.6; }
.docs-content a { color: var(--color-accent); text-decoration: none; }
.docs-content a:hover { text-decoration: underline; }
.docs-content strong { color: var(--color-text-primary); }
.docs-content code { font-size: 13px; background: var(--color-bg-secondary); padding: 2px 6px; border-radius: 4px; }

/* ── Components ─────────────────────────────────────────────── */
kbd {
  display: inline-block; padding: 2px 7px; font-size: 12px;
  font-family: var(--font-family); color: var(--color-text-primary);
  background: var(--color-bg-secondary); border: 1px solid var(--color-separator);
  border-radius: 4px; box-shadow: 0 1px 0 var(--color-separator); line-height: 1.4;
}

.docs-tip, .docs-warning { padding: 16px 20px; border-radius: 8px; margin: 20px 0; font-size: 14px; line-height: 1.6; }
.docs-disclaimer { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--color-separator); font-size: 12px; line-height: 1.6; color: var(--color-text-tertiary); }
.docs-tip { background: rgba(0, 113, 227, 0.08); border-left: 3px solid var(--color-accent); color: var(--color-text-secondary); }
.docs-warning { background: rgba(255, 149, 0, 0.08); border-left: 3px solid #ff9500; color: var(--color-text-secondary); }

.docs-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; }
.docs-table th { text-align: left; font-weight: 600; color: var(--color-text-primary); padding: 10px 12px; border-bottom: 2px solid var(--color-separator); font-size: 13px; text-transform: uppercase; letter-spacing: 0.02em; }
.docs-table td { padding: 10px 12px; color: var(--color-text-secondary); border-bottom: 1px solid var(--color-separator); }
.docs-table tr:last-child td { border-bottom: none; }

.docs-screenshot { display: block; width: 100%; border-radius: 12px; margin: 24px 0; box-shadow: 0 2px 12px var(--color-screenshot-shadow, rgba(0,0,0,0.08)); }
.screenshot-placeholder { background: var(--color-bg-secondary); border: 2px dashed var(--color-separator); border-radius: 12px; padding: 48px 24px; text-align: center; color: var(--color-text-tertiary); font-size: 14px; margin: 24px 0; }

/* Crop container — shows a CSS-cropped region from a full-view screenshot.
   Usage: <div class="docs-crop"><img src="img/view.png" alt="..."
          style="aspect-ratio: 530/120; object-fit: cover; object-position: 0 8%;"></div>
   - aspect-ratio W/H = source width / visible height → controls how much is shown
   - object-position 0 Y% = vertical anchor (0%=top, 50%=mid, 100%=bottom) */
.docs-crop { display: block; width: 100%; border-radius: 12px; margin: 24px 0; box-shadow: 0 2px 12px var(--color-screenshot-shadow, rgba(0,0,0,0.08)); overflow: hidden; }
.docs-crop img { display: block; width: 100%; object-fit: cover; }

/* Cards — used on welcome page for quick links */
.docs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 20px 0; }
.docs-card {
  background: var(--color-bg); border: 1px solid var(--color-separator);
  border-radius: 10px; padding: 16px 18px; text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s; display: block;
}
.docs-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); text-decoration: none; }
.docs-card h3 { font-size: 15px; font-weight: 600; color: var(--color-text-primary); margin: 0 0 4px 0; }
.docs-card p { font-size: 13px; color: var(--color-text-tertiary); margin: 0; line-height: 1.5; }

/* ── Footer ─────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--color-separator); padding: 24px 22px; }
.footer-inner {
  max-width: calc(var(--sidebar-width) + var(--max-width) + 80px);
  margin: 0 auto; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.footer-text { font-size: 12px; color: var(--color-text-tertiary); letter-spacing: -0.01em; }
.footer-links { display: flex; align-items: center; gap: 20px; }
.footer-links a { font-size: 12px; color: var(--color-text-tertiary); transition: color 0.2s; text-decoration: none; }
.footer-links a:hover { color: var(--color-text-primary); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 767px) {
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }

  .docs-sidebar {
    position: fixed; top: var(--nav-height); left: 0;
    width: 260px; height: calc(100vh - var(--nav-height));
    background: var(--color-bg); z-index: 99;
    transform: translateX(-100%); transition: transform 0.25s ease;
    border-right: 1px solid var(--color-separator); padding-top: 16px;
  }
  .docs-sidebar.open { transform: translateX(0); }

  .sidebar-backdrop {
    position: fixed; inset: 0; top: var(--nav-height);
    background: rgba(0, 0, 0, 0.3); z-index: 98;
    display: none;
  }
  .sidebar-backdrop.open { display: block; }

  .docs-content { padding: 32px 16px 80px 16px; }
  .docs-grid { grid-template-columns: 1fr; }
}

@media (min-width: 768px) and (max-width: 960px) {
  .docs-sidebar { width: 200px; }
  .docs-content { padding: 48px 16px 80px 32px; }
}
