<?php
/*
* Display social media
*/
?>
<div class="slider-social-box">
    <div class="top_social">
        <?php
        // Declare variables with default values.
        $job_seeker_resume_social_media_youtube = get_theme_mod('job_seeker_resume_social_media_youtube', '');
        $job_seeker_resume_social_media_twitter = get_theme_mod('job_seeker_resume_social_media_twitter', '');
        $job_seeker_resume_social_media_instagram = get_theme_mod('job_seeker_resume_social_media_instagram', '');
        $job_seeker_resume_social_media_linkedin = get_theme_mod('job_seeker_resume_social_media_linkedin', '');
        $job_seeker_resume_social_media_behance = get_theme_mod('job_seeker_resume_social_media_behance', '');
        $job_seeker_resume_social_media_dribbble = get_theme_mod('job_seeker_resume_social_media_dribbble', '');

        // Check if at least one social media link is available.
        $job_seeker_resume_has_social_icons = $job_seeker_resume_social_media_youtube || $job_seeker_resume_social_media_twitter || 
            $job_seeker_resume_social_media_instagram || $job_seeker_resume_social_media_behance || $job_seeker_resume_social_media_linkedin || $job_seeker_resume_social_media_dribbble;
        ?>
        <?php if ($job_seeker_resume_has_social_icons): ?>
            <div class="socialbox">
                <div class="social-area has-icons">
                    <?php if ($job_seeker_resume_social_media_instagram): ?>
                        <a target="_blank" href="<?php echo esc_url($job_seeker_resume_social_media_instagram); ?>">
                            <i class="fab fa-instagram"></i>
                            <span class="screen-reader-text"><?php esc_html_e('Instagram', 'job-seeker-resume'); ?></span>
                        </a>
                    <?php endif; ?>

                    <?php if ($job_seeker_resume_social_media_linkedin): ?>
                        <a target="_blank" href="<?php echo esc_url($job_seeker_resume_social_media_linkedin); ?>">
                            <i class="fa-brands fa-linkedin"></i>
                            <span class="screen-reader-text"><?php esc_html_e('Linkedin', 'job-seeker-resume'); ?></span>
                        </a>
                    <?php endif; ?>

                    <?php if ($job_seeker_resume_social_media_twitter): ?>
                        <a target="_blank" href="<?php echo esc_url($job_seeker_resume_social_media_twitter); ?>">
                            <i class="fab fa-twitter"></i>
                            <span class="screen-reader-text"><?php esc_html_e('Twitter', 'job-seeker-resume'); ?></span>
                        </a>
                    <?php endif; ?>

                    <?php if ($job_seeker_resume_social_media_behance): ?>
                        <a target="_blank" href="<?php echo esc_url($job_seeker_resume_social_media_behance); ?>">
                            <i class="fa-brands fa-square-behance"></i>
                            <span class="screen-reader-text"><?php esc_html_e('Behance', 'job-seeker-resume'); ?></span>
                        </a>
                    <?php endif; ?>

                    <?php if ($job_seeker_resume_social_media_dribbble): ?>
                        <a target="_blank" href="<?php echo esc_url($job_seeker_resume_social_media_dribbble); ?>">
                            <i class="fa-brands fa-dribbble"></i>
                            <span class="screen-reader-text"><?php esc_html_e('Dribbble', 'job-seeker-resume'); ?></span>
                        </a>
                    <?php endif; ?>

                    <?php if ($job_seeker_resume_social_media_youtube): ?>
                        <a target="_blank" href="<?php echo esc_url($job_seeker_resume_social_media_youtube); ?>">
                            <i class="fa-brands fa-youtube"></i>
                            <span class="screen-reader-text"><?php esc_html_e('Youtube', 'job-seeker-resume'); ?></span>
                        </a>
                    <?php endif; ?>

                    <!-- Show line only if there is at least one social media link -->
                    <div class="social-line"></div>
                </div>
            </div>
        <?php endif; ?>
    </div>
</div>