<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Fishy Features</title>
  <link rel="stylesheet" href="features.css">
  <style>
    /* Add the key access page styles */
    .key-access {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      background-color: rgb(17, 16, 31);
      color: rgb(117, 146, 230);
      font-family: 'Courier New', monospace;
      flex-direction: column;
      text-align: center;
    }

    .key-access h2 {
      margin-bottom: 20px;
    }

    .key-access input {
      background-color: rgb(31, 28, 54);
      color: rgb(117, 146, 230);
      border: 1px solid rgb(35, 35, 35);
      outline: none;
      font-family: 'Courier New', monospace;
      padding: 10px;
      width: 250px;
      margin-bottom: 20px;
    }

    .key-access button {
      background-color: rgb(19, 128, 225);
      color: white;
      padding: 10px 20px;
      border: none;
      cursor: pointer;
      border-radius: 5px;
    }

    .key-access button:hover {
      background-color: rgb(17, 16, 31);
    }
  </style>
</head>
<body>

  <!-- Key access page (shown initially) -->
  <div id="keyAccessPage" class="key-access">
    <h2>Enter Key to Access the Website</h2>
    <label for="secretKey">Enter Key:</label>
    <input type="text" id="secretKey" placeholder="Enter the secret key">
    <button id="accessButton">Access</button>
    <p id="errorMessage" style="color: red; display: none;">Incorrect Key. Please try again.</p>
  </div>

  <!-- Main website content (hidden initially) -->
  <div id="mainContent" style="display: none;">
    <!-- Command line interface -->
    <div id="commandLine">
      <span id="prompt">C:\></span><input id="userInput" type="text" autofocus placeholder="Type your command here" />
    </div>

    <!-- Output container for command history -->
    <div id="outputContainer">
      <div id="initialMessage">
        <span>Type Help</span>
      </div>
    </div>

    <!-- Info Popup (hidden by default) -->
    <div id="infoPopup" class="popup">
      <div class="popup-content">
        <span id="popupText">Loading...</span>
        <button id="closeButton">Close</button>
      </div>
    </div>
  </div>

  <script src="features.js"></script>
  <script>
    // JavaScript for key access functionality
    const correctKey = "@access-12414sniadf27"; // The key you want to use
    const keyAccessPage = document.getElementById('keyAccessPage');
    const mainContent = document.getElementById('mainContent');
    const accessButton = document.getElementById('accessButton');
    const secretKeyInput = document.getElementById('secretKey');
    const errorMessage = document.getElementById('errorMessage');

    // Function to handle key validation
    function validateKey() {
      const enteredKey = secretKeyInput.value.trim();
      if (enteredKey === correctKey) {
        // Key is correct, show main content and hide key access page
        keyAccessPage.style.display = 'none';
        mainContent.style.display = 'block'; // Show the main content
        document.body.style.backgroundColor = 'rgb(17, 16, 31)'; // Optional background change
      } else {
        // Incorrect key, show error message
        errorMessage.style.display = 'block';
      }
    }

    // Add event listener for the access button
    accessButton.addEventListener('click', validateKey);

    // Optional: You can also allow pressing "Enter" to validate the key
    secretKeyInput.addEventListener('keydown', function(event) {
      if (event.key === 'Enter') {
        validateKey();
      }
    });
  </script>
</body>
</html>
