<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Moviesbighub TᴇʀᴀBᴏx Pʟᴀʏᴇʀ</title>
  <style>
    :root {
      --bg-gradient: linear-gradient(to bottom, #6a11cb, #2575fc);
      --bg-color: rgba(255, 255, 255, 0.1);
      --text-color: #fff;
      --button-bg: #ff6a3d;
      --button-hover: #ff3a00;
    }
    [data-theme="dark"] {
      --bg-gradient: linear-gradient(to bottom, #232526, #414345);
      --bg-color: rgba(0, 0, 0, 0.8);
      --text-color: #e0e0e0;
      --button-bg: #444;
      --button-hover: #666;
    }
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    body {
      font-family: 'Arial', sans-serif;
      background: var(--bg-gradient);
      color: var(--text-color);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      min-height: 100vh;
      overflow: auto; /* Allow scrolling */
      text-align: center;
      transition: background 0.3s, color 0.3s;
    }
    .container {
      background: var(--bg-color);
      padding: 20px;
      border-radius: 15px;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
      width: 100%;
      max-width: 600px;
      min-width: 280px; /* Minimum width for smaller screens */
      box-sizing: border-box;
      margin-top: 40px; /* Prevents the input from sticking to the top */
      overflow: hidden;
    }
    h1 {
      font-size: 2.5rem;
      margin-bottom: 10px;
    }
    p {
      font-size: 1.2rem;
      margin-bottom: 20px;
    }
    input[type="text"] {
      width: 100%;
      padding: 15px;
      margin: 10px 0;
      border: none;
      border-radius: 10px;
      font-size: 1rem;
      outline: none;
    }
    button {
      background: var(--button-bg);
      color: var(--text-color);
      padding: 12px 20px;
      font-size: 1.1rem;
      border: none;
      border-radius: 10px;
      cursor: pointer;
      transition: background 0.3s;
    }
    button:hover {
      background: var(--button-hover);
    }
    iframe {
      margin-top: 20px;
      width: 100%;
      height: 400px;
      border: none;
      border-radius: 15px;
    }
    .error {
      color: #ff3a3a;
      font-size: 0.9rem;
      margin-top: 10px;
    }
    .credit {
      font-size: 0.9rem;
      color: var(--text-color);
      margin-top: 20px;
    }
    .credit a {
      color: var(--button-bg);
      text-decoration: none;
    }
    .credit a:hover {
      text-decoration: underline;
    }
    .support-links {
      margin-top: 10px;
      font-size: 0.9rem;
    }
    .support-links a {
      color: var(--text-color);
      text-decoration: none;
      margin: 0 5px;
    }
    .support-links a:hover {
      text-decoration: underline;
    }
    .dark-mode-toggle {
      position: absolute;
      top: 10px;
      right: 10px;
      background: var(--button-bg);
      color: var(--text-color);
      padding: 5px 10px;
      border-radius: 5px;
      cursor: pointer;
      transition: background 0.3s;
    }
    .dark-mode-toggle:hover {
      background: var(--button-hover);
    }
    .useful-section {
      margin-top: 20px;
      padding: 15px;
      background: var(--bg-color);
      border-radius: 10px;
    }
    .useful-section h3 {
      font-size: 1.2rem;
      margin-bottom: 10px;
    }
    .useful-section ul {
      list-style: none;
      padding-left: 0;
      font-size: 1rem;
    }
    .useful-section li {
      margin-bottom: 5px;
    }

    /* Mobile and Laptop Responsive Design */
    @media (max-width: 1024px) {
      h1 {
        font-size: 2rem; /* Adjusted heading for larger screens like tablets */
      }
      .container {
        width: 90%; /* Allows the container to adapt better on larger screens */
      }
      iframe {
        height: 350px;
      }
    }

    @media (max-width: 768px) {
      h1 {
        font-size: 1.8rem;
      }
      .container {
        width: 90%;
      }
      iframe {
        height: 300px;
      }
      p {
        font-size: 1rem;
      }
    }

    @media (max-width: 480px) {
      h1 {
        font-size: 1.5rem;
      }
      .container {
        width: 95%;
      }
      iframe {
        height: 250px;
      }
      button {
        font-size: 1rem;
        padding: 10px 15px;
      }
    }
  </style>
</head>
<body>
  <button class="dark-mode-toggle" onclick="toggleDarkMode()">✳️</button>
  <div class="container">
    <h1>Moviesbighub TᴇʀᴀBᴏx Pʟᴀʏᴇʀ</h1>
    <p>Enter the TeraBox video link to play your video.</p>
    <input type="text" id="videoUrl" placeholder="Paste your TeraBox video URL here">
    <button onclick="embedVideo()">Play Video</button>
    <iframe id="videoFrame"></iframe>
    <p class="error" id="errorMessage"></p>

    <!-- Useful Section -->
    <div class="useful-section">
      <h3>It may be useful:</h3>
      <ul>
        <li>Ensure the video URL is correct.</li>
        <li>Use a stable internet connection for smooth playback.</li>
        <li>Check TeraBox support if the video doesn’t load.</li>
        <li>For further assistance, <a href="https://t.me/mbhbackup1" target="_blank">contact support</a>.</li>
      </ul>
    </div>

    <!-- Credit Section -->
    <div class="credit">
      <p>Powered by <a href="https://t.me/moviesbighub1" target="_blank">@moviesbighub</a></p>
    </div>

    <!-- Support Links -->
    <div class="support-links">
      <p>Need help? <a href="https://t.me/mbhbackup1" target="_blank">Visit Support</a> | 
      <a href="https://t.me/mbhbackup1" target="_blank">Contact Us</a></p>
    </div>
  </div>

    function embedVideo() {
      const videoUrl = document.getElementById('videoUrl').value.trim();
      const videoFrame = document.getElementById('videoFrame');
      const errorMessage = document.getElementById('errorMessage');

      // Reset previous iframe and error message
      videoFrame.src = '';
      errorMessage.textContent = '';

      if (!videoUrl) {
        errorMessage.textContent = 'Please enter a valid TeraBox video URL.';
        return;
      }

      try {
        const embedUrl = `https://www.terabox.tech/play.html?url=${encodeURIComponent(videoUrl)}`;
        videoFrame.src = embedUrl;
      } catch (error) {
        errorMessage.textContent = 'An error occurred while embedding the video.';
      }
    }

    function toggleDarkMode() {
      const currentTheme = document.body.getAttribute('data-theme');
      document.body.setAttribute('data-theme', currentTheme === 'dark' ? 'light' : 'dark');
    }
</body>
</html>