As per your screenshot, you can add your custom class in the footer block by copying /vendor/magento/module-theme/view/frontend/templates/html/footer.phtml file in your theme with below content.
<div class="footer-container">
<div class="footer">
<?= $block->getChildHtml() ?>
<p class="bugs"><?= /* @escapeNotVerified */ __('Help Us Keep Magento Healthy') ?> - <a
href="http://www.magentocommerce.com/bug-tracking"
target="_blank"><strong><?= /* @escapeNotVerified */ __('Report All Bugs') ?></strong></a>
</p>
<address><?= /* @escapeNotVerified */ $block->getCopyright() ?></address>
</div>
</div>
EDIT:
In /magento/module-catalog-search/view/frontend/templates/result.phtml file in your theme add below content.
<?php
$class = "";
$searchProductCount = $block->getResultCount();
if ($searchProductCount == 0) {
$class = "custom_class";
}
?>
<script>
require([
'jquery',
'jquery/ui'
],function($){
jQuery('.page-footer div.footer').addClass(<?= $class; ?>);
});
</script>
Hope it helps!!!