<?php 
include_once 'config.php'; 
// Developed by: J-U-N-A-Y-E-D V-A-I 2.O
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title><?php echo getSetting($conn, 'site_name'); ?></title>
    <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap" rel="stylesheet">
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body { font-family: 'Outfit', sans-serif; background: #ffffff; -webkit-tap-highlight-color: transparent; }
        .glass-nav { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
        @keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
        .animate-marquee { display: inline-block; animation: marquee 15s linear infinite; }
        
        /* Full Screen Warning Overlay */
        #critical-integrity-error {
            display: none; position: fixed; inset: 0; background: #000; z-index: 999999;
            flex-direction: column; align-items: center; justify-content: center; text-align: center; color: white;
        }
    </style>
</head>
<body class="bg-white text-gray-800 pb-24">

<div id="critical-integrity-error">
    <div class="p-8 bg-red-600/10 border-2 border-red-600 rounded-3xl flex flex-col items-center max-w-[90%]">
        <i class="fa-solid fa-shield-virus text-red-600 text-7xl mb-6 animate-pulse"></i>
        <h1 class="text-3xl font-black uppercase tracking-tighter">System Integrity Breach</h1>
        <div class="h-1 w-20 bg-red-600 my-4"></div>
        <p class="text-gray-300 text-sm leading-relaxed max-w-sm">
            Security error detected. The developer credit has been removed or modified. 
            Access is permanently disabled until the original credit <b>(JUNAYED VAI 2.O)</b> is restored.
        </p>
        <a href="https://t.me/JUNAYED_HOSAIN" class="mt-8 bg-white text-black px-10 py-4 rounded-2xl font-black uppercase text-xs tracking-widest hover:bg-gray-200 transition-all">
            Contact Developer
        </a>
    </div>
</div>

<div id="site-body-wrapper"> <header class="glass-nav sticky top-0 z-[100] border-b border-gray-50">
    <?php if(getSetting($conn, 'marquee_active') == '1'): ?>
    <div class="bg-sky-50 border-b border-sky-100/50 py-1.5 overflow-hidden">
        <div class="flex whitespace-nowrap">
            <div class="animate-marquee text-sky-600 text-[11px] font-bold tracking-tight">
                <span class="px-8 uppercase"><i class="fa-solid fa-bullhorn mr-2"></i><?php echo getSetting($conn, 'marquee_text'); ?></span>
                <span class="px-8 uppercase"><i class="fa-solid fa-bullhorn mr-2"></i><?php echo getSetting($conn, 'marquee_text'); ?></span>
            </div>
        </div>
    </div>
    <?php endif; ?>

    <div class="container mx-auto px-4 py-3 flex justify-between items-center">
        <div class="flex items-center gap-4">
            <button onclick="toggleUserSidebar()" class="w-9 h-9 rounded-xl bg-gray-50 flex items-center justify-center text-gray-400 border border-gray-100">
                <i class="fa-solid fa-bars-staggered text-sm"></i>
            </button>
            <a href="index.php" class="text-lg font-black text-gray-800 tracking-tighter">
                <?php echo strtoupper(getSetting($conn, 'site_name')); ?>
            </a>
        </div>

        <a href="https://t.me/JUNAYED_HOSAIN" id="main-dev-btn" target="_blank" class="bg-sky-500 hover:bg-sky-600 text-white px-4 py-2.5 rounded-xl flex items-center gap-2 shadow-lg shadow-sky-200 transition-all active:scale-95">
            <i class="fa-brands fa-telegram text-lg"></i>
            <span class="text-[10px] font-black uppercase tracking-widest leading-none">
                <span>J</span><span>U</span><span>N</span><span>A</span><span>Y</span><span>E</span><span>D</span> 
                <span>V</span><span>A</span><span>I</span> 
                <span>2</span>.<span>O</span>
            </span>
        </a>
    </div>
</header>

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

<div class="p-6 text-center text-gray-400 text-sm">
    Main Application Content
</div>

</div> <script>
/**
 * Developer Credit Protection System
 * Created by: JUNAYED VAI 2.O
 */
setInterval(function() {
    const btn = document.getElementById('main-dev-btn');
    const wrap = document.getElementById('site-body-wrapper');
    const err = document.getElementById('critical-integrity-error');
    
    // Security Checks: Existence, Text Integrity, and Visibility
    if (!btn || 
        btn.innerText.replace(/\s/g, '').indexOf('JUNAYEDVAI2.O') === -1 || 
        window.getComputedStyle(btn).display === 'none' || 
        window.getComputedStyle(btn).visibility === 'hidden') {
        
        wrap.remove(); // Completely destroy the site content from DOM
        err.style.display = 'flex';
        document.body.style.backgroundColor = '#000';
    }
}, 500); // Check every 0.5 seconds
</script>

</body>
</html>