<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= isset($settings['site_name']) ? $settings['site_name'] : 'Demo Site' ?> - Premium Preview</title>
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    
    <style>
        :root {
            --primary: #6366f1;
            --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
            --bg-gradient: radial-gradient(circle at top right, #1e1b4b 0%, #0f172a 100%);
            --card-glass: rgba(255, 255, 255, 0.03);
            --card-border: rgba(255, 255, 255, 0.1);
            --text-main: #f8fafc;
            --text-muted: #94a3b8;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Outfit', sans-serif;
            background: var(--bg-gradient);
            min-height: 100vh;
            color: var(--text-main);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 40px 20px;
            overflow-x: hidden;
        }

        /* Abstract Background Elements */
        .orb {
            position: absolute;
            filter: blur(80px);
            z-index: 0;
            border-radius: 50%;
            opacity: 0.4;
        }
        .orb-1 { width: 400px; height: 400px; background: #6366f1; top: -10%; left: -5%; }
        .orb-2 { width: 300px; height: 300px; background: #a855f7; bottom: -5%; right: -5%; }

        .container {
            max-width: 900px;
            width: 100%;
            position: relative;
            z-index: 10;
        }

        .main-card {
            background: rgba(15, 23, 42, 0.8);
            backdrop-filter: blur(20px);
            border: 1px solid var(--card-border);
            border-radius: 32px;
            padding: 60px;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
            text-align: center;
            animation: fadeInScale 0.8s cubic-bezier(0.16, 1, 0.3, 1);
        }

        @keyframes fadeInScale {
            from { opacity: 0; transform: scale(0.95) translateY(20px); }
            to { opacity: 1; transform: scale(1) translateY(0); }
        }

        .logo-section {
            margin-bottom: 40px;
        }

        .logo-section img {
            max-width: 160px;
            height: auto;
            filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.3));
        }

        h1 {
            font-size: 42px;
            font-weight: 700;
            margin-bottom: 16px;
            background: var(--primary-gradient);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            letter-spacing: -1px;
        }

        .subtitle {
            font-size: 18px;
            color: var(--text-muted);
            margin-bottom: 50px;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
            line-height: 1.6;
        }

        /* Features Grid */
        .features-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
            margin-bottom: 50px;
        }

        .feature-box {
            background: var(--card-glass);
            border: 1px solid var(--card-border);
            border-radius: 20px;
            padding: 24px 20px;
            transition: all 0.3s ease;
            text-align: left;
        }

        .feature-box:hover {
            background: rgba(255, 255, 255, 0.06);
            border-color: rgba(99, 102, 241, 0.4);
            transform: translateY(-5px);
        }

        .feature-icon {
            width: 48px;
            height: 48px;
            background: rgba(99, 102, 241, 0.1);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 16px;
            color: var(--primary);
            font-size: 20px;
        }

        .feature-box h3 {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 8px;
            color: var(--text-main);
        }

        .feature-box p {
            font-size: 13px;
            color: var(--text-muted);
            line-height: 1.4;
        }

        /* Buttons and Links */
        .cta-group {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }

        .btn-enter {
            background: var(--primary-gradient);
            color: white;
            padding: 18px 64px;
            font-size: 18px;
            font-weight: 600;
            border-radius: 100px;
            text-decoration: none;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            display: inline-flex;
            align-items: center;
            gap: 12px;
            box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.5);
        }

        .btn-enter:hover {
            transform: scale(1.05);
            box-shadow: 0 15px 40px -10px rgba(99, 102, 241, 0.6);
        }

        .demo-footer {
            margin-top: 50px;
            padding-top: 30px;
            border-top: 1px solid var(--card-border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 20px;
        }

        .footer-info {
            display: flex;
            align-items: center;
            gap: 12px;
            color: var(--text-muted);
            font-size: 14px;
        }

        .footer-info i {
            color: #fbbf24;
        }

        @media (max-width: 768px) {
            .features-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            .main-card {
                padding: 40px 24px;
            }
            h1 { font-size: 32px; }
        }

        @media (max-width: 480px) {
            .features-grid {
                grid-template-columns: 1fr;
            }
            .btn-enter {
                width: 100%;
                justify-content: center;
            }
        }
    </style>
</head>
<body>
    <div class="orb orb-1"></div>
    <div class="orb orb-2"></div>

    <div class="container">
        <div class="main-card">
            <?php if (!empty($settings['logo'])): ?>
            <div class="logo-section">
                <img src="<?= base_url($settings['logo']) ?>" alt="Site Logo">
            </div>
            <?php endif; ?>

            <h1>The Future of Dining</h1>
            <p class="subtitle">Experience the ultimate SaaS QR Menu and Restaurant Management platform. Explore all the premium features in our interactive demo.</p>

            <div class="features-grid">
                <!-- QR Menu -->
                <div class="feature-box">
                    <div class="feature-icon"><i class="fas fa-qrcode"></i></div>
                    <h3>QR Menu & Ordering</h3>
                    <p>Contactless digital menus with instant table ordering system.</p>
                </div>
                <!-- POS -->
                <div class="feature-box">
                    <div class="feature-icon"><i class="fas fa-cash-register"></i></div>
                    <h3>Advanced POS</h3>
                    <p>Full-featured Point of Sale for dine-in, takeaway, and delivery.</p>
                </div>
                <!-- WhatsApp -->
                <div class="feature-box">
                    <div class="feature-icon"><i class="fab fa-whatsapp"></i></div>
                    <h3>WhatsApp Orders</h3>
                    <p>Receive orders directly on WhatsApp for seamless communication.</p>
                </div>
                <!-- Reservations -->
                <div class="feature-box">
                    <div class="feature-icon"><i class="fas fa-calendar-alt"></i></div>
                    <h3>Table Reservation</h3>
                    <p>Smart booking system to manage your restaurant capacity.</p>
                </div>
                <!-- Inventory -->
                <div class="feature-box">
                    <div class="feature-icon"><i class="fas fa-boxes"></i></div>
                    <h3>Inventory Control</h3>
                    <p>Track stock levels and manage vendor supplies efficiently.</p>
                </div>
                <!-- Analytics -->
                <div class="feature-box">
                    <div class="feature-icon"><i class="fas fa-chart-line"></i></div>
                    <h3>Live Analytics</h3>
                    <p>Real-time insights into your sales, items, and performance.</p>
                </div>
            </div>

            <div class="cta-group">
                <a href="<?= base_url('home/enter_site') ?>" class="btn-enter" target="_top" onclick="return forceTopLocation(this.href)">
                    Enter Demo Site <i class="fas fa-arrow-right"></i>
                </a>
            </div>

            <script>
                function forceTopLocation(url) {
                    if (window.top !== window.self) {
                        window.top.location.href = url;
                        return false; 
                    }
                    return true; 
                }
            </script>

            <div class="demo-footer">
                <div class="footer-info">
                    <i class="fas fa-info-circle"></i>
                    <span>All premium features are unlocked for this preview.</span>
                </div>
                <div class="footer-info">
                    <i class="fas fa-shield-alt" style="color: #10b981;"></i>
                    <span>Secure Sandbox • Professional Mode</span>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
