<?php
/**
 * Universal Footer for UHD Platform
 * Include this at the bottom of all pages: include '../include/footer.php';
 */
?>
<style>
    .uhd-footer {
        background: linear-gradient(135deg, #0a3d2f 0%, #032217 100%);
        color: #ffffff;
        position: relative;
        overflow: hidden;
        margin-top: 60px;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }
    
    .uhd-footer::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #d4a017, #dc3545, #d4a017);
    }
    
    .footer-container {
        max-width: 1300px;
        margin: 0 auto;
        padding: 60px 30px 30px;
        position: relative;
        z-index: 2;
    }
    
    .footer-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 40px;
        margin-bottom: 50px;
    }
    
    .footer-brand {
        max-width: 300px;
    }
    
    .footer-logo {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .footer-logo-icon {
        width: 45px;
        height: 45px;
        background: linear-gradient(135deg, #d4a017, #b8860b);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .footer-logo-icon i {
        font-size: 1.5rem;
        color: #0a3d2f;
    }
    
    .footer-logo-text h3 {
        font-size: 1.2rem;
        font-weight: 800;
        margin: 0;
        letter-spacing: -0.5px;
    }
    
    .footer-logo-text p {
        font-size: 0.65rem;
        opacity: 0.7;
        margin: 0;
        letter-spacing: 1px;
    }
    
    .footer-description {
        color: rgba(255,255,255,0.7);
        font-size: 0.85rem;
        line-height: 1.6;
        margin-bottom: 20px;
    }
    
    .footer-social {
        display: flex;
        gap: 12px;
    }
    
    .footer-social a {
        width: 38px;
        height: 38px;
        background: rgba(255,255,255,0.1);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        color: white;
        text-decoration: none;
    }
    
    .footer-social a:hover {
        background: #d4a017;
        transform: translateY(-3px);
        color: #0a3d2f;
    }
    
    .footer-title {
        font-size: 1.1rem;
        font-weight: 700;
        margin-bottom: 20px;
        position: relative;
        display: inline-block;
    }
    
    .footer-title::after {
        content: '';
        position: absolute;
        bottom: -8px;
        left: 0;
        width: 40px;
        height: 2px;
        background: #d4a017;
    }
    
    .footer-links {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .footer-links li {
        margin-bottom: 12px;
    }
    
    .footer-links a {
        color: rgba(255,255,255,0.7);
        text-decoration: none;
        transition: all 0.2s;
        font-size: 0.85rem;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }
    
    .footer-links a i {
        font-size: 0.7rem;
        transition: transform 0.2s;
    }
    
    .footer-links a:hover {
        color: #d4a017;
        padding-left: 5px;
    }
    
    .footer-links a:hover i {
        transform: translateX(3px);
    }
    
    .footer-contact-item {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 15px;
        color: rgba(255,255,255,0.7);
        font-size: 0.85rem;
    }
    
    .footer-contact-icon {
        width: 35px;
        height: 35px;
        background: rgba(212,160,23,0.15);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .footer-contact-icon i {
        color: #d4a017;
        font-size: 0.9rem;
    }
    
    .footer-newsletter {
        background: rgba(255,255,255,0.05);
        border-radius: 12px;
        padding: 15px;
        margin-top: 15px;
    }
    
    .footer-newsletter p {
        font-size: 0.75rem;
        margin-bottom: 10px;
        color: rgba(255,255,255,0.6);
    }
    
    .footer-newsletter-input {
        display: flex;
        gap: 8px;
    }
    
    .footer-newsletter-input input {
        flex: 1;
        padding: 10px 12px;
        border: 1px solid rgba(255,255,255,0.2);
        background: rgba(255,255,255,0.1);
        border-radius: 30px;
        color: white;
        font-size: 0.8rem;
    }
    
    .footer-newsletter-input input::placeholder {
        color: rgba(255,255,255,0.5);
    }
    
    .footer-newsletter-input button {
        background: #d4a017;
        border: none;
        padding: 0 18px;
        border-radius: 30px;
        color: #0a3d2f;
        font-weight: 600;
        cursor: pointer;
        transition: 0.2s;
    }
    
    .footer-newsletter-input button:hover {
        background: #b8860b;
        color: white;
    }
    
    .footer-bottom {
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-top: 25px;
        text-align: center;
        font-size: 0.75rem;
        color: rgba(255,255,255,0.5);
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .footer-bottom-links {
        display: flex;
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .footer-bottom-links a {
        color: rgba(255,255,255,0.5);
        text-decoration: none;
        transition: 0.2s;
    }
    
    .footer-bottom-links a:hover {
        color: #d4a017;
    }
    
    .footer-back-to-top {
        position: fixed;
        bottom: 30px;
        right: 30px;
        width: 45px;
        height: 45px;
        background: #d4a017;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
        z-index: 1000;
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    }
    
    .footer-back-to-top.show {
        opacity: 1;
        visibility: visible;
    }
    
    .footer-back-to-top:hover {
        background: #b8860b;
        transform: translateY(-3px);
    }
    
    .footer-back-to-top i {
        color: #0a3d2f;
        font-size: 1.2rem;
    }
    
    @media (max-width: 768px) {
        .footer-container {
            padding: 40px 20px 20px;
        }
        .footer-grid {
            grid-template-columns: 1fr;
            gap: 30px;
        }
        .footer-brand {
            text-align: center;
            margin: 0 auto;
        }
        .footer-social {
            justify-content: center;
        }
        .footer-title::after {
            left: 50%;
            transform: translateX(-50%);
        }
        .footer-title {
            text-align: center;
            display: block;
        }
        .footer-links {
            text-align: center;
        }
        .footer-links a {
            justify-content: center;
        }
        .footer-contact-item {
            justify-content: center;
        }
        .footer-bottom {
            flex-direction: column;
            text-align: center;
        }
    }
</style>

<footer class="uhd-footer">
    <div class="footer-container">
        <div class="footer-grid">
            <!-- Brand Column -->
            <div class="footer-brand">
                <div class="footer-logo">
                    <div class="footer-logo-icon">
                        <i class="fas fa-heartbeat"></i>
                    </div>
                    <div class="footer-logo-text">
                        <h3>UNITY HEALTHCARE DB</h3>
                        <p>NIGERIA</p>
                    </div>
                </div>
                <p class="footer-description">
                    Nigeria's premier integrated health and wealth platform. Access medical records, consult doctors, insure your health, and grow your wealth — all in one ecosystem.
                </p>
                <div class="footer-social">
                    <a href="#"><i class="fab fa-facebook-f"></i></a>
                    <a href="#"><i class="fab fa-twitter"></i></a>
                    <a href="#"><i class="fab fa-linkedin-in"></i></a>
                    <a href="#"><i class="fab fa-instagram"></i></a>
                    <a href="#"><i class="fab fa-youtube"></i></a>
                </div>
            </div>

            <!-- Quick Links -->
            <div>
                <h4 class="footer-title">Quick Links</h4>
                <ul class="footer-links">
                    <li><a href="/index.php"><i class="fas fa-chevron-right"></i> Home</a></li>
                    <li><a href="/patient/dashboard.php"><i class="fas fa-chevron-right"></i> Patient Dashboard</a></li>
                    <li><a href="/patient/medical/index.php"><i class="fas fa-chevron-right"></i> Medical Hub</a></li>
                    <li><a href="/patient/hps/dashboard.php"><i class="fas fa-chevron-right"></i> HPS Insurance</a></li>
                    <li><a href="/patient/hps/invest.php"><i class="fas fa-chevron-right"></i> HPS Invest</a></li>
                    <li><a href="/doctor/login.php"><i class="fas fa-chevron-right"></i> Doctor Portal</a></li>
                </ul>
            </div>

            <!-- Services -->
            <div>
                <h4 class="footer-title">Our Services</h4>
                <ul class="footer-links">
                    <li><a href="/patient/medical/consultations.php"><i class="fas fa-chevron-right"></i> Video Consultations</a></li>
                    <li><a href="/patient/medical/appointments.php"><i class="fas fa-chevron-right"></i> Book Appointments</a></li>
                    <li><a href="/patient/hps/single.php"><i class="fas fa-chevron-right"></i> HPS Single Plan</a></li>
                    <li><a href="/patient/hps/family.php"><i class="fas fa-chevron-right"></i> HPS Family Plan</a></li>
                    <li><a href="/patient/hps/associates.php"><i class="fas fa-chevron-right"></i> HPS Associates</a></li>
                    <li><a href="/patient/hps/invest.php"><i class="fas fa-chevron-right"></i> Medical Equipment Investment</a></li>
                </ul>
            </div>

            <!-- Contact -->
            <div>
                <h4 class="footer-title">Contact Info</h4>
                <div class="footer-contact-item">
                    <div class="footer-contact-icon"><i class="fas fa-map-marker-alt"></i></div>
                    <div>Lagos, Nigeria</div>
                </div>
                <div class="footer-contact-item">
                    <div class="footer-contact-icon"><i class="fas fa-phone-alt"></i></div>
                    <div>+234 708 936 4492</div>
                </div>
                <div class="footer-contact-item">
                    <div class="footer-contact-icon"><i class="fab fa-whatsapp"></i></div>
                    <div>+234 708 936 4492 (WhatsApp)</div>
                </div>
                <div class="footer-contact-item">
                    <div class="footer-contact-icon"><i class="fas fa-envelope"></i></div>
                    <div>support@uhd.com.ng</div>
                </div>
                <div class="footer-contact-item">
                    <div class="footer-contact-icon"><i class="fas fa-clock"></i></div>
                    <div>24/7 Customer Support</div>
                </div>

                <!-- Newsletter -->
                <div class="footer-newsletter">
                    <p><i class="fas fa-envelope me-1"></i> Subscribe for updates</p>
                    <div class="footer-newsletter-input">
                        <input type="email" placeholder="Your email address">
                        <button onclick="subscribeNewsletter()">Subscribe</button>
                    </div>
                </div>
            </div>
        </div>

        <!-- Bottom Bar -->
        <div class="footer-bottom">
            <div>&copy; <?= date('Y') ?> Unity Healthcare Database. All rights reserved.</div>
            <div class="footer-bottom-links">
                <a href="/about.php">About Us</a>
                <a href="/privacy.php">Privacy Policy</a>
                <a href="/terms.php">Terms of Service</a>
                <a href="/contact.php">Contact Us</a>
            </div>
            <div>Powered by <strong style="color: #d4a017;">Fulgent Digital Clinic</strong></div>
        </div>
    </div>
</footer>

<!-- Back to Top Button -->
<div class="footer-back-to-top" id="backToTop">
    <i class="fas fa-arrow-up"></i>
</div>

<script>
    // Back to top functionality
    const backToTop = document.getElementById('backToTop');
    
    window.addEventListener('scroll', () => {
        if (window.scrollY > 300) {
            backToTop.classList.add('show');
        } else {
            backToTop.classList.remove('show');
        }
    });
    
    backToTop.addEventListener('click', () => {
        window.scrollTo({ top: 0, behavior: 'smooth' });
    });
    
    // Newsletter subscription
    function subscribeNewsletter() {
        const email = document.querySelector('.footer-newsletter-input input').value;
        if (email && email.includes('@')) {
            alert('Thank you for subscribing! You will receive updates from UHD.');
            document.querySelector('.footer-newsletter-input input').value = '';
        } else {
            alert('Please enter a valid email address.');
        }
    }
</script>