/* ============================================
   Context Pilot — Documentation Styles
   Inherits variables from ../style.css design
   ============================================ */

/* --- Import shared variables --- */
:root {
    --bg-primary: #0a0a12;
    --bg-secondary: #0f0f1a;
    --bg-card: #13131f;
    --bg-card-hover: #1a1a2e;
    --bg-terminal: #0d0d14;
    --border: #1e1e32;
    --border-light: #2a2a44;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-dim: #64748b;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --cyan: #22d3ee;
    --green: #34d399;
    --yellow: #fbbf24;
    --red: #f87171;
    --purple: #a78bfa;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --max-width: 1140px;
    --content-width: 780px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* --- Navigation (same as landing) --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 18, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.nav-logo-icon { font-size: 1.4rem; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--accent); }

/* --- Layout: Sidebar + Content --- */
.docs-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 48px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 96px 24px 64px;
    min-height: 100vh;
}

/* --- Sidebar --- */
.docs-sidebar {
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.docs-sidebar h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    margin-bottom: 12px;
    margin-top: 28px;
}

.docs-sidebar h3:first-child { margin-top: 0; }

.docs-sidebar a {
    display: block;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 400;
    transition: all 0.15s;
}

.docs-sidebar a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.docs-sidebar a.active {
    color: var(--accent);
    background: var(--accent-glow);
    font-weight: 500;
}

/* --- Content Area --- */
.docs-content {
    max-width: var(--content-width);
    min-width: 0;
}

.docs-content h1 {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    line-height: 1.15;
}

.docs-content .subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 48px;
    line-height: 1.7;
}

.docs-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 56px;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.docs-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 36px;
    margin-bottom: 12px;
}

.docs-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.docs-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.docs-content ul, .docs-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.docs-content li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 4px;
}

.docs-content li code, .docs-content p code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
}

/* --- Code Blocks --- */
.docs-content pre {
    background: var(--bg-terminal);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 16px 0 24px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.docs-content pre code {
    font-family: inherit;
    background: none;
    padding: 0;
    color: inherit;
}

/* --- Tables --- */
.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
    font-size: 0.88rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.docs-content thead th {
    background: var(--bg-secondary);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.docs-content td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

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

.docs-content td code {
    font-family: var(--font-mono);
    font-size: 0.82em;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
}

/* --- Callout Boxes --- */
.callout {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin: 16px 0 24px;
    font-size: 0.9rem;
    line-height: 1.7;
}

.callout-info {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--accent-hover);
}

.callout-warning {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    color: var(--yellow);
}

.callout-tip {
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.2);
    color: var(--cyan);
}

.callout strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

/* --- Card Grid (for docs landing) --- */
.doc-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 32px 0;
}

.doc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: border-color 0.3s, transform 0.2s;
    display: block;
    color: var(--text-primary);
}

.doc-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    color: var(--text-primary);
}

.doc-card-icon { font-size: 1.6rem; margin-bottom: 12px; }
.doc-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.doc-card p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; margin: 0; }

/* --- Tool/Module cards --- */
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
}

.tool-card h4 {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.tool-card .tool-category {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--accent-glow);
    color: var(--accent);
    font-family: var(--font-mono);
    margin-bottom: 8px;
}

.tool-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* --- Footer (same as landing) --- */
.footer {
    padding: 48px 0 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    margin-top: 80px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}

.footer-inner p {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .docs-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .docs-sidebar {
        position: static;
        max-height: none;
        border-bottom: 1px solid var(--border);
        padding-bottom: 24px;
        margin-bottom: 32px;
    }
    .doc-cards { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .docs-content h1 { font-size: 1.8rem; }
    .docs-content h2 { font-size: 1.3rem; }
}
