<?php
 
 
?>

<div class="error-404">

    
    <div class="error-404__hero">
        <div class="error-404__code" aria-hidden="true">
            <span class="error-404__digit">4</span>
            <span class="error-404__ring">
                <i class="fa-solid fa-circle-play"></i>
            </span>
            <span class="error-404__digit">4</span>
        </div>
        <h1 class="error-404__title"><?php echo __('page_not_found'); ?></h1>
        <p class="error-404__desc"><?php echo __('page_not_found_desc'); ?></p>

        <form class="error-404__search" action="<?php echo url('/search'); ?>" method="GET">
            <i class="fa-solid fa-magnifying-glass"></i>
            <input type="text" name="q" placeholder="<?php echo __('search_placeholder'); ?>" autofocus>
        </form>

        <div class="error-404__actions">
            <a href="<?php echo url('/'); ?>" class="error-404__btn error-404__btn--primary">
                <i class="fa-solid fa-house"></i>
                <?php echo __('back_to_home'); ?>
            </a>
            <a href="<?php echo url('/categories'); ?>" class="error-404__btn">
                <i class="fa-solid fa-th-large"></i>
                <?php echo __('categories'); ?>
            </a>
            <a href="<?php echo url('/pornstars'); ?>" class="error-404__btn">
                <i class="fa-solid fa-star"></i>
                <?php echo __('pornstars'); ?>
            </a>
        </div>
    </div>

    
    <?php if (!empty($popularCategories)): ?>
    <div class="error-404__categories">
        <div class="error-404__cats-grid">
            <?php foreach ($popularCategories as $cat): ?>
                <a href="<?php echo url('/category/' . ($cat['slug'] ?? $cat['id'])); ?>" class="error-404__cat-pill">
                    <?php echo htmlspecialchars($cat['name']); ?>
                    <?php if (!empty($cat['video_count'])): ?>
                        <span><?php echo Format::number((int)$cat['video_count']); ?></span>
                    <?php endif; ?>
                </a>
            <?php endforeach; ?>
        </div>
    </div>
    <?php endif; ?>

    
    <?php if (!empty($trendingVideos)): ?>
    <div class="error-404__trending">
        <h2 class="error-404__section-title"><?php echo __('popular_videos'); ?></h2>
        <div class="video-grid">
            <?php foreach ($trendingVideos as $video): ?>
                <?php echo hentaiVideoCard($video); ?>
            <?php endforeach; ?>
        </div>
    </div>
    <?php endif; ?>

</div>
