<?php
session_start();
error_reporting(E_ALL);
ini_set('display_errors', 1);
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>DNMXSEARCH - OSINT Инструмент</title>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap" rel="stylesheet">
<style>
* {
  margin: 0; padding: 0; box-sizing: border-box;
}
body, html {
  height: 100%;
  background: #0d0d0d;
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  overflow-x: hidden;
}
.background {
  position: fixed; width: 100%; height: 100%; z-index: -1;
  background: linear-gradient(135deg, #0d0d0d, #1e1e1e, #0d0d0d);
  background-size: 600% 600%;
  animation: gradientShift 10s ease infinite;
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.particle {
  position: absolute; width: 5px; height: 5px;
  background: rgba(0,255,153,0.8);
  border-radius: 50%;
  animation: move 12s linear infinite;
}
@keyframes move {
  0% { transform: translateY(0) translateX(0); opacity: 1; }
  100% { transform: translateY(-1500px) translateX(1500px); opacity: 0; }
}
.navbar {
  position: fixed; top: 0; width: 100%;
  padding: 20px 60px; display: flex; align-items: center;
  z-index: 1000; background: rgba(0,0,0,0.3);
  transition: background 0.3s, padding 0.3s;
}
.navbar.scrolled {
  background: rgba(0,0,0,0.9);
  padding: 15px 60px;
  box-shadow: 0 5px 15px rgba(0,255,153,0.2);
}
.logo {
  font-size: 2.5rem; font-weight: 700;
  color: #00ff99; text-transform: uppercase;
  margin-right: 50px; letter-spacing: 2px;
  text-shadow: 0 0 5px #00ff99, 0 0 10px #00ff99;
  cursor: default;
}
.navbar ul {
  list-style: none; display: flex; font-size: 1.1rem;
}
.navbar ul li {
  margin-left: 30px; position: relative;
}
.navbar ul li a {
  color: #fff; text-decoration: none;
  transition: color 0.3s; position: relative;
}
.navbar ul li a::after {
  content: "";
  position: absolute; left: 0; bottom: -4px;
  width: 0%; height: 2px;
  background: #00ff99;
  transition: width 0.3s;
}
.navbar ul li a:hover::after {
  width: 100%;
}
.navbar ul li a:hover {
  color: #00ff99;
}
.profile-icon {
  margin-left: auto; width: 50px; height: 50px;
  border-radius: 50%; overflow: hidden;
  border: 2px solid #00ff99; cursor: pointer;
  transition: box-shadow 0.3s;
}
.profile-icon:hover {
  box-shadow: 0 0 10px #00ff99, 0 0 20px #00ff99;
}
.profile-icon img {
  width: 100%; height: 100%; object-fit: cover;
}
.menu-toggle {
  display: none; cursor: pointer; color: #fff;
  font-size: 2rem; margin-left: auto;
}
.hero {
  height: 100vh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 0 20px;
}
.hero h1 {
  font-size: 4rem; color: #00ff99;
  margin-bottom: 20px; animation: glow 3s ease-in-out infinite alternate, fadeInUp 2s;
}
@keyframes glow {
  0% { text-shadow: 0 0 10px #00ff99; }
  100% { text-shadow: 0 0 30px #00ff99, 0 0 60px #00ff99; }
}
@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}
.hero .subtitle {
  font-size: 1.6rem; color: #ccc;
  animation: fadeInUp 2s 0.5s forwards;
  opacity: 0; line-height: 1.6; max-width: 700px;
}
.section {
  padding: 80px 20px; text-align: center;
  font-size: 1.2rem; animation: fadeInSec 1.5s forwards;
  opacity: 0; line-height: 1.6; max-width: 900px; margin: 0 auto;
}
@keyframes fadeInSec {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
.section-title {
  font-size: 2.2rem; color: #00ff99; margin-bottom: 20px;
  text-transform: uppercase; letter-spacing: 2px;
  position: relative; display: inline-block;
  text-shadow: 0 0 5px #00ff99;
}
.section-title::before, .section-title::after {
  content: "";
  position: absolute; width: 40%; height: 2px; background: #00ff99;
  top: 50%; transform: translateY(-50%);
}
.section-title::before { left: -50%; }
.section-title::after { right: -50%; }
.ip-search {
  margin: 40px auto; display: flex; gap: 15px;
  justify-content: center; font-size: 1.2rem;
}
.ip-search input {
  flex: 1; padding: 15px;
  border: 1px solid #00ff99; border-radius: 5px;
  background: #111; color: #fff;
}
.ip-search button {
  padding: 15px 20px;
  background: #00ff99; border: none; border-radius: 5px;
  color: #0d0d0d; font-size: 1.2rem; cursor: pointer;
  transition: transform 0.3s, background 0.3s;
}
.ip-search button:hover {
  background: #00cc7a; transform: scale(1.05);
}
.phone-check {
  margin-top: 30px; display: flex; gap: 15px; justify-content: center;
}
.phone-check input {
  flex: 1; padding: 15px;
  border: 1px solid #00ff99; border-radius: 5px;
  background: #111; color: #fff; font-size: 1.2rem;
}
.phone-check button {
  padding: 15px 20px; background: #00ff99;
  border: none; border-radius: 5px; color: #0d0d0d;
  font-size: 1.2rem; cursor: pointer;
  transition: transform 0.3s, background 0.3s;
}
.phone-check button:hover {
  background: #00cc7a; transform: scale(1.05);
}
.cta-button {
  padding: 20px 40px; background: #00ff99;
  color: #0d0d0d; text-decoration: none; border-radius: 50px;
  font-size: 1.2rem; box-shadow: 0 0 15px #00ff99, 0 0 30px #00ff99;
  transition: transform 0.3s;
}
.cta-button:hover {
  transform: scale(1.1);
}
@media (max-width:768px) {
  .navbar { padding: 10px 20px; }
  .menu-toggle { display: block; }
  .navbar ul {
    display: none; flex-direction: column;
    position: absolute; top: 80px; right: 30px;
    background: rgba(0,0,0,0.9); padding: 20px;
    border-radius: 10px; font-size: 1.3rem;
  }
  .navbar.active ul { display: flex; }
  .hero h1 { font-size: 2.5rem; }
  .hero .subtitle { font-size: 1.2rem; }
  .section-title { font-size: 1.8rem; }
}
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.9); display: flex;
  justify-content: center; align-items: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 2000;
}
.modal-overlay.show {
  opacity: 1; visibility: visible;
}
.modal {
  background: #0d0d0d; padding: 40px;
  border: 2px solid #00ff99; border-radius: 10px;
  width: 420px; max-width: 95%;
  animation: scaleIn 0.5s forwards;
}
@keyframes scaleIn {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.modal h2 {
  text-align: center; margin-bottom: 20px;
  font-size: 1.8rem; color: #00ff99;
}
.modal form {
  display: none; flex-direction: column; gap: 20px;
}
.modal form.active { display: flex; }
.modal input {
  padding: 15px; border: 1px solid #00ff99; border-radius: 5px;
  background: #111; color: #fff; font-size: 1.1rem;
}
.modal button {
  padding: 15px; background: #00ff99; border: none;
  border-radius: 5px; color: #0d0d0d; font-size: 1.1rem;
  cursor: pointer; transition: transform 0.3s, background 0.3s;
}
.modal button:hover {
  background: #00cc7a; transform: scale(1.05);
}
.modal .switch {
  text-align: center; margin-top: 10px; font-size: 1rem;
}
.modal .switch a {
  color: #00ff99; cursor: pointer; text-decoration: none;
  transition: color 0.3s;
}
.modal .switch a:hover {
  color: #00cc7a;
}
</style>
</head>
<body>
<div class="background" id="background"></div>
<nav class="navbar" id="navbar">
  <div class="logo">DNMXSEARCH</div>
  <ul>
    <li><a href="#hero">Главная</a></li>
    <li><a href="#about">О проекте</a></li>
    <li><a href="#features">Функции</a></li>
    <li><a href="#ipsearch">IP</a></li>
    <li><a href="#pricing">Цены</a></li>
    <li><a href="#testimonials">Отзывы</a></li>
    <li><a href="#cta">Купить</a></li>
  </ul>
  <?php if(isset($_SESSION['username']) && $_SESSION['username'] != ''): ?>
    <a class="profile-icon" href="profile.php">
      <img src="uploads/<?php echo isset($_SESSION['avatar']) ? htmlspecialchars($_SESSION['avatar']) : 'default.png'; ?>" alt="Profile">
    </a>
  <?php else: ?>
    <div class="profile-icon" id="profile-icon">
      <img src="https://cdn-icons-png.flaticon.com/512/1144/1144760.png" alt="Profile">
    </div>
  <?php endif; ?>
  <div class="menu-toggle" id="menu-toggle">&#9776;</div>
</nav>
<?php if(!isset($_SESSION['username']) || $_SESSION['username'] == ''): ?>
<div class="modal-overlay" id="authModal">
  <div class="modal">
    <form id="loginForm" class="active" action="login.php" method="POST">
      <h2>Вход</h2>
      <input type="text" name="username" placeholder="Логин" required>
      <input type="password" name="password" placeholder="Пароль" required>
      <button type="submit">Войти</button>
      <div class="switch">Нет аккаунта? <a id="switchToRegister">Регистрация</a></div>
    </form>
    <form id="registerForm" action="register.php" method="POST">
      <h2>Регистрация</h2>
      <input type="text" name="username" placeholder="Имя пользователя" required>
      <input type="password" name="password" placeholder="Пароль" required>
      <button type="submit">Зарегистрироваться</button>
      <div class="switch">Уже есть аккаунт? <a id="switchToLogin">Войти</a></div>
    </form>
  </div>
</div>
<?php endif; ?>
<section class="hero" id="hero">
  <h1>DNMXSEARCH</h1>
  <div class="subtitle">Лучший бот для OSINT</div>
</section>
<section id="about" class="section">
  <h2 class="section-title">О проекте</h2>
  <p>DNMXSEARCH – современный инструмент для быстрого поиска, аналитики и безопасности данных. Мы объединяем информацию из различных источников, чтобы обеспечить вас надежными данными для принятия решений.</p>
</section>
<section id="features" class="section">
  <h2 class="section-title">Функции</h2>
  <p>Быстрый поиск, аналитика, безопасность, интуитивно понятный интерфейс и многое другое. Присоединяйтесь, чтобы ощутить мощь современных технологий сбора данных.</p>
</section>
<section id="ipsearch" class="section">
  <h2 class="section-title">IP проверка</h2>
  <p>Введите IP-адрес, чтобы получить базовую информацию.</p>
  <div class="ip-search">
    <input type="text" id="ipInput" placeholder="Введите IP-адрес">
    <button id="ipSearchBtn">Найти</button>
  </div>
  <div id="ipResult" style="margin-top:20px; font-size:1.2rem; min-height:40px;"></div>
  <div class="phone-check">
    <input type="text" id="phoneInput" placeholder="Проверка номера">
    <button id="phoneCheckBtn">Проверить</button>
  </div>
  <div id="phoneResult" style="margin-top:20px; font-size:1.2rem; min-height:40px;"></div>
</section>
<section id="pricing" class="section">
  <h2 class="section-title">Цены</h2>
  <p>Доступные тарифы – от базового до профессионального. Выбирайте свой план и начните исследовать мир OSINT уже сегодня.</p>
</section>
<section id="testimonials" class="section">
  <h2 class="section-title">Отзывы</h2>
  <p>«DNMXSEARCH – незаменимый инструмент!» – наши пользователи высоко оценивают удобство и надёжность сервиса.</p>
</section>
<section id="cta" class="section">
  <a class="cta-button" href="https://t.me/NARKOSEARCHBOT" target="_blank">Перейти к @NARKOSEARCHBOT</a>
</section>
<script>
const background = document.getElementById('background');
const numParticles = 250;
for(let i=0; i<numParticles; i++){
  let p = document.createElement('div');
  p.classList.add('particle');
  p.style.left = `${Math.random()*100}%`;
  p.style.top = `${Math.random()*100}%`;
  p.style.animationDuration = `${4+Math.random()*12}s`;
  p.style.animationDelay = `${-Math.random()*20}s`;
  background.appendChild(p);
}
window.addEventListener('scroll', ()=>{
  const nav = document.getElementById('navbar');
  if(window.scrollY > 60) nav.classList.add('scrolled');
  else nav.classList.remove('scrolled');
});
const menuToggle = document.getElementById('menu-toggle');
if(window.innerWidth <= 768) menuToggle.style.display = 'block';
menuToggle.addEventListener('click', ()=>{
  document.getElementById('navbar').classList.toggle('active');
});
<?php if(!isset($_SESSION['username']) || $_SESSION['username'] == ''): ?>
const authModal = document.getElementById('authModal');
authModal.classList.add('show');
document.getElementById('switchToRegister').addEventListener('click', ()=>{
  document.getElementById('loginForm').classList.remove('active');
  document.getElementById('registerForm').classList.add('active');
});
document.getElementById('switchToLogin').addEventListener('click', ()=>{
  document.getElementById('registerForm').classList.remove('active');
  document.getElementById('loginForm').classList.add('active');
});
<?php endif; ?>
document.getElementById('ipSearchBtn').addEventListener('click', ()=>{
  const ip = document.getElementById('ipInput').value.trim();
  if(!ip)return;
  fetch(`https://api.2ip.ua/geo.json?ip=${ip}`)
  .then(r => r.json())
  .then(data => {
    if(!data.country) {
      document.getElementById('ipResult').innerHTML = "<p>Ошибка: не удалось получить данные.</p>";
      return;
    }
    let html = `<p><strong>IP:</strong> ${data.ip}</p>
                <p><strong>Страна:</strong> ${data.country}</p>
                <p><strong>Город:</strong> ${data.city}</p>`;
    document.getElementById('ipResult').innerHTML = html;
  })
  .catch(err => { document.getElementById('ipResult').innerHTML = "<p>Ошибка получения данных.</p>"; });
});
document.getElementById('phoneCheckBtn').addEventListener('click', ()=>{
  const phone = document.getElementById('phoneInput').value.trim();
  if(!phone)return;
  if(phone.match(/^\+?\d{5,15}$/)) {
    document.getElementById('phoneResult').innerHTML = "<p>Номер телефона валиден.</p>";
  } else {
    document.getElementById('phoneResult').innerHTML = "<p>Неверный формат номера.</p>";
  }
});
</script>
</body>
</html>
