<!DOCTYPE html>

<html lang="en">

<head>

  <meta charset="UTF-8" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />

  <title>AI Intel Studios</title>


  <style>

    /* HERO SECTION */

    .hero {

      position: relative;

      height: 100vh;

      background: url('neon-city.jpg') center/cover no-repeat;

      display: flex;

      justify-content: center;

      align-items: center;

      text-align: center;

      color: white;

      overflow: hidden;

    }


    .hero-overlay {

      position: absolute;

      top: 0;

      left: 0;

      width: 100%;

      height: 100%;

      background: linear-gradient(

        rgba(80, 0, 255, 0.6),

        rgba(0, 200, 255, 0.6)

      );

      backdrop-filter: blur(2px);

    }


    .hero-content {

      position: relative;

      z-index: 2;

      max-width: 800px;

      padding: 20px;

      animation: fadeIn 1.5s ease-in-out;

    }


    .hero h1 {

      font-size: 3.2rem;

      font-weight: 700;

      text-shadow: 0 0 20px rgba(0, 255, 255, 0.8);

    }


    .tagline {

      font-size: 1.5rem;

      margin-top: 10px;

      color: #aeeaff;

    }


    .subtext {

      font-size: 1.2rem;

      margin-top: 5px;

      opacity: 0.9;

    }


    .cta-btn {

      display: inline-block;

      margin-top: 25px;

      padding: 14px 32px;

      font-size: 1.2rem;

      font-weight: 600;

      color: white;

      background: linear-gradient(90deg, #ff4fd8, #9d4dff);

      border-radius: 8px;

      text-decoration: none;

      box-shadow: 0 0 20px rgba(157, 77, 255, 0.7);

      transition: 0.3s ease;

    }


    .cta-btn:hover {

      transform: scale(1.05);

      box-shadow: 0 0 30px rgba(0, 255, 255, 0.9);

    }


    @keyframes fadeIn {

      from { opacity: 0; transform: translateY(20px); }

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

    }

  </style>

</head>


<body>


  <!-- HERO SECTION -->

  <section class="hero">

    <div class="hero-overlay"></div>

    <div class="hero-content">

      <h1>AI Solutions for Modern Businesses</h1>

      <p class="tagline">Automate. Innovate. Elevate.</p>

      <p class="subtext">Your AI‑Powered Digital Partner</p>

      <a href="#services" class="cta-btn">Build the Future with AI</a>

    </div>

  </section>


  <!-- Floating Chat Bubble -->

  <div id="lead-agent-bubble" style="

      position: fixed;

      bottom: 20px;

      right: 20px;

      background: #4A90E2;

      color: white;

      padding: 15px;

      border-radius: 50%;

      cursor: pointer;

      font-size: 20px;

      box-shadow: 0 4px 10px rgba(0,0,0,0.3);

  ">💬</div>


  <!-- Chat Window -->

  <div id="lead-agent-window" style="

      display: none;

      position: fixed;

      bottom: 80px;

      right: 20px;

      width: 320px;

      height: 420px;

      background: white;

      border-radius: 10px;

      box-shadow: 0 4px 20px rgba(0,0,0,0.3);

      padding: 10px;

  ">

      <div id="lead-chat-log" style="height: 330px; overflow-y: auto; padding: 5px;"></div>

      <input id="lead-input" type="text" placeholder="Type your message..." style="width: 100%; padding: 10px; border-radius: 5px; border: 1px solid #ccc;">

  </div>


  <!-- Chat Logic -->

  <script>

  document.getElementById("lead-agent-bubble").onclick = function() {

      const win = document.getElementById("lead-agent-window");

      win.style.display = win.style.display === "none" ? "block" : "none";

  };


  document.getElementById("lead-input").addEventListener("keypress", async function(e) {

      if (e.key === "Enter") {

          const msg = e.target.value;

          e.target.value = "";


          const log = document.getElementById("lead-chat-log");

          log.innerHTML += "<div><b>You:</b> " + msg + "</div>";


          const response = await fetch("http://127.0.0.1:5000/lead-agent", {

              method: "POST",

              headers: { "Content-Type": "application/json" },

              body: JSON.stringify({ conversation: msg })

          });


          const data = await response.json();

          log.innerHTML += "<div><b>Agent:</b> " + data.reply + "</div>";

          log.scrollTop = log.scrollHeight;

      }

  });

  </script>


</body>

</html>