/* Deciduous Tutorial Styles */
/* Inspired by mdBook and jujutsu tutorial */

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

/* AI Generated Warning Banner */
.ai-warning-banner {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.ai-warning-banner a {
    color: white;
    text-decoration: underline;
}
body {
    padding-top: 48px; /* Make room for fixed banner */
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-code: #24292f;
    --text-primary: #24292f;
    --text-secondary: #57606a;
    --text-muted: #6e7781;
    --border-color: #d0d7de;
    --accent-green: #2da44e;
    --accent-blue: #0969da;
    --accent-cyan: #00d9ff;
    --sidebar-width: 280px;
    --content-max-width: 800px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.sidebar-header .subtitle {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Table of Contents */
.toc-section {
    margin-bottom: 20px;
}

.toc-title {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 4px;
    transition: background 0.15s;
}

.toc-title:hover {
    background: var(--bg-primary);
}

.toc-title.active {
    background: var(--accent-green);
    color: white;
}

.toc-section ul {
    list-style: none;
    padding-left: 10px;
}

.toc-section li {
    margin: 2px 0;
}

.toc-section li a {
    display: block;
    padding: 4px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: all 0.15s;
}

.toc-section li a:hover {
    color: var(--accent-blue);
    background: var(--bg-primary);
}

.toc-section li a.active {
    color: var(--accent-green);
    font-weight: 500;
}

/* Main Content */
.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px;
    max-width: calc(var(--content-max-width) + 80px + var(--sidebar-width));
}

article {
    max-width: var(--content-max-width);
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -1px;
    color: var(--text-primary);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 30px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

p {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.lead {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

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

li {
    margin-bottom: 8px;
}

strong {
    font-weight: 600;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Hero Box */
.hero-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px 30px;
    margin: 30px 0;
}

.hero-box p {
    margin-bottom: 12px;
}

.hero-box p:last-child {
    margin-bottom: 0;
}

/* Code Blocks */
pre {
    background: var(--bg-code);
    color: #f6f8fa;
    padding: 20px 24px;
    border-radius: 8px;
    margin: 20px 0;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.9em;
}

p code, li code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-primary);
}

pre code {
    background: none;
    padding: 0;
}

/* Syntax highlighting in code blocks */
.cmd { color: #7ee787; }
.comment { color: #8b949e; }
.output { color: #8b949e; }
.prompt { color: #79c0ff; }
.string { color: #a5d6ff; }

/* Terminal Session Box */
.terminal-session {
    background: #1a1a2e;
    border-radius: 10px;
    margin: 25px 0;
    overflow: hidden;
}

.terminal-header {
    background: #16213e;
    padding: 10px 15px;
    border-bottom: 1px solid #2a2a4e;
    font-size: 0.85rem;
    color: #888;
}

.terminal-body {
    padding: 20px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #f6f8fa;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.terminal-body .user-input {
    color: #00d9ff;
}

.terminal-body .claude-response {
    color: #c9d1d9;
}

.terminal-body .command {
    color: #7ee787;
}

.terminal-body .command::before {
    content: "$ ";
    color: #6e7681;
}

.terminal-body .output {
    color: #8b949e;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95rem;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

tr:hover {
    background: var(--bg-secondary);
}

/* Screenshot Placeholder */
.screenshot-placeholder {
    background: linear-gradient(135deg, #f0f0f0 25%, #e8e8e8 25%, #e8e8e8 50%, #f0f0f0 50%, #f0f0f0 75%, #e8e8e8 75%);
    background-size: 20px 20px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 60px 30px;
    text-align: center;
    margin: 25px 0;
}

.screenshot-placeholder .label {
    background: white;
    padding: 10px 20px;
    border-radius: 6px;
    display: inline-block;
    font-weight: 600;
    color: var(--text-secondary);
}

.screenshot-placeholder .caption {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Info/Warning Boxes */
.info-box {
    background: #ddf4ff;
    border: 1px solid #54aeff;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 20px 0;
}

.info-box.warning {
    background: #fff8c5;
    border-color: #d4a72c;
}

.info-box.tip {
    background: #d1f7d6;
    border-color: #2da44e;
}

.info-box strong {
    display: block;
    margin-bottom: 4px;
}

/* Navigation */
.page-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.page-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.15s;
}

.page-nav a:hover {
    background: var(--bg-primary);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.page-nav .prev::before {
    content: "\2190";
}

.page-nav .next::after {
    content: "\2192";
}

.page-nav .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
}

.page-nav .title {
    font-weight: 600;
}

/* Next Section CTA */
.next-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 30px;
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.next-section span {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent-green);
    color: white;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s;
}

.btn:hover {
    background: #238636;
    text-decoration: none;
}

/* Key Binding Display */
kbd {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.85em;
    box-shadow: 0 1px 0 var(--border-color);
}

/* Node Type Colors */
.node-goal { color: #d29922; }
.node-decision { color: #0969da; }
.node-option { color: #8250df; }
.node-action { color: #2da44e; }
.node-outcome { color: #1f6feb; }
.node-observation { color: #bf3989; }

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .content {
        margin-left: 0;
        padding: 20px;
    }

    body {
        flex-direction: column;
    }

    .page-nav {
        flex-direction: column;
        gap: 10px;
    }

    .page-nav a {
        width: 100%;
        justify-content: center;
    }
}
