/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #0366d6;
    --primary-dark: #024ea4;
    --bg: #f6f8fa;
    --card-bg: #ffffff;
    --text: #24292e;
    --text-secondary: #586069;
    --border: #e1e4e8;
    --green: #28a745;
    --red: #d73a49;
    --yellow: #dbab09;
    --orange: #e36209;
    --sidebar-bg: #24292e;
    --sidebar-text: #e1e4e8;
    --code-bg: #1b1f23;
    --code-text: #e1e4e8;
    --highlight-bg: #f1f8ff;
    --highlight-border: #0366d6;
    --danger-bg: #ffeef0;
    --danger-border: #d73a49;
    --warning-bg: #fffbdd;
    --warning-border: #dbab09;
    --info-bg: #f1f8ff;
    --info-border: #0366d6;
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

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

.nav-list {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}

.nav-link {
    display: block;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.nav-link.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-link.visited {
    color: rgba(255,255,255,0.6);
}

.nav-link.visited::after {
    content: ' \2713';
    color: var(--green);
    font-size: 12px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Mobile menu */
.menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    background: var(--sidebar-bg);
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: 0.3s;
}

/* Main content */
.content {
    margin-left: 280px;
    flex: 1;
    padding: 40px;
    max-width: 900px;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.section-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.section-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

.card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.card p {
    margin-bottom: 12px;
    color: var(--text);
}

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

.card li {
    margin-bottom: 6px;
}

.highlight-card {
    border-color: var(--highlight-border);
    background: var(--highlight-bg);
}

/* Code blocks */
.code-block {
    background: var(--code-bg);
    border-radius: 8px;
    margin: 12px 0;
    overflow: hidden;
}

.code-block.output {
    background: #2d333b;
    border: 1px solid #444d56;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: var(--text-secondary);
}

.copy-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--sidebar-text);
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.1);
}

.copy-btn.copied {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.code-block pre {
    padding: 16px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
}

.code-block code {
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    color: var(--code-text);
}

/* Inline code */
p code, li code, td code, summary code {
    background: rgba(27,31,35,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    color: var(--text);
}

/* Callouts */
.callout {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 16px 0;
    border-left: 4px solid;
}

.callout-info {
    background: var(--info-bg);
    border-color: var(--info-border);
}

.callout-warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
}

.callout-danger {
    background: var(--danger-bg);
    border-color: var(--danger-border);
}

/* Tables */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
}

.comparison-table th {
    background: var(--bg);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.comparison-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.cheatsheet-table td:first-child {
    width: 45%;
}

/* Comparison boxes */
.comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 12px 0;
}

.compare-box {
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
}

.compare-box h4 {
    margin-bottom: 8px;
    font-size: 15px;
}

