<?php $contacts = get_by_section_name('contacts'); ?>
<?php $settings = settings(); ?>
<?php if (!empty($contacts) && $contacts['status'] == 1): ?>
    <section class="theme-contact-section homeSection" id="contacts">
        <div class="container">
            <div class="row justify-content-center">
                <div class="col-lg-8">
                    <div class="contact-header text-center mb-5">
                        <h2 class="font-weight-bold contact-title"><?= html_escape($contacts['heading']); ?></h2>
                        <p class="text-muted contact-subtitle"><?= html_escape($contacts['sub_heading']); ?></p>
                    </div>
                </div>
            </div>

            <div class="row justify-content-center">
                <div class="col-lg-8">
                    <div class="contact-card shadow-sm">
                        <form action="<?= base_url('home/send_mail/'); ?>" method="post" id="home_contact" class="contact-form-inner">
                            <span class="reg_msg"></span>
                            <?= csrf(); ?>
                            <div class="row">
                                <div class="col-md-6 mb-4">
                                    <div class="form-group-custom">
                                        <label class="form-label font-weight-bold text-muted small text-uppercase letter-spacing-1"><?= !empty(lang('name')) ? lang('name') : "Name"; ?></label>
                                        <input type="text" name="name" class="form-control form-control-custom" placeholder="John Doe">
                                    </div>
                                </div>

                                <div class="col-md-6 mb-4">
                                    <div class="form-group-custom">
                                        <label class="form-label font-weight-bold text-muted small text-uppercase letter-spacing-1"><?= !empty(lang('email')) ? lang('email') : "Email"; ?></label>
                                        <input type="email" name="email" class="form-control form-control-custom" placeholder="john@example.com">
                                    </div>
                                </div>
                            </div>

                            <div class="form-group-custom mb-4">
                                <label class="form-label font-weight-bold text-muted small text-uppercase letter-spacing-1"><?= !empty(lang('subject')) ? lang('subject') : "Subject"; ?></label>
                                <input type="text" name="subjects" class="form-control form-control-custom" placeholder="How can we help?">
                            </div>

                            <div class="form-group-custom mb-4">
                                <label class="form-label font-weight-bold text-muted small text-uppercase letter-spacing-1"><?= !empty(lang('message')) ? lang('message') : "Message"; ?></label>
                                <textarea name="msg" class="form-control form-control-custom" placeholder="Write your message here..." rows="6"></textarea>
                            </div>

                            <div class="form-group mb-4">
                                <?php include VIEWPATH . 'common_layouts/recaptcha.php'; ?>
                            </div>

                            <div class="text-center mt-2">
                                <button type="submit" class="btn btn-primary btn-contact-submit d-inline-flex align-items-center justify-content-center mail_send_btn"> 
                                    <?= !empty(lang('send')) ? lang('send') : "Send Message"; ?> <i class="fas fa-paper-plane ml-2"></i>
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </section>
<?php endif; ?>