<!-- File: includes/footer.php -->

<footer class="footer mt-auto py-3 bg-light border-top">
    <div class="container">
        <div class="row align-items-center">
            <div class="col-md-6 text-center text-md-start">
                <span class="text-muted">
                    &copy; <?= date('Y') ?> Sistem Inventaris Barang - v1.0.0
                </span>
            </div>
            <div class="col-md-6 text-center text-md-end">
                <span class="text-muted">
                    Dibangun dengan <i class="bi bi-heart-fill text-danger"></i> oleh antHartono
                </span>
                <span class="ms-2 d-none d-md-inline">|</span>
                <a href="#" class="text-decoration-none ms-2" data-bs-toggle="modal" data-bs-target="#aboutModal">
                    <i class="bi bi-info-circle"></i> Tentang Aplikasi
                </a>
            </div>
        </div>
    </div>
</footer>

<!-- Modal About -->
<div class="modal fade" id="aboutModal" tabindex="-1" aria-labelledby="aboutModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header bg-primary text-white">
                <h5 class="modal-title" id="aboutModalLabel">Tentang Aplikasi</h5>
                <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div class="text-center mb-4">
                    <img src="<?php echo BASE_URL; ?>/assets/img/logo.png" alt="Logo Aplikasi" class="img-fluid" style="max-height: 80px;">
                    <h4 class="mt-3">Sistem Inventaris Barang</h4>
                </div>
                
                <div class="mb-3">
                    <h6 class="fw-bold">Versi</h6>
                    <p>1.0.0 (Stable)</p>
                </div>
                
                <div class="mb-3">
                    <h6 class="fw-bold">Fitur Utama</h6>
                    <ul>
                        <li>Manajemen Data Barang Inventaris</li>
                        <li>Pelacakan Asal Usul Barang</li>
                        <li>Pencatatan Kondisi Barang</li>
                        <li>Laporan dan Cetak Data</li>
                    </ul>
                </div>
                
                <div class="mb-3">
                    <h6 class="fw-bold">Teknologi</h6>
                    <div class="d-flex flex-wrap gap-2">
                        <span class="badge bg-primary">PHP 8+</span>
                        <span class="badge bg-success">MySQL</span>
                        <span class="badge bg-info">Bootstrap 5</span>
                        <span class="badge bg-warning text-dark">jQuery</span>
                        <span class="badge bg-danger">SweetAlert2</span>
                        <span class="badge bg-secondary">Select2</span>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-bs-dismiss="modal">Tutup</button>
            </div>
        </div>
    </div>
</div>

<!-- JavaScript Libraries -->
<script src="../assets/js/jquery.min.js"></script>
<script src="../assets/js/bootstrap.bundle.min.js"></script>
<script src="../assets/js/sweetalert2.min.js"></script>
<script src="../assets/js/select2.min.js"></script>
<script src="../assets/js/script.js"></script>

<!-- Inline Script untuk Handle Session Messages -->
<script>
$(document).ready(function() {
    // Aktifkan tooltip
    $('[data-bs-toggle="tooltip"]').tooltip();
    
    // Aktifkan popover
    $('[data-bs-toggle="popover"]').popover();
    
    // Auto close alerts setelah 5 detik
    setTimeout(function() {
        $('.alert').alert('close');
    }, 5000);
    
    // Handle session messages dengan SweetAlert
    <?php if (isset($_SESSION['success'])): ?>
        Swal.fire({
            icon: 'success',
            title: 'Sukses',
            text: '<?= addslashes($_SESSION['success']) ?>',
            timer: 3000,
            showConfirmButton: false
        });
        <?php unset($_SESSION['success']); ?>
    <?php endif; ?>
    
    <?php if (isset($_SESSION['error'])): ?>
        Swal.fire({
            icon: 'error',
            title: 'Error',
            text: '<?= addslashes($_SESSION['error']) ?>'
        });
        <?php unset($_SESSION['error']); ?>
    <?php endif; ?>
});
</script>

</body>
</html>