.compare-box .tag {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.compare-box.bad {
    border-color: var(--red);
    background: var(--danger-bg);
}

.compare-box.bad h4 { color: var(--red); }

.compare-box.good {
    border-color: var(--green);
    background: #f0fff4;
}

.compare-box.good h4 { color: var(--green); }

.compare-box pre {
    font-size: 12px;
    margin-top: 8px;
    white-space: pre-wrap;
}

.compare-box .small {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Workflow visual */
.workflow-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.workflow-step {
    text-align: center;
    padding: 16px;
    min-width: 120px;
}

.workflow-icon {
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 8px;
}

.workflow-label {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
}

.workflow-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.workflow-arrow {
    font-size: 24px;
    color: var(--text-secondary);
    font-weight: 700;
}

/* Steps visual */
.steps-visual {
    margin: 16px 0;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.step-item:last-child {
    border-bottom: none;
}

.step-num {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.step-item p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Branch visual */
.branch-visual {
    padding: 24px;
    background: var(--bg);
    border-radius: 8px;
    margin: 16px 0;
}

.branch-line {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.branch-label {
    font-family: 'SF Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    min-width: 110px;
    text-align: right;
    color: var(--text-secondary);
}

.branch-dots {
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
}

.branch-dots::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border);
    z-index: 0;
}

.dot {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.dot.feature {
    background: var(--green);
}

.dot.merged {
    background: #6f42c1;
}

.feature-line {
    margin-left: 0;
    padding-left: 176px;
}

/* Status colors */
.status-red {
    color: var(--red);
    font-weight: 600;
}

.status-green {
    color: var(--green);
    font-weight: 600;
}

/* Checklist */
.checklist {
    list-style: none;
    margin-left: 0 !important;
}

.checklist li {
    padding: 6px 0;
    padding-left: 28px;
    position: relative;
}

.checklist li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: 700;
    font-size: 16px;
}

/* FAQ */
.faq-card details {
    cursor: pointer;
}

.faq-card summary {
    font-weight: 600;
    font-size: 15px;
    padding: 4px 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.faq-card summary::before {
    content: '\25B6';
    font-size: 12px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.faq-card details[open] summary::before {
    transform: rotate(90deg);
}

.faq-answer {
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: 12px;
}

/* Navigation buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e1e4e8;
}

/* Inline links */
.inline-link {
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .menu-toggle {
        display: flex;
    }

    .content {
        margin-left: 0;
        padding: 24px 16px;
        padding-top: 64px;
    }

    .section-header h1 {
        font-size: 22px;
    }

    .comparison {
        grid-template-columns: 1fr;
    }

    .workflow-visual {
        flex-direction: column;
    }

    .workflow-arrow {
        transform: rotate(90deg);
    }

    .feature-line {
        padding-left: 126px;
    }

    .comparison-table {
        font-size: 13px;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 8px 10px;
    }
}

/* Terminal output colors */
.output-red { color: #f97583; }
.output-green { color: #85e89d; }

/* VS Code GUI Mockup */
.vscode-mockup {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    margin: 16px 0;
    border: 1px solid #333;
}

.vscode-sidebar-mock {
    padding: 0;
}

.vscode-sidebar-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    color: #ccc;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.vscode-actions {
    cursor: default;
    font-size: 16px;
    color: #888;
}

.vscode-commit-box {
    padding: 10px 14px;
    border-bottom: 1px solid #333;
}

.vscode-commit-box input {
    width: 100%;
    background: #3c3c3c;
    border: 1px solid #555;
    color: #aaa;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin-bottom: 8px;
}

.vscode-commit-btn {
    background: #0078d4;
    color: #fff;
    text-align: center;
    padding: 6px 0;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.vscode-file-group {
    padding: 4px 0;
}

.vscode-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.vscode-badge {
    background: #4d4d4d;
    color: #ccc;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 10px;
}

.vscode-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px 4px 24px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.vscode-file:hover {
    background: #2a2d2e;
}

.vscode-file-icon {
    font-size: 11px;
    font-weight: 700;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.vscode-file.staged .vscode-file-icon { color: #73c991; }
.vscode-file.modified .vscode-file-icon { color: #e2c08d; }
.vscode-file.untracked .vscode-file-icon { color: #73c991; }

.vscode-file-name {
    color: #e0e0e0;
    flex-shrink: 0;
}

.vscode-file.staged .vscode-file-name { color: #73c991; }
.vscode-file.modified .vscode-file-name { color: #e2c08d; }
.vscode-file.untracked .vscode-file-name { color: #73c991; }

.vscode-file-path {
    color: #666;
    font-size: 12px;
    flex: 1;
}

.vscode-file-actions {
    color: #ccc;
    font-size: 16px;
    cursor: default;
    opacity: 0.6;
    flex-shrink: 0;
}

.vscode-mockup-labels {
    background: #f6f8fa;
    padding: 12px 14px;
    border-top: 2px solid var(--primary);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mockup-label {
    font-size: 13px;
    color: var(--text-secondary);
}

@media (max-width: 480px) {
    .branch-visual {
        overflow-x: auto;
    }

    .step-item {
        flex-direction: column;
        gap: 8px;
    }
}
