<!DOCTYPE html>
<html lang="en">
	<head>
<script>
(function() {
    // Check if already initialized
    if (window.securityInitialized) return;
    window.securityInitialized = true;

    // Create and inject CSS
    const style = document.createElement('style');
    style.textContent = `
        #securityOverlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #1e2235, #2d4166);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 999999;
            font-family: system-ui, -apple-system, sans-serif;
        }
        #securityBox {
            background: #fff;
            padding: 2rem;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.2);
            width: 90%;
            max-width: 360px;
            animation: securityFadeIn 0.5s;
        }
        #securityInput {
            width: 100%;
            padding: 12px;
            border: 2px solid #ddd;
            border-radius: 8px;
            margin-bottom: 1rem;
            font-size: 16px;
            box-sizing: border-box;
        }
        #securityButton {
            width: 100%;
            padding: 12px;
            background: linear-gradient(45deg, #4a90e2, #5a9ee2);
            border: none;
            border-radius: 8px;
            color: white;
            font-size: 16px;
            cursor: pointer;
        }
        #securityError {
            color: #dc3545;
            margin-top: 1rem;
            text-align: center;
            display: none;
        }
        #securityLocked {
            text-align: center;
            display: none;
        }
        @keyframes securityFadeIn {
            from { opacity: 0; transform: translateY(-20px); }
            to { opacity: 1; transform: translateY(0); }
        }
    `;
    document.head.appendChild(style);

    // Create and inject HTML
    const div = document.createElement('div');
    div.id = 'securityOverlay';
    div.innerHTML = `
        <div id="securityBox">
            <div id="securityForm">
                <input type="password" id="securityInput" placeholder="Enter access code">
                <button id="securityButton">Verify Access</button>
                <div id="securityError">Invalid access code</div>
            </div>
            <div id="securityLocked">
                <h3>Trial Period Expired</h3>
                <p>Contact: Queenaicpu@gmail.com</p>
            </div>
        </div>
    `;

    // Add to DOM when ready
    function injectOverlay() {
        if (document.body) {
            document.body.appendChild(div);
            initSecurity();
        } else {
            setTimeout(injectOverlay, 10);
        }
    }

    function initSecurity() {
        const CORRECT_PASSWORD = '590245';
        const MAX_USES = 10;
        const STORAGE_KEY = '_secure_uses';

        let uses = parseInt(localStorage.getItem(STORAGE_KEY) || '0');

        if (uses >= MAX_USES) {
            document.getElementById('securityForm').style.display = 'none';
            document.getElementById('securityLocked').style.display = 'block';
            return;
        }

        document.getElementById('securityButton').addEventListener('click', verify);
        document.getElementById('securityInput').addEventListener('keypress', e => {
            if (e.key === 'Enter') verify();
        });

        function verify() {
            const input = document.getElementById('securityInput');
            if (input.value === CORRECT_PASSWORD) {
                localStorage.setItem(STORAGE_KEY, (uses + 1).toString());
                document.getElementById('securityOverlay').remove();
            } else {
                document.getElementById('securityError').style.display = 'block';
                input.value = '';
            }
        }
    }

    // Start injection
    injectOverlay();
})();
</script>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Wise Owl AI Chat</title>
		<script src="https://js.puter.com/v2/"></script>
		<script src="https://unpkg.com/lucide@latest"></script>
		<style>
			:root {
				--primary-gradient: linear-gradient(135deg, #4a90e2 0%, #7e57c2 100%);
			}

			* {
				margin: 0;
				padding: 0;
				box-sizing: border-box;
				font-family: 'Segoe UI', system-ui, sans-serif;
			}

			body {
				background: #f0f2f5;
			}

			.container {
				max-width: 1200px;
				margin: 0 auto;
				padding: 20px;
			}

			.chat-header {
				background: var(--primary-gradient);
				padding: 1rem;
				border-radius: 12px 12px 0 0;
				display: flex;
				align-items: center;
				gap: 1rem;
				color: white;
			}

			.owl-logo {
				width: 40px;
				height: 40px;
				background: white;
				border-radius: 50%;
				padding: 8px;
			}

			.chat-container {
				background: white;
				border-radius: 12px;
				box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
				overflow: hidden;
			}

			.chat-messages {
				height: 60vh;
				overflow-y: auto;
				padding: 1rem;
			}

			.message {
				margin: 1rem 0;
				padding: 1rem;
				border-radius: 12px;
				max-width: 80%;
				animation: fadeIn 0.3s ease-in-out;
			}

			.user-message {
				background: #e3f2fd;
				margin-left: auto;
			}

			.ai-message {
				background: #f5f5f5;
			}

			.message-actions {
				display: flex;
				gap: 0.5rem;
				margin-top: 0.5rem;
				opacity: 0.7;
			}

			.message-actions button {
				background: none;
				border: none;
				cursor: pointer;
				padding: 4px;
				border-radius: 4px;
			}

			.message-actions button:hover {
				background: rgba(0, 0, 0, 0.1);
			}

			.input-container {
				padding: 1rem;
				border-top: 1px solid #eee;
				display: flex;
				gap: 1rem;
				align-items: flex-end;
			}

			.input-box {
				flex: 1;
				border: 1px solid #ddd;
				border-radius: 8px;
				padding: 1rem;
				min-height: 60px;
				max-height: 200px;
				overflow-y: auto;
				resize: vertical;
			}

			.send-button {
				background: var(--primary-gradient);
				color: white;
				border: none;
				padding: 1rem;
				border-radius: 8px;
				cursor: pointer;
				transition: opacity 0.2s;
			}

			.send-button:hover {
				opacity: 0.9;
			}

			.hamburger-menu {
				position: fixed;
				top: 0;
				left: -300px;
				width: 300px;
				height: 100vh;
				background: white;
				box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
				transition: left 0.3s;
				z-index: 1000;
			}

			.hamburger-menu.active {
				left: 0;
			}

			.menu-items {
				padding: 1rem;
			}

			.menu-item {
				padding: 1rem;
				display: flex;
				align-items: center;
				gap: 0.5rem;
				cursor: pointer;
				border-radius: 8px;
			}

			.menu-item:hover {
				background: #f5f5f5;
			}

			@keyframes fadeIn {
				from {
					opacity: 0;
					transform: translateY(10px);
				}

				to {
					opacity: 1;
					transform: translateY(0);
				}
			}

			.file-upload {
				position: relative;
				overflow: hidden;
			}

			.file-upload input {
				position: absolute;
				opacity: 0;
				cursor: pointer;
			}

			/* Responsive Design */
			@media (max-width: 768px) {
				.container {
					padding: 10px;
				}

				.message {
					max-width: 90%;
				}
			}
		</style>
	</head>

	<body>
		<div class="container">
			<div class="chat-container">
				<div class="chat-header">
					<button id="menu-toggle" class="menu-toggle">
						<i data-lucide="menu"></i>
					</button>
					<div class="owl-logo">
						<i data-lucide="owl"></i>
					</div>
					<h1>Wise Owl AI</h1>
				</div>

				<div class="chat-messages" id="chat-messages"></div>

				<div class="input-container">
					<div class="file-upload">
						<button class="send-button">
							<i data-lucide="paperclip"></i>
						</button>
						<input type="file" multiple />
					</div>

					<div class="input-box" contenteditable="true" id="message-input" placeholder="Type your message..."></div>

					<button class="send-button" id="send-button">
						<i data-lucide="send"></i>
					</button>
				</div>
			</div>
		</div>

		<div class="hamburger-menu" id="hamburger-menu">
			<div class="menu-items">
				<div class="menu-item" onclick="startNewChat()">
					<i data-lucide="plus-circle"></i>
					New Chat
				</div>
				<div class="menu-item" onclick="window.location.href='mailto:queenaicpu@gmail.com'">
					<i data-lucide="mail"></i>
					Contact Developer
				</div>
				<div class="menu-item" onclick="clearHistory()">
					<i data-lucide="trash-2"></i>
					Clear History
				</div>
				<div class="menu-item" onclick="toggleVideoCall()">
					<i data-lucide="video"></i>
					Video Call
				</div>
				<div class="menu-item" onclick="toggleVoiceCall()">
					<i data-lucide="phone-call"></i>
					Voice Call
				</div>
			</div>
		</div>

		<script>
			// Initialize Lucide icons
			lucide.createIcons();

			// Chat state
			let chatHistory = [];
			let streamingResponse = false;

			// Initialize WebRTC
			let peerConnection;
			let localStream;

			// Menu toggle
			document.getElementById('menu-toggle').addEventListener('click', () => {
				document.getElementById('hamburger-menu').classList.toggle('active');
			});

			// Send message function
			async function sendMessage() {
				const input = document.getElementById('message-input');
				const message = input.innerText.trim();

				if (!message || streamingResponse) return;

				addMessage(message, 'user');
				input.innerText = '';

				streamingResponse = true;

				try {
					const resp = await puter.ai.chat(message, {
						model: 'grok-beta',
						stream: true,
						context: chatHistory
					});

					let aiResponse = '';

					for await (const part of resp) {
						if (part ? .text) {
							aiResponse += part.text;
							updateLastAiMessage(aiResponse);
						}
					}

					chatHistory.push({
						role: 'user',
						content: message
					});
					chatHistory.push({
						role: 'assistant',
						content: aiResponse
					});

				} catch (error) {
					addMessage('Sorry, there was an error processing your request.', 'ai');
				}

				streamingResponse = false;
			}

			// Add message to chat
			function addMessage(content, type) {
				const messagesContainer = document.getElementById('chat-messages');
				const messageDiv = document.createElement('div');
				messageDiv.className = `message ${type}-message`;
				messageDiv.innerHTML = `
                <div class="message-content">${content}</div>
                <div class="message-actions">
                    <button onclick="copyMessage(this)">
                        <i data-lucide="copy"></i>
                    </button>
                    <button onclick="shareMessage(this)">
                        <i data-lucide="share-2"></i>
                    </button>
                    <button onclick="printMessage(this)">
                        <i data-lucide="printer"></i>
                    </button>
                    ${type === 'ai' ? `
                        <button onclick="speakMessage(this)">
                            <i data-lucide="volume-2"></i>
                        </button>
                    ` : ''}
                </div>
            `;

				messagesContainer.appendChild(messageDiv);
				messagesContainer.scrollTop = messagesContainer.scrollHeight;
				lucide.createIcons();
			}

			// Update last AI message during streaming
			function updateLastAiMessage(content) {
				const messages = document.getElementsByClassName('ai-message');
				if (messages.length > 0) {
					const lastMessage = messages[messages.length - 1];
					lastMessage.querySelector('.message-content').innerHTML = content;
				} else {
					addMessage(content, 'ai');
				}
			}

			// Message actions
			function copyMessage(button) {
				const content = button.closest('.message').querySelector('.message-content').innerText;
				navigator.clipboard.writeText(content);
			}

			function shareMessage(button) {
				const content = button.closest('.message').querySelector('.message-content').innerText;
				if (navigator.share) {
					navigator.share({
						text: content
					});
				}
			}

			function printMessage(button) {
				const content = button.closest('.message').querySelector('.message-content').innerText;
				const printWindow = window.open('', '', 'height=400,width=800');
				printWindow.document.write('<html><head><title>Print Message</title></head><body>');
				printWindow.document.write(content);
				printWindow.document.write('</body></html>');
				printWindow.document.close();
				printWindow.print();
			}

			function speakMessage(button) {
				const content = button.closest('.message').querySelector('.message-content').innerText;
				const utterance = new SpeechSynthesisUtterance(content);
				window.speechSynthesis.speak(utterance);
			}

			// Chat management
			function startNewChat() {
				document.getElementById('chat-messages').innerHTML = '';
				chatHistory = [];
				document.getElementById('hamburger-menu').classList.remove('active');
			}

			function clearHistory() {
				chatHistory = [];
				localStorage.removeItem('chatHistory');
				document.getElementById('hamburger-menu').classList.remove('active');
			}

			// Event listeners
			document.getElementById('send-button').addEventListener('click', sendMessage);

			document.getElementById('message-input').addEventListener('keypress', (e) => {
				if (e.key === 'Enter' && !e.shiftKey) {
					e.preventDefault();
					sendMessage();
				}
			});

			// Initialize
			document.addEventListener('DOMContentLoaded', () => {
				const savedHistory = localStorage.getItem('chatHistory');
				if (savedHistory) {
					chatHistory = JSON.parse(savedHistory);
					chatHistory.forEach(msg => {
						addMessage(msg.content, msg.role === 'user' ? 'user' : 'ai');
					});
				}
			});

			// Auto-save chat history
			setInterval(() => {
				localStorage.setItem('chatHistory', JSON.stringify(chatHistory));
			}, 1000);
		</script>
<footer class="modern-footer">
  <style>
    @import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Raleway:wght@300;400;600&display=swap');
    
    .modern-footer {
      background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
      color: rgba(255,255,255,0.9);
      padding: 3rem 2rem;
      font-family: 'Raleway', sans-serif;
      text-align: center;
      position: relative;
      overflow: hidden;
      min-height: 250px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      box-shadow: 0 -10px 20px rgba(0,0,0,0.1);
    }

    .modern-footer::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
      animation: pulse 4s ease infinite;
    }

    .footer-text {
      position: relative;
      z-index: 1;
      line-height: 1.8;
      animation: fadeIn 1s ease-out;
    }

    .developer-name {
      font-family: 'Cinzel', serif;
      color: #4a90e2;
      font-weight: 700;
      font-size: 1.4em;
      margin: 0.5em 0;
      text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
      transition: all 0.3s ease;
    }

    .developer-name:hover {
      color: #66d9ef;
      transform: scale(1.05);
    }

    .title {
      color: #66d9ef;
      font-size: 1em;
      font-style: italic;
      letter-spacing: 1px;
      margin-bottom: 1em;
    }

    .ai-logo {
      width: 80px;
      height: 80px;
      margin: 1.5em auto;
      position: relative;
    }

    .ai-logo svg {
      width: 100%;
      height: 100%;
      filter: drop-shadow(0 0 8px rgba(102, 217, 239, 0.5));
      animation: float 3s ease-in-out infinite;
    }

    @keyframes float {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-10px); }
    }

    @keyframes pulse {
      0% { opacity: 0.5; }
      50% { opacity: 0.8; }
      100% { opacity: 0.5; }
    }

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

    @media (max-width: 768px) {
      .modern-footer {
        padding: 2rem 1rem;
      }
      
      .footer-text {
        font-size: 0.9em;
      }

      .developer-name {
        font-size: 1.2em;
      }

      .ai-logo {
        width: 60px;
        height: 60px;
      }
    }
  </style>

  <div class="footer-text">
    <div>All intellectual and material rights of this work are reserved for the developer</div>
    <div class="developer-name">Thank you, Reza Salehi (Albert)</div>
    <div class="title">AI Platforms & Data Developer</div>
    
    <div class="ai-logo">
      <svg viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path d="M50 10L90 30V70L50 90L10 70V30L50 10Z" stroke="#66d9ef" stroke-width="2"/>
        <path d="M50 10V90" stroke="#66d9ef" stroke-width="2"/>
        <path d="M90 30L10 70" stroke="#66d9ef" stroke-width="2"/>
        <path d="M10 30L90 70" stroke="#66d9ef" stroke-width="2"/>
        <circle cx="50" cy="50" r="10" fill="#4a90e2"/>
        <circle cx="50" cy="50" r="5" fill="#66d9ef"/>
        <circle cx="50" cy="10" r="3" fill="#66d9ef"/>
        <circle cx="90" cy="30" r="3" fill="#66d9ef"/>
        <circle cx="90" cy="70" r="3" fill="#66d9ef"/>
        <circle cx="50" cy="90" r="3" fill="#66d9ef"/>
        <circle cx="10" cy="70" r="3" fill="#66d9ef"/>
        <circle cx="10" cy="30" r="3" fill="#66d9ef"/>
      </svg>
    </div>
  </div>
</footer>
<head>
    <!-- Prevent page indexing by search engines -->
    <meta name="robots" content="noindex, nofollow">
    <meta name="googlebot" content="noindex, nofollow">
</head>
<body>
    <!-- Your page content goes here -->
</body>
</html>