/* Docs Layout */
.docs-layout {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 80px;
    min-height: calc(100vh - 80px);
}

.docs-sidebar {
    width: 240px;
    flex-shrink: 0;
    padding: 2rem 1rem;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.docs-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.docs-nav-section {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    padding: 1.25rem 0.75rem 0.5rem;
    margin-top: 0.5rem;
}

.docs-nav-section:first-child {
    padding-top: 0;
    margin-top: 0;
}

.docs-nav-item {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.docs-nav-item:hover {
    color: var(--fg);
    background: var(--card-bg);
}

.docs-nav-item.active {
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
    font-weight: 500;
}

.docs-content {
    flex: 1;
    padding: 2rem 3rem;
    max-width: 800px;
}

.docs-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.docs-content .lead {
    font-size: 1.1rem;
    color: var(--muted);
    margin-bottom: 2rem;
}

.docs-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.docs-content h2:first-of-type {
    border-top: none;
    padding-top: 0;
}

.docs-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.docs-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.docs-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.docs-content ul,
.docs-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.docs-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.docs-content a {
    color: var(--accent);
    text-decoration: none;
}

.docs-content a:hover {
    text-decoration: underline;
}

.docs-content code {
    background: var(--card-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.85em;
}

.docs-content .code-block {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.docs-content .code-block pre {
    margin: 0;
}

.docs-content .code-block code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Tables */
.docs-table,
.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.docs-table th,
.docs-table td,
.docs-content table th,
.docs-content table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid var(--border);
}

.docs-table th,
.docs-content table th {
    background: var(--card-bg);
    font-weight: 600;
}

.docs-table tr:nth-child(even),
.docs-content table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

@media (prefers-color-scheme: light) {
    .docs-table tr:nth-child(even),
    .docs-content table tr:nth-child(even) {
        background: rgba(0, 0, 0, 0.02);
    }
}

/* Feature list */
.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.feature-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
}

.feature-item h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--fg);
}

.feature-item ul {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.feature-item li {
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

/* Quick links - old style */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.quick-link {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    text-decoration: none;
    transition: all 0.2s;
}

.quick-link:hover {
    border-color: var(--accent);
    text-decoration: none;
}

.quick-link strong {
    display: block;
    color: var(--fg);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.quick-link span {
    font-size: 0.85rem;
    color: var(--muted);
}

/* Next steps grid */
.next-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.next-step {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    text-decoration: none;
    transition: all 0.2s;
}

.next-step:hover {
    border-color: var(--accent);
    text-decoration: none;
    transform: translateY(-2px);
}

.next-step strong {
    display: block;
    color: var(--fg);
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.next-step span {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

/* Principles grid */
.principles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.principle {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.principle h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--accent);
}

.principle p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
}

/* Table of Contents */
.toc {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.toc h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
}

.toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
    columns: 2;
    column-gap: 2rem;
}

.toc li {
    margin-bottom: 0.35rem;
    break-inside: avoid;
}

.toc a {
    color: var(--fg);
    text-decoration: none;
    font-size: 0.9rem;
}

.toc a:hover {
    color: var(--accent);
}

@media (max-width: 600px) {
    .toc ul {
        columns: 1;
    }
}

/* Callouts */
.callout {
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.callout strong {
    display: block;
    margin-bottom: 0.35rem;
}

.callout p {
    margin: 0;
    font-size: 0.9rem;
}

.callout p + p {
    margin-top: 0.5rem;
}

.callout.info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
}

.callout.info strong {
    color: #3b82f6;
}

.callout.warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #f59e0b;
}

.callout.warning strong {
    color: #f59e0b;
}

.callout.danger {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: #ef4444;
}

.callout.danger strong {
    color: #ef4444;
}

.callout.success {
    background: rgba(34, 197, 94, 0.1);
    border-left-color: #22c55e;
}

.callout.success strong {
    color: #22c55e;
}

/* Tabs */
.tabs {
    margin-bottom: 1.5rem;
}

.tab-buttons {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.tab-button:hover {
    color: var(--fg);
}

.tab-button.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Command reference boxes */
.command-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.command-header {
    background: rgba(59, 130, 246, 0.1);
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.command-header code {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    background: none;
    padding: 0;
}

.command-body {
    padding: 1rem 1.25rem;
}

.command-body p {
    margin-bottom: 0.75rem;
}

.command-body p:last-child {
    margin-bottom: 0;
}

/* Flags table inside command box */
.command-box .flags-table {
    width: 100%;
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.command-box .flags-table th,
.command-box .flags-table td {
    padding: 0.5rem 0.75rem;
}

/* Diagram container */
.diagram {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    text-align: center;
}

.diagram pre {
    margin: 0;
    display: inline-block;
    text-align: left;
}

.diagram code {
    background: none;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Step indicators */
.steps {
    counter-reset: step;
    padding-left: 0;
    list-style: none;
}

.steps li {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1.5rem;
}

.steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge.enterprise {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
}

.badge.beta {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge.new {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

/* Version history items */
.version-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.version-item .version-info {
    flex: 1;
}

.version-item .version-number {
    font-weight: 600;
    color: var(--fg);
}

.version-item .version-date {
    font-size: 0.85rem;
    color: var(--muted);
    margin-left: 0.75rem;
}

.version-item .version-actions {
    display: flex;
    gap: 0.5rem;
}

/* Nav active state */
.nav-links a.active {
    color: var(--fg);
}

/* Responsive */
@media (max-width: 900px) {
    .docs-sidebar {
        width: 200px;
    }

    .docs-content {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .docs-layout {
        flex-direction: column;
    }

    .docs-sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1rem;
    }

    .docs-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .docs-nav-section {
        width: 100%;
        padding: 0.75rem 0 0.25rem;
        margin-top: 0.25rem;
    }

    .docs-nav-section:first-child {
        padding-top: 0;
    }

    .docs-nav-item {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    .docs-content {
        padding: 1.5rem;
    }

    .docs-content h1 {
        font-size: 1.75rem;
    }

    .docs-content h2 {
        font-size: 1.3rem;
    }

    .next-steps-grid,
    .principles-grid {
        grid-template-columns: 1fr;
    }

    .toc ul {
        columns: 1;
    }
}

/* Print styles */
@media print {
    .docs-sidebar {
        display: none;
    }

    .docs-content {
        max-width: 100%;
        padding: 0;
    }

    .code-block {
        border: 1px solid #ccc;
        background: #f5f5f5;
    }

    .callout {
        border: 1px solid #ccc;
        background: #f9f9f9;
    }
}
