<?php
// التأكد من تعريف $lang و $words قبل هذا الفوتير
$is_ar = ($lang == 'ar');
$dir = $is_ar ? 'rtl' : 'ltr';
$text_align = $is_ar ? 'text-end' : 'text-start';
$flex_dir = $is_ar ? 'flex-row-reverse' : 'flex-row';
?>
<style>
.footer-section {
    background-color: #1a1a1a;
    color: #fff;
    padding: 60px 0 30px;
    direction: <?php echo $dir; ?>;
}
.footer-title {
    color: #d4af37;
    font-weight: 700;
    margin-bottom: 25px;
    text-decoration: none !important;
}
.footer-link, .social-icon {
    text-decoration: none !important;
    outline: none;
}
.footer-link {
    color: rgba(255,255,255,0.7);
    display: block;
    margin-bottom: 12px;
    transition: 0.3s;
}
.footer-link:hover {
    color: #d4af37;
    padding-<?php echo ($is_ar ? 'right' : 'left'); ?>: 10px;
}
.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white !important;
    transition: 0.3s;
    border: none !important;
}
.social-icon:hover {
    background: #d4af37;
    transform: translateY(-5px);
    color: #1a1a1a !important;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    opacity: 0.8;
}
</style>

<footer class="footer-section">
    <div class="container">
        <div class="row g-5">
            <!-- الشعار والوصف -->
            <div class="col-md-4">
                <div class="mb-4" style="display:inline-block;">
                    <div style="width:100px;height:100px;background:#fff;border-radius:50%;padding:10px;display:flex;align-items:center;justify-content:center;box-shadow:0 5px 15px rgba(0,0,0,0.3);">
                        <img src="logo.png" style="max-width:100%;object-fit:contain;" alt="Logo">
                    </div>
                </div>
                <p style="max-width:300px; line-height:1.8; opacity:0.8;">
                    <?php
                    echo $is_ar
                        ? 'معهد لغة العرب: الريادة في تعليم اللغات بأساليب مبتكرة وحديثة تضمن لك التميز.'
                        : ($lang=='en' 
                            ? 'Lughat Al Arab Institute: Leading in language education with innovative and modern methods ensuring excellence.'
                            : 'Lughat Al Arab Enstitüsü: Dil eğitiminde yenilikçi ve modern yöntemlerle öncü.');
                    ?>
                </p>
            </div>

            <!-- روابط سريعة -->
            <div class="col-md-4">
                <h5 class="footer-title">
                    <?php echo $is_ar ? 'روابط سريعة' : ($lang=='en' ? 'Quick Links' : 'Hızlı Bağlantılar'); ?>
                </h5>
                <nav>
                    <a href="about.php" class="footer-link"><?php echo $words[$lang]['about']; ?></a>
                    <a href="courses.php" class="footer-link"><?php echo $words[$lang]['courses']; ?></a>
                    <a href="gallery.php" class="footer-link"><?php echo $words[$lang]['gallery']; ?></a>
                    <a href="contact.php" class="footer-link"><?php echo $words[$lang]['contact']; ?></a>
                </nav>
            </div>

            <!-- بيانات الاتصال -->
            <div class="col-md-4">
                <h5 class="footer-title"><?php echo $words[$lang]['contact_title']; ?></h5>

                <div class="contact-item">
                    <i class="fas fa-envelope text-warning"></i>
                    <span style="direction:ltr;">info@lughatarab.com</span>
                </div>
                <div class="contact-item">
                    <i class="fas fa-phone-alt text-warning"></i>
                    <span style="direction:ltr;">+962 775 400 430</span>
                </div>
                <div class="contact-item">
                    <i class="fas fa-map-marker-alt text-warning"></i>
                    <span><?php echo $is_ar ? 'عمان، الأردن' : ($lang=='en' ? 'Amman, Jordan' : 'Amman, Ürdün'); ?></span>
                </div>

               <div class="d-flex gap-2 mt-4 justify-content-start">
    <a href="https://wa.me/962775400430" class="social-icon" target="_blank">
        <i class="fab fa-whatsapp"></i>
    </a>
    <a href="https://m.facebook.com/LughatAlArabInstitute/" class="social-icon">
        <i class="fab fa-facebook-f"></i>
    </a>
    <a href="https://www.instagram.com/lughatalarabinstitute?igsh=MXVxMnlzeDYybDF6cw==" class="social-icon">
        <i class="fab fa-instagram"></i>
    </a>
    <a href="#" class="social-icon">
        <i class="fab fa-youtube"></i>
    </a>
</div>
            </div>
        </div>

        <hr style="margin:40px 0; border-color:rgba(255,255,255,0.1);">

        <div class="row align-items-center">
            <div class="col-md-12 text-center opacity-50">
                <p class="small mb-0">
                    &copy; 2025
                    <?php
                    echo $is_ar
                        ? 'معهد لغة العرب. جميع الحقوق محفوظة.'
                        : ($lang=='en' 
                            ? 'Lughat Al Arab Institute. All rights reserved.'
                            : 'Lughat Al Arab Institute. Tüm hakları saklıdır.');
                    ?>
                </p>
            </div>
        </div>
    </div>
</footer>

<!-- أيقونة واتساب عائمة -->
<a href="https://wa.me/962775400430" class="whatsapp-float" 
   style="position: fixed; bottom:30px; <?php echo ($is_ar ? 'left:30px;' : 'right:30px;'); ?> z-index:9999;
          background:#25d366;width:60px;height:60px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:white;font-size:30px;box-shadow:0 4px 15px rgba(0,0,0,0.2);text-decoration:none;">
    <i class="fab fa-whatsapp"></i>
</a>
