<?php include 'header.php'; ?>

<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card shadow border-0 rounded-4 overflow-hidden">
                <div class="row g-0">
                    <div class="col-lg-5 bg-success p-5 text-white d-flex flex-column justify-content-center">
                        <h2 class="fw-bold mb-4">Get in Touch</h2>
                        <p class="mb-4 opacity-75">Have questions or feedback about our APKs? We'd love to hear from you. Send us a message and we'll respond as soon as possible.</p>
                        
                        <div class="d-flex align-items-center mb-3">
                            <i class="bi bi-geo-alt-fill me-3 fs-4"></i>
                            <span>Jakarta, Indonesia</span>
                        </div>
                        <div class="d-flex align-items-center mb-3">
                            <i class="bi bi-envelope-fill me-3 fs-4"></i>
                            <span><?php echo get_setting('contact_email', 'support@apknusa.com'); ?></span>
                        </div>
                        
                        <div class="mt-4 pt-4 border-top border-white border-opacity-25">
                            <h6 class="fw-bold mb-3">Follow Us</h6>
                            <div class="d-flex gap-3">
                                <?php if($fb = get_setting('facebook_url')): ?><a href="<?php echo $fb; ?>" class="text-white fs-5"><i class="bi bi-facebook"></i></a><?php endif; ?>
                                <?php if($tw = get_setting('twitter_url')): ?><a href="<?php echo $tw; ?>" class="text-white fs-5"><i class="bi bi-twitter-x"></i></a><?php endif; ?>
                                <?php if($ig = get_setting('instagram_url')): ?><a href="<?php echo $ig; ?>" class="text-white fs-5"><i class="bi bi-instagram"></i></a><?php endif; ?>
                                <?php if($tg = get_setting('telegram_url')): ?><a href="<?php echo $tg; ?>" class="text-white fs-5"><i class="bi bi-telegram"></i></a><?php endif; ?>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-7 p-5 bg-white">
                        <?php if (isset($_SESSION['success'])): ?>
                            <div class="alert alert-success alert-dismissible fade show rounded-3 mb-4" role="alert">
                                <i class="bi bi-check-circle-fill me-2"></i>
                                <?php echo $_SESSION['success']; unset($_SESSION['success']); ?>
                                <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                            </div>
                        <?php endif; ?>

                        <?php if (isset($_SESSION['error'])): ?>
                            <div class="alert alert-danger alert-dismissible fade show rounded-3 mb-4" role="alert">
                                <i class="bi bi-exclamation-triangle-fill me-2"></i>
                                <?php echo $_SESSION['error']; unset($_SESSION['error']); ?>
                                <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                            </div>
                        <?php endif; ?>

                        <form action="/contact" method="POST">
                            <div class="mb-3">
                                <label class="form-label fw-bold small text-uppercase">Full Name</label>
                                <input type="text" name="name" class="form-control form-control-lg bg-light border-0 px-4" placeholder="Your Name" required>
                            </div>
                            <div class="mb-3">
                                <label class="form-label fw-bold small text-uppercase">Email Address</label>
                                <input type="email" name="email" class="form-control form-control-lg bg-light border-0 px-4" placeholder="name@example.com" required>
                            </div>
                            <div class="mb-3">
                                <label class="form-label fw-bold small text-uppercase">Subject</label>
                                <input type="text" name="subject" class="form-control form-control-lg bg-light border-0 px-4" placeholder="How can we help?">
                            </div>
                            <div class="mb-4">
                                <label class="form-label fw-bold small text-uppercase">Message</label>
                                <textarea name="message" class="form-control bg-light border-0 px-4 py-3" rows="4" placeholder="Your message here..." required></textarea>
                            </div>
                            <div class="d-grid">
                                <button type="submit" class="btn btn-success btn-lg rounded-pill py-3 fw-bold">
                                    Send Message <i class="bi bi-send-fill ms-2"></i>
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<?php include 'footer.php'; ?>
