/* Documentation Layout */
.docs-layout {
    display: flex;
    margin-top: 64px;
    min-height: calc(100vh - 64px);
}

/* Sidebar */
.docs-sidebar {
    width: 280px;
    position: fixed;
    left: 0;
    top: 64px;
    height: calc(100vh - 64px);
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 32px 0;
}

.sidebar-section {
    margin-bottom: 32px;
    padding: 0 24px;
}

.sidebar-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.sidebar-link {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    border-radius: 0;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.sidebar-link:hover {
    background: var(--bg-tertiary);
    color: var(--accent);
}

.sidebar-link.active {
    background: var(--bg-tertiary);
    color: var(--accent);
    font-weight: 500;
}

/* Main Content */
.docs-content {
    margin-left: 280px;
    padding: 48px 64px 120px;
    max-width: 1000px;
    width: 100%;
}

.doc-section {
    margin-bottom: 80px;
    scroll-margin-top: 80px;
}

.doc-section h1 {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.doc-section h2 {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.doc-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
}

.doc-intro {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
}

.doc-section p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.doc-section ul {
    margin: 16px 0;
    padding-left: 24px;
}

.doc-section li {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 8px;
}

/* Detection Meta */
.detection-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.detection-badge {
    padding: 4px 12px;
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detection-badge.executor {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.detection-badge.environment {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.detection-badge.limb {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.detection-badge.integrity {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.detection-badge.beta {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.detection-severity {
    padding: 4px 12px;
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
}

.detection-severity.critical {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.detection-severity.high {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.detection-severity.medium {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

/* Code Blocks */
.code-block {
    background:
        linear-gradient(180deg, rgba(24, 27, 36, 0.94), rgba(20, 23, 31, 0.94)),
        var(--pattern-dot);
    background-size:
        auto,
        20px 20px;
    border: 1px solid var(--border);
    border-radius: 0;
    margin: 24px 0;
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.code-header span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.copy-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.copy-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.code-block pre {
    padding: 20px;
    margin: 0;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #e5e7eb;
}

/* Info and Warning Boxes */
.info-box,
.warning-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 0;
    margin: 24px 0;
}

.info-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.info-box svg {
    flex-shrink: 0;
    color: #60a5fa;
    margin-top: 2px;
}

.warning-box {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.warning-box.warning-critical {
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.4);
    border-left: 4px solid #eab308;
}

.warning-box svg {
    flex-shrink: 0;
    color: #eab308;
    margin-top: 2px;
}

.info-box div,
.warning-box div {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.info-box strong,
.warning-box strong {
    color: var(--text-primary);
}

.info-box code,
.warning-box code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 0;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Active nav link */
.nav-links a.active {
    color: var(--text-primary);
}

/* Logo link styling */
.navbar .logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.2s;
    font-weight: 600;
}

.navbar .logo:hover {
    opacity: 0.8;
}

.logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

/* Responsive */
@media (max-width: 1024px) {
    .docs-sidebar {
        width: 240px;
    }

    .docs-content {
        margin-left: 240px;
        padding: 32px 32px 80px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        gap: 0;
        padding: 16px 0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
        z-index: 999;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links a {
        padding: 12px 24px;
        display: block;
        border-bottom: 1px solid var(--border);
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .nav-links .btn-primary {
        margin: 8px 24px;
        text-align: center;
    }

    .docs-sidebar {
        display: none;
    }

    .docs-content {
        margin-left: 0;
        padding: 24px 16px 80px;
    }

    .doc-section h1 {
        font-size: 36px;
    }

    .doc-section h2 {
        font-size: 28px;
    }

    .doc-section h3 {
        font-size: 18px;
    }

    .detection-meta {
        flex-wrap: wrap;
    }

    .code-block pre {
        padding: 16px;
    }

    .code-block code {
        font-size: 13px;
    }
}
