<!DOCTYPE html>
<html lang="lo">
  <head>
    <meta charset="UTF-8" />
    <title>ອັບເດດແອັບ</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <style>
      body {
        margin: 0;
        font-family: system-ui, -apple-system, BlinkMacSystemFont;
        background: linear-gradient(135deg, #2d1b2e, #4a2a3d, #d65072);
        color: #ffffff;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        padding: 6px;
      }
      .card {
        background: rgba(255, 255, 255, 0.08);
        border-radius: 16px;
        padding: 28px;
        max-width: 360px;
        width: 90%;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
        text-align: center;
      }
      h1 { font-size: 22px; margin-top: 0; }
      .version { font-size: 14px; opacity: 0.8; margin-bottom: 16px; }
      .desc { text-align: left; font-size: 15px; line-height: 1.6; margin-bottom: 24px; }
      .desc li { margin-bottom: 8px; }
      .btn {
        width: 100%;
        padding: 14px;
        font-size: 16px;
        font-weight: bold;
        border-radius: 12px;
        border: none;
        cursor: pointer;
        background: #d65072;
        color: #fff;
      }
      .note { margin-top: 12px; font-size: 13px; opacity: 0.7; }
    </style>
  </head>
  <body>
    <div class="card">
      <h1>🚀 ມີເວີຊັນໃໝ່ແລ້ວ</h1>
      <div class="version">Version 2.1.0</div>
      <ul class="desc">
        <li>✨ ປັບປຸງປະສິດທິພາບການໃຊ້ງານ</li>
        <li>🐞 ແກ້ໄຂບັກທີ່ເຮັດໃຫ້ແອັບຄ້າງ</li>
        <li>🔐 ເພີ່ມຄວາມປອດໄພ</li>
        <li>⚡ ໂຫຼດໄວຂຶ້ນ</li>
      </ul>
      <button class="btn" onclick="updateApp()">ອັບເດດແອັບ</button>
      <div class="note">ແນະນຳໃຫ້ອັບເດດເພື່ອປະສົບການທີ່ດີທີ່ສຸດ</div>
    </div>
    <script>
      function updateApp() {
        var userAgent = navigator.userAgent || navigator.vendor || window.opera;
        
        // Detect Android
        if (/android/i.test(userAgent)) {
          // Try to open Play Store app directly
          window.location.href = "market://details?id=com.duangdee.itduangdee";
          
          // Fallback to Play Store web if market:// fails
          setTimeout(function() {
            window.location.href = "https://play.google.com/store/apps/details?id=com.duangdee.itduangdee&hl=th";
          }, 500);
        }
        // Detect iOS
        else if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
          // Redirect to App Store (replace with your iOS app ID)
          window.location.href = "https://apps.apple.com/la/app/duang-dee/id6749140212";
        }
        // Fallback for desktop or other devices
        else {
          window.location.href = "https://play.google.com/store/apps/details?id=com.duangdee.itduangdee&hl=th";
        }
      }
    </script>
  </body>
</html>