<html lang="en" style="">
 <head> 
  <meta charset="utf-8"> 
  <meta name="viewport" content="width=device-width,initial-scale=1"> 
  <title>GTX | NVIDIA GTX Nigeria</title> 
  <meta name="description" content="GTX is a Nigerian investment platform that helps users save, invest and grow wealth through accessible plans and secure transactions."> 
  <meta name="author" content="GTX Nigeria"> 
  <meta name="robots" content="index,follow"> 
  <link rel="canonical" href="https://nvidiagtx.com/main/dashboard"> 
  <link rel="icon" type="image/png" sizes="32x32" href="/assets/images/logo.jpg"> 
  <link rel="icon" type="image/png" sizes="16x16" href="/assets/images/logo.jpg"> 
  <link rel="apple-touch-icon" sizes="180x180" href="/assets/images/logo.jpg"> 
  <link rel="mask-icon" href="/assets/images/logo.jpg" color="rgba(0, 40, 7, 1)"> 
  <meta name="msapplication-TileImage" content="/assets/images/logo.jpg"> 
  <meta name="msapplication-TileColor" content="#ffffff"> 
  <link rel="manifest" href="/site.webmanifest"> 
  <meta name="theme-color" content="#008400ff"> 
  <meta name="csrf-token" content="1XDM2CB82wYeTsddwpLYwDFoMgDnunAQAj638FDG"> 
  <meta property="og:type" content="website"> 
  <meta property="og:title" content="Login - GTX Nigeria"> 
  <meta property="og:description" content="GTX is a Nigerian investment platform that helps users save, invest and grow wealth through accessible plans and secure transactions."> 
  <meta property="og:url" content="https://nvidiagtx.com/main/dashboard"> 
  <meta property="og:site_name" content="GTX Nigeria"> 
  <meta property="og:image" content="https://nvidiagtx.com/assets/images/logo.jpg"> 
  <meta property="og:image:alt" content="GTX Nigeria logo"> 
  <meta property="og:image:width" content="1200"> 
  <meta property="og:image:height" content="630"> 
  <meta name="twitter:card" content="summary_large_image"> 
  <meta name="twitter:title" content="Login - GTX Nigeria"> 
  <meta name="twitter:description" content="GTX is a Nigerian investment platform that helps users save, invest and grow wealth through accessible plans and secure transactions."> 
  <meta name="twitter:image" content="https://nvidiagtx.com/assets/images/logo.jpg"> 
  <meta name="twitter:image:alt" content="GTX Nigeria logo"> 
  <link rel="preconnect" href="https://fonts.googleapis.com"> 
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin=""> 
  <!-- <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap" rel="stylesheet" />
  <link rel="preconnect" href="https://fonts.googleapis.com" />
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
  <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap" rel="stylesheet" /> --> 
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> 
  <link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet"> 
  <style>

    /* Reset / base */
    * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
    body { min-height: 100vh; background: linear-gradient(135deg, #0f2a1aff, #036320ff); color: white; overflow-x: hidden; }
    .app { width:100%; max-width:520px; margin:0 auto; position:relative; }
    .green-filter {
      filter: hue-rotate(260deg) saturate(150%);
    }

  </style> 
  <style>
    h1,h2,h3,p,span { color: inherit; }
    .container { padding-bottom: 120px; }

    /* HEADER */
    .header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 1rem 1rem; }
    .header h1 { color: #facc15; font-size: 1.25rem; font-weight: 500; }
    .notif { width: 2.2rem; height: 2.2rem; background: #00ca2fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

    /* Keep original slide container but it will be used as a wrapper */
    .slide { background: linear-gradient(90deg, #111827, #1f2937); border-radius: 1rem; margin: 0 1rem 1.5rem; padding: 1rem; display: flex; position: relative; }

    /* BANNER */
    .banner { margin: 0 1rem 1.5rem; background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); border-radius: .75rem; padding: .75rem; display: flex; align-items: center; }
    .banner .icon { width: 2rem; height: 2rem; background: white; border-radius: .5rem; display: flex; align-items: center; justify-content: center; margin-right: .75rem; }
    .banner p { color: #fb923c; font-size: .85rem; font-weight: 500; }

    /* COUNTDOWN */
    .timer { margin: 0 1rem 2rem; background: url('/assets/images/bgg.png?v');background-size: cover; border-radius: 1rem; padding:1rem; text-align: center; }
    .time-boxes { display: flex; justify-content: center; gap: 1rem; margin-bottom: .75rem; }
    .time-box { background: #333; border-radius: .5rem; padding: .3rem .7rem; }
    .time-box span { font-size: 1.8rem; font-weight: 700; }

    .actions { margin: 0 1rem 2rem; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; text-align: center; }
    .action { font-size: .75rem; display: flex; flex-direction: column; align-items:center; justify-content: center}
    .action .icon { width: 3rem; height: 3rem; background: #004a11ff; border-radius: .75rem; display: flex; align-items: center; justify-content: center; font-size: 18px; margin: 0 auto .5rem; }

    /* INVESTMENT CARD */
    .investment { margin: 0 1rem 1.5rem; background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); border-radius: 1rem; padding: 1rem; }
    .inv-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
    .inv-header i { font-size: 1.4rem; cursor: pointer; }
    .inv-header .title { display:flex; align-items:center; }
    .inv-header .title i { color: #facc15; margin-right:.5rem; }
    .inv-stats { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
    .inv-stats p { font-size: .85rem; color: rgba(255,255,255,0.7); }
    .inv-stats .value { color: #facc15; font-size: 1.5rem; font-weight: bold; }
    .inv-income { background: rgba(255,255,255,0.2); border-radius: .75rem; padding: .6rem .8rem; display: flex; align-items: center; justify-content: space-between; }
    .inv-income .left { display:flex; align-items:center; }
    .inv-income .left .icon { width:2rem; height:2rem; background:#f97316; border-radius:.5rem; display:flex; align-items:center; justify-content:center; margin-right:.5rem; color:white; }
    .inv-income span { font-weight:bold; color:#fb923c; }

    /* PRODUCTS container kept */
    .products { margin: 0 1rem 1.5rem; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1rem; }

    /* INTEL CARD base design preserved */
    .intel-card { margin: 0 1rem; background: transparent; border-radius: 1rem; color:#0b1220; width: 100%}
    .intel-card .header { display:flex; align-items:center; margin-bottom:1rem; }
    .intel-card .header .text { font-size: 15px; }
    .intel-card .header .icon { width:2rem; height:2rem; background:#004a11ff; border-radius:.5rem; display:flex; align-items:center; justify-content:center; margin-right:.75rem; color:white; }
    .intel-card .content { background: linear-gradient(90deg, #1e3a8a, #1e40af); border-radius:.75rem; padding:1.5rem; text-align:center; color:white; }
    .intel-card .sub { color:#93c5fd; font-size:1.1rem; }

    /* CHAT FLOAT */
    .chat { position: fixed; bottom: 120px; left: 1rem; z-index: 100; }
    .chat .main { width:3rem; height:3rem; background:#f97316; border-radius:50%; display:flex; align-items:center; justify-content:center; position:relative; box-shadow:0 4px 10px rgba(0,0,0,0.3); }
    .chat .badge { position:absolute; top:-5px; right:-5px; width:1.3rem; height:1.3rem; background:#ef4444; border-radius:50%; font-size:.7rem; font-weight:bold; display:flex; align-items:center; justify-content:center; }
    .chat .label { position:absolute; bottom:-20px; left:50%; transform:translateX(-50%); background:#f97316; padding:.2rem .5rem; border-radius:1rem; font-size:.7rem; }

    @media (max-width:480px) {
      .intel-card img { height:6rem; }
    }

    /* ---------- Minimal appended CSS for full-image slider, indicators, swipe, plans, modal ---------- */

    /* Make slide wrapper visually neutral so images occupy the whole slide area */
    .slide { padding: 0; border-radius: 1rem; background: transparent; }

    /* Carousel area: full image slides */
    .carousel { width:100%; height: 8rem; /* matches original approx height (8rem) */ position: relative; overflow: hidden; border-radius: .5rem; }
    .carousel-track { display:flex; height:100%; transition: transform 500ms ease; will-change: transform; }
    .carousel-slide { min-width:100%; height:100%; flex-shrink:0; user-select:none; -webkit-user-drag:none; position:relative; }
    .carousel-slide img { width:100%; height:100%; object-fit:cover; display:block; border-radius:.5rem; }

    /* centered indicators */
    .carousel-indicators { position:absolute; bottom:8px; left:50%; transform:translateX(-50%); display:flex; gap:8px; z-index:10; }
    .carousel-indicators button { width:8px; height:8px; border-radius:50%; background: rgba(255,255,255,0.45); border:0; cursor:pointer; }
    .carousel-indicators button.active { background:#004a11ff; }

    /* pointer grabbing */
    .carousel-track.grabbing { cursor: grabbing; cursor: -webkit-grabbing; }

    /* plans inside intel-card */
    .plan-list { display:flex; gap:.6rem; flex-wrap:wrap; justify-content:center; margin-top:10px; }
    .plan-item { width: calc(50% - .6rem); background: rgba(255,255,255,0.06); padding:.6rem; border-radius:.6rem; color:#fff; text-align:left; box-sizing:border-box; }
    .plan-item h4 { margin-bottom:.25rem; font-size:.95rem; }
    .plan-row { display:flex; justify-content:space-between; font-size:.85rem; color:#cbd5e1; margin-bottom:.25rem; }
    @media (max-width:480px) { .plan-item { width:100%; } }

    /* modal overlay */
    .overlay { position: fixed; inset: 0; background: #fff; display: none; align-items: flex-start; justify-content: center; z-index: 9999999; padding:1rem; }
    .modal { background: white; color:#0b1220; border-radius:.6rem; max-width:420px; width:100%; overflow:hidden; }
    .modal .modal-img { width:100%; height:180px; object-fit:cover; display:block; margin-top: 80px; border-radius: 15px;}
    .modal .modal-body { padding:.9rem; }
    .modal .modal-actions { display:flex; gap:.6rem; padding:.9rem; }
    .btn-close { position: absolute; right: 10px; top: 10px; text-align: right; font-size: 20px; font-weight: 800; margin: 20px; border:none; padding:.6rem; border-radius:.4rem; cursor:pointer; }
    .btn-purchase { flex:1; background:#10b981; color:white; border:none; padding:.6rem; border-radius:.4rem; cursor:pointer; }

    /* banner marquee */
    .marquee-wrap {
      display:flex;
      gap:0;
      align-items:center;
      width:100%;
      overflow:hidden;
      /* keep children in a single row */
    }
    .marquee-item {
      white-space:nowrap;
      display:inline-block;
      padding-right:1rem; /* visual gap between repeats, optional */
      will-change: transform;
    }
    .marquee-animate {
      animation-timing-function: linear;
      animation-iteration-count: infinite;
    }

    @keyframes bannerScroll { 0% { transform: translateX(100%);} 100% { transform: translateX(-100%);} }

    /* masked numbers */
    .masked-dots { letter-spacing:4px; }

    .plan-card {
      background: #ffffffff;
      color: #0b1220;
      border-radius: .5rem;
      overflow: hidden;
      box-shadow: 0 6px 18px rgba(2,6,23,0.35);
      display: flex;
      flex-direction: column;
    }

    .plan-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: .2rem;
      background: transparent;
    }
    .plan-name {
      font-weight: 700;
      font-size: 1rem;
      color: #000;
      display: flex;
      margin-top: 10px;
    }
    .plan-badge {
      width: 15px;
      height: 15px;
      background: #004a11ff;
      border-radius: 50px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
    }

    .plan-image {
      width: 95%;
      height: 10rem;
      overflow: hidden;
      background: #0b1220;
      margin: 0 auto;
      border-radius: .5rem;
    }
    .plan-image img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    /* body: details and buy button */
    .plan-body {
      padding: .85rem 1rem 1rem;
      display: flex;
      flex-direction: column;
      gap: .5rem;
    }
    .plan-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: .9rem;
    }
    .plan-row .label {
      color: #000000ff;
      font-size: .85rem;
      font-weight: 200;
    }
    .plan-row .value {
      color: #0b1220;
      font-weight: 700;
    }
    .plan-row .value.daily {
      color: #007319ff;
    }

    /* actions */
    .plan-actions {
      margin-top: .6rem;
      display: flex;
      justify-content: flex-end;
    }
    .btn-buy {
      background: #004a11ff;
      color: #fff;
      border: none;
      padding: .5rem .75rem;
      border-radius: .5rem;
      cursor: pointer;
      font-weight: 700;
      font-size: .9rem;
    }
    .btn-buy:active { transform: translateY(1px); }

    @media (max-width:480px) {
      .plan-row { font-size: .85rem; }
    }

    /* Overlay */
    #apdPopupOverlay {
      position: fixed;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      background: rgba(2,6,23,0.6);
      z-index: 9999;
      padding: 1rem;
      -webkit-font-smoothing:antialiased;
      -moz-osx-font-smoothing:grayscale;
    }

    /* Panel */
    #apdPopup {
      width: 100%;
      max-width: 420px;
      border-radius: 12px;
      overflow: hidden;
      background: url('/assets/images/bgg.png?v') no-repeat center center;
      background-size: 110% 110%;
      /* background-position: center; */
      box-shadow: 0 18px 50px rgba(2,6,23,0.55);
      color: #fff;
      position: relative;
      display: flex;
      height: 300px;
      flex-direction: row;
      gap: 0;
    }

    /* Close X */
    #apdPopupClose {
      margin-top: 10px;
      width: 38px;
      height: 38px;
      cursor: pointer;
    }

    /* Media (image background) */
    #apdPopupMedia {
      flex: 0 0 42%;
      background-position: center;
      background-size: cover;
      background-repeat: no-repeat;
    }

    /* Body */
    #apdPopupBody {
      position: absolute;
      padding: 22px;
      flex: 1 1 auto;
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 12px;
    }
    #apdPopupBody h2 {
      margin: 0;
      font-size: 1.25rem;
      font-weight: 700;
      color: #0b1220;
    }
    #apdPopupBody p {
      margin: 0;
      color: #334155;
      line-height: 1.45;
      font-size: 0.95rem;
    }

    /* Actions */
    #apdPopupActions { display:flex; gap:10px; margin-top:6px; }
    #apdPopupPrimary {
      background: #004a11ff;
      color: white;
      border: 0;
      padding: 10px 14px;
      border-radius: 8px;
      cursor: pointer;
      font-weight: 700;
    }
    #apdPopupSecondary {
      background: transparent;
      color: #475569;
      border: 1px solid rgba(71,85,105,0.08);
      padding: 9px 12px;
      border-radius: 8px;
      cursor: pointer;
    }


    #apdPopup { flex-direction: column; max-width: 92%; }
    #apdPopupMedia { width: 100%; height: 300px; min-width: 0; flex-basis: auto; }
    #apdPopupBody { padding: 16px; }

    .nw-products {
      margin: 0 1rem 1.5rem;
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 1rem;
    }
    .nw-products h3 {
      font-size: .9rem;
      margin-bottom: .4rem;
    }
    .nw-products .nw-active .nw-line {
      background: #00ff3cff;
    }
    .nw-line {
      height: 4px;
      background: rgba(255,255,255,0.2);
      border-radius: 1rem;
    }

    .ne-product { margin:0 1rem 1.5rem; display:grid; grid-template-columns:repeat(2,1fr); gap:1rem; }
    .ne-product { background: rgba(255,255,255,0.04); border-radius:.75rem; padding:.8rem; display:flex; gap:.6rem; align-items:center; }
    .ne-product img { width:4.2rem; height:4.2rem; object-fit:cover; border-radius:.5rem; flex-shrink:0; }
    .ne-product .ne-meta { flex:1; min-width:0;}
    .ne-product h3 { font-size:.75rem; color:#e6edf3; margin-bottom:.2rem; }
    .ne-product .ne-row { display:flex; gap:.5rem; font-size:.82rem; color:#cbd5e1; margin-bottom:.25rem; flex-wrap:wrap; }
    .ne-product .ne-price { color:#facc15; font-weight:700; }

    
    /* Buy button */
    .btn-buy[aria-disabled="true"] { opacity:0.85; cursor:default; }

    /* Grayscale states */
    .intel-card.plan-card.grayscale,
    .ne-product.grayscale {
      filter: grayscale(1) contrast(0.95);
    }

    .intel-card.plan-card.grayscale .plan-actions .btn-buy,
    .ne-product.grayscale .btn-buy {
      pointer-events: none;
      opacity: 0.9;
      cursor: default;
    }
  </style> 
  <style id="marquee-dyn-style">
          @keyframes marqueeFromRight {
            0% { transform: translateX(264px); }
            100% { transform: translateX(-889px); }
          }
          .marquee-animate {
            animation-name: marqueeFromRight;
            animation-duration: 19.216666666666665s;
            animation-timing-function: linear;
            animation-iteration-count: infinite;
            will-change: transform;
          }
        </style>
 </head> 
 <body style=""> 
  <div class="app" role="main" aria-label="app content"> 
   <div id="apdMessageOverlay" style="display:none;" role="alert" aria-live="assertive"> 
    <div class="apd-message-box" id="apdMessageBox"></div> 
   </div> 
   <style>
  #apdMessageOverlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1250;
    pointer-events: none;
  }
  .apd-message-box {
    pointer-events: auto;
    max-width: 320px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.04);
    color: #fff;
  }
  .apd-message-box.error {
    background: linear-gradient(180deg, rgba(194, 33, 33, 0.98), rgba(35,6,6,0.96));
  }
  .apd-message-box.success {
    background: linear-gradient(180deg, rgba(28, 188, 60, 0.95), rgba(6,35,10,0.96));
  }
</style> 
   <script>
(function () {
  const overlay = document.getElementById('apdMessageOverlay');
  const box = document.getElementById('apdMessageBox');
  let timeoutId = null;

  function hideNow() {
    overlay.style.display = 'none';
    box.textContent = '';
    box.classList.remove('error', 'success');
    if (timeoutId) { clearTimeout(timeoutId); timeoutId = null; }
  }

  function showMessage(message, duration = 3000, type = 'error') {
    if (!message) return;
    box.textContent = message;
    box.classList.remove('error','success');
    box.classList.add(type);
    overlay.style.display = 'flex';
    if (timeoutId) clearTimeout(timeoutId);
    timeoutId = setTimeout(hideNow, duration);
  }

  // Expose globally
  if (!window.apdError) {
    window.apdError = {
      show: showMessage,
      hide: hideNow
    };
  }

  // Auto-show messages from Blade session/errors
  document.addEventListener('DOMContentLoaded', function() {
    let msg = null;
    let type = 'error';

    
    if (msg && window.apdError && typeof window.apdError.show === 'function') {
        window.apdError.show(msg, 3000, type);
    }
  });
})();
</script> 
   <div id="apdLoadingOverlay" aria-hidden="true" role="status" style="display:none;"> 
    <div class="apd-loading-wrap" id="apdLoadingBox" aria-hidden="true"> 
     <div class="apd-spinner" aria-hidden="true"></div> 
    </div> 
   </div> 
   <style>
  /* Inline styles specific to loader partial */
  #apdLoadingOverlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999999;
    background: rgba(0,0,0,0.45);
  }
  .apd-loading-wrap {
    width: 100px;
    height: 100px;
    min-width: 100px;
    min-height: 100px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.02);
    backdrop-filter: blur(6px);
  }
  .apd-spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.14);
    border-top-color: #ffffff;
    animation: apd-spin 900ms linear infinite;
    box-sizing: border-box;
  }
  @keyframes apd-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
</style> 
   <script>
  // Expose loader control functions to global scope
  (function () {
    const overlay = document.getElementById('apdLoadingOverlay');
    const box = document.getElementById('apdLoadingBox');

    if (!window.apdLoader) {
      window.apdLoader = {
        show: function () {
          overlay.style.display = 'flex';
          overlay.setAttribute('aria-hidden', 'false');
          // automatically hide after 3 seconds
          setTimeout(function() {
            overlay.style.display = 'none';
            overlay.setAttribute('aria-hidden', 'true');
          }, 500);
        },
        hide: function () {
          overlay.style.display = 'none';
          overlay.setAttribute('aria-hidden', 'true');
        },
        // toggle convenience
        toggle: function (force) {
          if (typeof force === 'boolean') {
            return force ? this.show() : this.hide();
          }
          overlay.style.display = overlay.style.display === 'none' ? 'flex' : 'none';
        }
      };
    }
  })();
</script> 
   <main id="app-main"> 
    <div class="container"> 
     <div class="header"> 
      <h1>Home</h1> 
      <div class="notif" title="Notifications" onclick="showPopup();">
       <i class="ri-notification-3-line"></i>
      </div> 
     </div> 
     <meta name="csrf-token" content="1XDM2CB82wYeTsddwpLYwDFoMgDnunAQAj638FDG"> 
     <div id="apdSuccessOverlay" style=" display:none; position:fixed; inset:0; background: #00000066; z-index:9999; align-items:center; justify-content:center;"> 
      <div id="apdSuccessBox" style=" max-width:420px; width:100%; border-radius:14px; padding:1px; text-align:center; position:relative;"> 
       <div style="padding:2px 0;"> 
        <img id="apdSuccessImage" src="/assets/images/checkin.png?v2" alt="Success" style="width:100%;height:auto;cursor:pointer;border-radius:8px;display:block;margin:0 auto;"> 
       </div> 
       <img src="/assets/images/close.png" onclick="document.getElementById('apdSuccessOverlay').style.display = 'none'" style="margin-top: 10px; width: 38px; height: 38px; cursor: pointer;" alt="Close"> 
      </div> 
     </div> 
     <div class="slide" id="slideRoot" aria-roledescription="carousel"> 
      <div class="carousel" id="carousel"> 
       <div class="carousel-track" id="carouselTrack" tabindex="0" aria-live="polite" style="transform: translateX(0px);"> 
        <div class="carousel-slide" style="min-width: 328px;">
         <img src="/assets/images/1.jpg" alt="slide 1">
        </div> 
        <div class="carousel-slide" style="min-width: 328px;">
         <img src="/assets/images/2.jpg" alt="slide 2">
        </div> 
        <div class="carousel-slide" style="min-width: 328px;">
         <img src="/assets/images/3.jpg" alt="slide 3">
        </div> 
        <div class="carousel-slide" style="min-width: 328px;">
         <img src="/assets/images/4.jpg" alt="slide 4">
        </div> 
        <div class="carousel-slide" style="min-width: 328px;">
         <img src="/assets/images/5.jpg" alt="slide 5">
        </div> 
       </div> 
       <div class="carousel-indicators" id="carouselIndicators" aria-hidden="false">
        <button class="active"></button>
        <button class=""></button>
        <button class=""></button>
        <button class=""></button>
        <button class=""></button>
       </div> 
      </div> 
     </div> 
     <div class="banner"> 
      <div class="icon">
       <i class="ri-notification-3-line text-black-800" style="color: #000"></i>
      </div> 
      <div style="overflow:hidden; width:100%;"> 
       <div class="marquee-wrap" id="marqueeWrap"> 
        <div class="marquee-item marquee-animate" id="marquee1">
         Welcome to NVIDIA — delivering cutting-edge GPUs and advanced accelerated computing solutions for researchers, gamers, creators, and technology innovators worldwide. Experience powerful performance, intelligent AI technology, and breakthrough innovation shaping the future of digital transformation.
        </div> 
        <div class="marquee-item marquee-animate" id="marquee2">
         Welcome to NVIDIA — delivering cutting-edge GPUs and advanced accelerated computing solutions for researchers, gamers, creators, and technology innovators worldwide. Experience powerful performance, intelligent AI technology, and breakthrough innovation shaping the future of digital transformation.
        </div> 
       </div> 
      </div> 
     </div> 
     <div class="timer"> 
      <div class="time-boxes"> 
       <div class="time-box">
        <span id="days">0016</span>
       </div> 
       <div class="time-box">
        <span id="hours">14</span> 
       </div> 
       <div class="time-box">
        <span id="minutes">57</span>
       </div> 
       <div class="time-box">
        <span id="seconds">39</span>
       </div> 
      </div> 
      <p>Platform Up-Time</p> 
     </div> 
     <div class="actions" role="navigation" aria-label="quick actions"> 
      <div class="action" onclick="window.apdLoader.show(); window.location.href='user/recharge'">
       <img src="/assets/images/wallet.png" style="width: 40px; margin-bottom: 5px" class="green-filter">
       <span>Recharge</span>
      </div> 
      <div class="action" onclick="window.apdLoader.show(); window.location.href='withdraw'"> 
   <img src="https://cdn-icons-png.flaticon.com/512/10149/10149458.png" 
        style="width: 40px; margin-bottom: 5px; filter: invert(48%) sepia(79%) saturate(2476%) hue-rotate(86deg) brightness(118%) contrast(119%);"> 
   <div>Withdrawal</div> 
</div>

      <div class="action" onclick="window.apdLoader.show(); window.location.href='my-team'">
       <img src="/assets/images/tmn.png" style="width: 40px; margin-bottom: 5px" class="green-filter">
       <span>My Team</span>
      </div> 
      <!--<div class="action" id="apdCheckinBtn">-->
      <div class="action" onclick="checkin()">
       <img src="/assets/images/cki.png" style="width: 40px; margin-bottom: 5px" class="green-filter">
       <span>Check-in</span>
      </div> 
      <div class="action" onclick="window.apdLoader.show(); window.location.href='{{route('service')}}'">
       <img src="/assets/images/support.png" style="width: 40px; margin-bottom: 5px" class="green-filter">
       <span>Help</span>
      </div> 
     </div>
     @php
    use App\Models\Package;
    // Fetch all packages ordered by category or ID
    $packages = Package::orderBy('id', 'asc')->get();
@endphp
     <div class="investment"> 
      <div class="inv-header"> 
       <div class="title">
        <i class="ri-gift-line"></i>
        <span>My device investments</span>
       </div> 
       <i id="eyeToggle" class="ri-eye-line" title="Toggle visibility"></i> 
      </div> 
      <div class="inv-stats"> 
       <div>
        <p>Balance</p>
        <div class="value" id="balanceText">
         {{price(auth()->user()->balance)}}
        </div>
       </div> 
       <div style="text-align: right">
        <p>My Products</p>
        <div class="value" id="investCount">
         {{ \App\Models\Purchase::where('user_id', auth()->id())->count() }}
        </div>
       </div> 
      </div> 
      <div class="inv-income"> 
       <div class="left">
        <div class="icon">
         <i class="ri-line-chart-line"></i>
        </div>
        <span>Total Income:</span>
       </div> 
       <div id="incomeText" class="value">
        <?php
                                $totalIncome = \App\Models\UserLedger::where('user_id', auth()->id())->where('reason', 'my_commission')->sum('amount');
                                ?>
                                {{price($totalIncome)}}
       </div> 
      </div> 
     </div>
     <div class="nw-products" style="display: block; text-align: center;">
    <div id="pl1" class="nw-active">
        <h3 style="color: #facc15;">NVIDIA PowerMax Series</h3>
        <div class="nw-line" style="width: 50%; margin: 0 auto;"></div>
    </div>
</div>
     <div class="products" id="productsContainer">
    @foreach ($packages->where('category', 'P Series') as $package)
    @if ($package->status == 'active')
      {{-- ✅ Active Product --}}
      <div class="intel-card plan-card" data-status="1" data-available-ms=""> 
       <div class="plan-head"> 
        <div class="plan-name"> 
         <img src="/assets/images/pln.png" style="width: 18px; height: 18px; margin: 5px" class="green-filter"> 
         <span style="margin-top: 3px; margin-left: 5px">{{ $package->name }}</span> 
        </div> 
       </div> 
       <div class="plan-image"> 
        <img src="{{ asset($package->photo) }}" alt="NVIDIA GeForce GTX 1660 Super image" loading="lazy" style="max-width:100%;display:block;margin:0 auto;"> 
       </div> 
       <div class="plan-body"> 
        <div class="plan-row"> 
         <div class="label">
          Price
         </div> 
         <div class="value">
          {{ price($package->price) }}
         </div> 
        </div> 
        <div class="plan-row"> 
         <div class="label">
          Daily income
         </div> 
         <div class="value daily">
          {{ price($package->commission_with_avg_amount / $package->validity) }}
         </div> 
        </div> 
        <div class="plan-row"> 
         <div class="label">
          Duration
         </div> 
         <div class="value">
          {{ $package->validity }} Days
         </div> 
        </div> 
        <div class="plan-row"> 
         <div class="label">
          Total Income
         </div> 
         <div class="value">
          {{ price($package->commission_with_avg_amount) }}
         </div>
        </div>
        <div class="plan-actions"> 
         <button class="btn-buy" data-name="{{ $package->name }}" data-img="{{ asset($package->photo) }}" data-price="{{ price($package->price) }}" data-daily="{{ price($package->commission_with_avg_amount / $package->validity) }}" data-duration="{{ $package->validity }} Days" data-description="The GeForce GTX 1660 Super is a budget gaming GPU built on NVIDIA’s Turing architecture. It doesn’t include ray tracing cores but delivers excellent 1080p gaming performance for its price. With 6GB of GDDR6 memory and good power efficiency, it handles modern games smoothly and is a popular choice for entry-level gaming PCs. It’s also well-suited for light content creation and streaming, offering strong value for gamers who want solid performance without paying premium prices." data-id="1"> Buy Now </button> 
        </div>
        </div>
      </div>
      @else
      <div class="intel-card plan-card grayscale" data-status="0" data-available-ms="1766358000000"> 
       <div class="plan-head"> 
        <div class="plan-name"> 
         <img src="/assets/images/pln.png" style="width: 18px; height: 18px; margin: 5px" class="green-filter"> 
         <span style="margin-top: 3px; margin-left: 5px">{{ $package->name }}</span> 
        </div> 
       </div> 
       <div class="plan-image"> 
        <img src="{{ asset($package->photo) }}" alt="NVIDIA GeForce RTX 4090 image" loading="lazy" style="max-width:100%;display:block;margin:0 auto;"> 
       </div> 
       <div class="plan-body"> 
        <div class="plan-row"> 
         <div class="label">
          Price
         </div> 
         <div class="value">
          {{ price($package->price) }}
         </div> 
        </div> 
        <div class="plan-row"> 
         <div class="label">
          Daily income
         </div> 
         <div class="value daily">
          {{ price($package->commission_with_avg_amount / $package->validity) }}
         </div> 
        </div> 
        <div class="plan-row"> 
         <div class="label">
          Duration
         </div> 
         <div class="value">
          {{ $package->validity }} Days
         </div> 
        </div> 
        <div class="plan-row"> 
         <div class="label">
          Total Income
         </div> 
         <div class="value">
          {{ price($package->commission_with_avg_amount ) }}
         </div> 
        </div> 
        <div class="plan-actions"> 
         <button class="btn-buy" data-name="{{ $package->name }}" data-img="{{ asset($package->photo) }}" data-price="{{ price($package->price) }}" data-daily="{{ price($package->commission_with_avg_amount / $package->validity) }}" data-duration="{{ $package->validity }} Days" data-description="NVIDIA’s current flagship gaming GPU. It’s built for 4K and 8K gaming, high-end VR, and professional creative workloads. With over 16,000 CUDA cores and large VRAM, it handles ray tracing and AI graphics seamlessly. It’s the most powerful consumer graphics card available, aimed at enthusiasts and professionals." data-id="7" aria-disabled="true" style="pointer-events: none; opacity: 0.9;">Un-available</button> 
        </div> 
       </div> 
       <!-- overlay timer --> 
       <div class="overlay-timer" aria-hidden="true" style="display:none;">
          <div class="overlay-inner">
            <div class="countdown">
              <div class="countdown-label">Available in</div>
              <div class="countdown-time">40:00:00</div>
            </div>
          </div>
        </div>
      </div>@endif
  @endforeach
     </div>
     <div id="productsList" style="display: none; flex-direction: column">
    @foreach ($packages->where('category', 'B Series') as $package)
    @if ($package->status == 'active')
      {{-- ✅ Active Product --}}
      <div class="ne-product" data-status="1" data-available-ms=""> 
       <img src="{{ asset($package->photo) }}" alt="NVIDIA Jetson Nano image"> 
       <div class="ne-meta"> 
        <h3>{{ $package->name }}</h3> 
        <div class="ne-row">
         <div class="ne-price">
          Price: 
          <strong>{{ price($package->price) }}</strong>
         </div>
         <div>
          Daily: 
          <strong>{{ price($package->commission_with_avg_amount / $package->validity) }}</strong>
         </div>
        </div> 
        <div class="ne-row">
         <div>
          Total income: 
          <strong>{{ price($package->commission_with_avg_amount ) }}</strong>
         </div>
         <div>
          Duration: 
          <strong>{{ $package->validity }} Days</strong>
         </div>
        </div> 
       </div> 
       <div style="display:flex;flex-direction:column;gap:.4rem;align-items:flex-end;"> 
        <button class="btn-buy" style="position: absolute; " data-name="{{ $package->name }}" data-img="{{ asset($package->photo) }}" data-price="{{ price($package->price) }}" data-daily="{{ price($package->commission_with_avg_amount / $package->validity) }}" data-duration="{{ $package->validity }} Days" data-description="The Jetson Nano is a compact AI development board used in robotics, smart devices, and edge computing. It combines a quad-core ARM CPU with a 128-core Maxwell GPU, making it capable of running neural networks, computer vision, and machine learning tasks locally. It’s often used by developers and researchers for experimenting with AI at the edge, such as in drones, smart cameras, and autonomous robots. Its low cost and low power usage make it one of NVIDIA’s most accessible AI computing products." data-id="2"> Buy Now </button> 
       </div> 
      </div>
      @else
      <div class="ne-product grayscale" data-status="0" data-available-ms="1763766000000"> 
       <img src="{{ asset($package->photo) }}" alt="NVIDIA Tesla T4 image"> 
       <div class="ne-meta"> 
        <h3>{{ $package->name }}</h3> 
        <div class="ne-row">
         <div class="ne-price">
          Price: 
          <strong>{{ price($package->price) }}</strong>
         </div>
         <div>
          Daily: 
          <strong>{{ price($package->commission_with_avg_amount / $package->validity) }}</strong>
         </div>
        </div> 
        <div class="ne-row">
         <div>
          Total income: 
          <strong>{{ price($package->commission_with_avg_amount ) }}</strong>
         </div>
         <div>
          Duration: 
          <strong>{{ $package->validity }} Days</strong>
         </div>
        </div> 
       </div> 
       <div style="display:flex;flex-direction:column;gap:.4rem;align-items:flex-end;"> 
        <button class="btn-buy" style="position: absolute; top: 0.2rem; right: 0.2rem; pointer-events: none; opacity: 0.9;" data-name="{{ $package->name }}" data-img="{{ asset($package->photo) }}" data-price="{{ price($package->price) }}" data-daily="{{ price($package->commission_with_avg_amount / $package->validity) }}" data-duration="{{ $package->validity }} Days" data-description="The Tesla T4 is a data center GPU designed for AI inference, cloud computing, and machine learning. It’s built on the Turing architecture and includes tensor cores that accelerate deep learning tasks. It supports mixed-precision computing and is highly power-efficient, making it suitable for large-scale deployment in data centers. Companies use it for services such as voice recognition, image analysis, and recommendation systems. It’s also used by major cloud platforms like AWS and Google Cloud to deliver AI-powered services efficiently." data-id="4" aria-disabled="true">Un-available</button> 
       </div> 
      </div>     @endif
  @endforeach
     <!--<div class="ne-product grayscale" data-status="0" data-available-ms="1763766000000"> 
       <img src="/assets/images/plan/nvidia5.jpg" alt="NVIDIA RTX A6000 image"> 
       <div class="ne-meta"> 
        <h3>NVIDIA RTX A6000</h3> 
        <div class="ne-row">
         <div class="ne-price">
          Price: 
          <strong>₦360,000.00</strong>
         </div>
         <div>
          Daily: 
          <strong>₦13,320.00</strong>
         </div>
        </div> 
        <div class="ne-row">
         <div>
          Total income: 
          <strong>₦4,861,800.00</strong>
         </div>
         <div>
          Duration: 
          <strong>365 Days</strong>
         </div>
        </div> 
       </div> 
       <div style="display:flex;flex-direction:column;gap:.4rem;align-items:flex-end;"> 
        <button class="btn-buy" style="position: absolute; top: 0.2rem; right: 0.2rem; pointer-events: none; opacity: 0.9;" data-name="NVIDIA RTX A6000" data-img="/assets/images/plan/nvidia5.jpg" data-price="₦360,000.00" data-daily="₦13,320.00" data-duration="365 Days" data-description="The RTX A6000 is a high-end workstation GPU for professionals working in 3D rendering, animation, video production, simulation, and AI development. Built on the Ampere architecture, it features 48GB of GDDR6 memory and advanced ray tracing and tensor cores. This makes it capable of handling very complex visual and computational workloads. It’s widely used in film studios, design firms, and research institutions that require both accuracy and speed in their visual output. It bridges the gap between creative performance and AI computation." data-id="5" aria-disabled="true">Un-available</button> 
       </div> 
      </div> --
      <div class="ne-product grayscale" data-status="0" data-available-ms="1766358000000"> 
       <img src="/assets/images/plan/nvidia7.jpg" alt="NVIDIA GeForce RTX 4090 image"> 
       <div class="ne-meta"> 
        <h3>NVIDIA GeForce RTX 4090</h3> 
        <div class="ne-row">
         <div class="ne-price">
          Price: 
          <strong>₦980,000.00</strong>
         </div>
         <div>
          Daily: 
          <strong>₦38,220.00</strong>
         </div>
        </div> 
        <div class="ne-row">
         <div>
          Total income: 
          <strong>₦13,950,300.00</strong>
         </div>
         <div>
          Duration: 
          <strong>365 Days</strong>
         </div>
        </div> 
       </div> -->
       <div style="display:flex;flex-direction:column;gap:.4rem;align-items:flex-end;"> 
        <button class="btn-buy" style="position: absolute; top: 0.2rem; right: 0.2rem; pointer-events: none; opacity: 0.9;" data-name="NVIDIA GeForce RTX 4090" data-img="/assets/images/plan/nvidia7.jpg" data-price="₦980,000.00" data-daily="₦38,220.00" data-duration="365 Days" data-description="NVIDIA’s current flagship gaming GPU. It’s built for 4K and 8K gaming, high-end VR, and professional creative workloads. With over 16,000 CUDA cores and large VRAM, it handles ray tracing and AI graphics seamlessly. It’s the most powerful consumer graphics card available, aimed at enthusiasts and professionals." data-id="7" aria-disabled="true">Un-available</button> 
       </div> 
      </div> 
     </div> 
     <div class="chat" onclick="window.apdLoader.show(); window.location.href='{{route('service')}}'"> 
      <div class="main">
       <i class="ri-message-3-fill"></i>
       <div class="badge">
        1
       </div>
      </div> 
      <div class="label">
       CHAT
      </div> 
     </div> 
    </div> 
    <div class="overlay" id="productModal" aria-hidden="true"> 
     <div class="modal" role="dialog" aria-modal="true" aria-label="Product"> 
      <div class="btn-close" id="modalClose">
       X
      </div> 
      <img src="" alt="" class="modal-img" id="modalImg"> 
      <div style="font-weight:700; margin-bottom:.3rem; margin-top: 10px" id="modalName">
       Product
      </div> 
      <div id="description" style="color: #000;padding: 10px; font-size: 13px"></div> 
      <div class="modal-body"> 
       <div style="display:flex; justify-content:space-between; color:#374151; margin-bottom:.25rem;"> 
        <div>
         Price:
        </div>
        <div id="modalPrice">
         ₦0
        </div> 
       </div> 
       <div style="display:flex; justify-content:space-between; color:#374151; margin-bottom:.25rem;"> 
        <div>
         Daily income:
        </div>
        <div id="modalDaily">
         ₦0
        </div> 
       </div> 
       <div style="display:flex; justify-content:space-between; color:#374151;"> 
        <div>
         Duration:
        </div>
        <div id="modalDuration">
         0 days
        </div> 
       </div> 
      </div> 
      <div class="modal-actions"> 
       <button class="btn-purchase" id="modalPurchase">Purchase</button> 
      </div> 
     </div> 
    </div> 
    <link rel="stylesheet" href="https://unpkg.com/vant/lib/index.css"> 
    <link rel="stylesheet" href="https://unpkg.com/vant/lib/icon-local.css"> 
    <!-- Popup HTML + inline CSS + JS --> 
    <div id="apdPopupOverlay" aria-hidden="true" style="display: none;"> 
     <div id="apdPopup" role="dialog" aria-modal="true" aria-labelledby="apdPopupTitle" tabindex="-1"> 
      <a href="https://nvidiagtx.com/sub/support" style="position: absolute; right: 10px; top: 10px; font-size: 25px; font-weight: 800; color: #fff"> <i class="van-icon van-icon-phone-o" style="font-size:30px;" aria-hidden="true"></i> Contact Us </a> 
      <p style="padding: 20px; margin-top: 50px">Welcome to NVIDIA, Discover exclusive best-in-class GPUs and accelerated computing solutions.</p> 
      <a href="https://t.me/Nvidia_technologies" style="position: absolute; right: 10px; bottom: 10px; font-size: 25px; font-weight: 800; color: #fff"><img src="/assets/images/logo.jpg" style="height: 30px; width: 30px; margin-right: 10px">Join Channel</a> 
     </div> 
     <img src="/assets/images/close.png" id="apdPopupClose" aria-label="Close popup"> 
    </div> 
   </main> 
   <nav class="apd-bottom-nav" aria-label="bottom navigation"> 
    <div class="apd-nav-inner"> 
     <a class="apd-nav-item  active " href="/dashboard"> 
      <svg viewbox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"> 
       <path d="M3 11.5L12 5l9 6.5"></path> 
       <path d="M5.5 21V12.5h13V21"></path> 
       <path d="M9 21v-6h6v6"></path> 
      </svg> <span>Home</span> </a> 
     <a class="apd-nav-item " href="/vip"> 
      <svg viewbox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"> 
       <rect x="2.5" y="6.5" width="19" height="11" rx="2"></rect> 
       <circle cx="17" cy="11.5" r="1.6"></circle> 
       <path d="M7 11.5h4"></path> 
      </svg> <span>Income</span> </a> 
     <a class="apd-nav-item " href="/salary"> 
      <svg viewbox="0 0 26 26" width="28" height="28" xmlns="http://www.w3.org/2000/svg"> 
       <rect x="5" y="14" width="3.5" height="7" rx="0.6" fill="currentColor" opacity="0.95"></rect> 
       <rect x="11" y="10" width="3.5" height="11" rx="0.6" fill="currentColor" opacity="0.95"></rect> 
       <rect x="17" y="6" width="3.5" height="15" rx="0.6" fill="currentColor" opacity="0.95"></rect> 
       <polyline points="5,16 9,13 13,12 17,8 21,9" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"></polyline> 
       <circle cx="21" cy="9" r="1.2" fill="currentColor"></circle> 
      </svg> <span>Salary</span> </a> 
     <a class="apd-nav-item " href="/my-team"> 
      <svg viewbox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"> 
       <path d="M14 8.5a3 3 0 1 0-6 0"></path> 
       <path d="M3.5 20.5c1.6-3 4.2-4.5 7.5-4.5h1"></path> 
       <path d="M19 9v4M21 11h-4"></path> 
      </svg> <span>Invite</span> </a> 
     <a class="apd-nav-item " href="/my-profile"> 
      <svg viewbox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"> 
       <circle cx="12" cy="8.2" r="3"></circle> 
       <path d="M4.5 20.5c1.8-3.6 5.2-5 7.5-5s5.7 1.4 7.5 5"></path> 
      </svg> <span>Mine</span> </a> 
    </div> 
   </nav>
   @include('alert-message')
   <style>
  .apd-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    padding: 8px 12px;
    max-width: 420px;
    margin: 0 auto;
    background: #004a11ff;
    border-top: 1px solid #30ff52ff;
    backdrop-filter: blur(6px);
  }

  .apd-nav-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: 6px;
    justify-content: space-between;
    align-items: center;
  }

  .apd-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    width: 56px;
    padding: 6px 2px;
    transition: all 0.2s ease;
  }

  .apd-nav-item svg {
    stroke: currentColor;
    transition: all 0.2s ease;
  }

  .apd-nav-item.active {
    color: #30ff6bff; /* main page color */
  }

  .apd-nav-item.active svg {
    stroke: #30ff6bff;
  }

  .apd-nav-item:hover {
    color: #30ff6bff;
  }

  @media (min-width:720px) {
    .apd-nav-inner { justify-content: center; gap: 28px; }
  }
</style> 
  </div> 
  <script>
    window.OneOk = window.OneOk || {};
    window.OneOk.formatNaira = function(n){
      return '₦' + Number(n).toLocaleString('en-US');
    };

    document.querySelectorAll('a').forEach(a => {
      a.addEventListener('click', function (evt) {
        // ignore modified clicks (open in new tab/window)
        if (evt.ctrlKey || evt.metaKey || evt.shiftKey || evt.altKey || evt.button === 1) return;

        // ignore anchors that do nothing or internal fragment links
        const href = (a.getAttribute('href') || '').trim();
        if (!href || href.startsWith('#') || href === 'javascript:void(0)') return;

        if (window.apdLoader && typeof window.apdLoader.show === 'function') {
          window.apdLoader.show();
        }
      });
    });

  </script> 
  <script>

    (function () {
      const overlay = document.getElementById('apdPopupOverlay');
      const panel = document.getElementById('apdPopup');
      const btnClose = document.getElementById('apdPopupClose');

      let autoShown = false;

      // Prevent body scroll while popup is open
      function lockScroll() { document.documentElement.style.overflow = 'hidden'; document.body.style.overflow = 'hidden'; }
      function unlockScroll() { document.documentElement.style.overflow = ''; document.body.style.overflow = ''; }

      // Show popup with options: { title, message, image, primaryText, onPrimary }
      window.showPopup = function (opts = {}) {
        overlay.style.display = 'flex';
        overlay.setAttribute('aria-hidden', 'false');
        lockScroll();
      };

      function closePopup() {
        overlay.style.display = 'none';
        overlay.setAttribute('aria-hidden', 'true');
        unlockScroll();
      }

      // Close actions
      btnClose.addEventListener('click', closePopup);

      // Close when clicking outside the panel
      overlay.addEventListener('click', function (e) {
        if (e.target === overlay) closePopup();
      });

      // Close on Escape
      document.addEventListener('keydown', function (e) {
        if (e.key === 'Escape' && overlay.style.display === 'flex') closePopup();
      });

      // Expose close function if needed
      window.closePopup = closePopup;

            showPopup();
          })();


    document.addEventListener('DOMContentLoaded', function () {
      const pl1 = document.getElementById('pl1');
      const pl2 = document.getElementById('pl2');
      const productsContainer = document.getElementById('productsContainer'); // for VIP Product
      const productsList = document.getElementById('productsList'); // for Activity Equipment

      pl1.addEventListener('click', function () {
        pl1.classList.add('nw-active');
        pl2.classList.remove('nw-active');

        productsContainer.style.display = 'flex';
        productsList.style.display = 'none';
      });

      pl2.addEventListener('click', function () {
        pl2.classList.add('nw-active');
        pl1.classList.remove('nw-active');

        productsList.style.display = 'flex';
        productsContainer.style.display = 'none';
      });
    });

    (function(){
      const track = document.getElementById('carouselTrack');
      const slides = Array.from(track.children);
      const indicatorsWrap = document.getElementById('carouselIndicators');
      const slideCount = slides.length;
      let current = 0;
      let isDragging = false;
      let startX = 0;
      let currentTranslate = 0;
      let prevTranslate = 0;
      const autoplayDelay = 3500;
      let autoplayTimer = null;

      // set each slide width to carousel width on init/resize
      function setSlidesWidth() {
        const carousel = document.getElementById('carousel');
        const width = carousel.clientWidth;
        slides.forEach(slide => slide.style.minWidth = width + 'px');
        // reposition to current
        currentTranslate = -current * width;
        prevTranslate = currentTranslate;
        setTransform();
      }

      function setTransform() {
        track.style.transform = `translateX(${currentTranslate}px)`;
      }

      function buildIndicators() {
        indicatorsWrap.innerHTML = '';
        for (let i = 0; i < slideCount; i++) {
          const btn = document.createElement('button');
          if (i === current) btn.classList.add('active');
          btn.addEventListener('click', () => {
            goTo(i);
            resetAutoplay();
          });
          indicatorsWrap.appendChild(btn);
        }
      }

      function updateIndicators() {
        Array.from(indicatorsWrap.children).forEach((b, idx) => b.classList.toggle('active', idx === current));
      }

      function goTo(index) {
        current = (index + slideCount) % slideCount;
        const width = document.getElementById('carousel').clientWidth;
        currentTranslate = -current * width;
        prevTranslate = currentTranslate;
        setTransform();
        updateIndicators();
      }

      function next() {
        current = (current + 1) % slideCount;
        const width = document.getElementById('carousel').clientWidth;
        currentTranslate = -current * width;
        prevTranslate = currentTranslate;
        setTransform();
        updateIndicators();
      }

      function prev() {
        current = (current - 1 + slideCount) % slideCount;
        const width = document.getElementById('carousel').clientWidth;
        currentTranslate = -current * width;
        prevTranslate = currentTranslate;
        setTransform();
        updateIndicators();
      }

      function pointerDown(e) {
        isDragging = true;
        startX = (e.type.includes('mouse') || e.pointerType === 'mouse') ? e.clientX : (e.touches ? e.touches[0].clientX : e.clientX);
        track.classList.add('grabbing');
      }

      function pointerMove(e) {
        if (!isDragging) return;
        const currentX = (e.type.includes('mouse') || e.pointerType === 'mouse') ? e.clientX : (e.touches ? e.touches[0].clientX : e.clientX);
        const diff = currentX - startX;
        const width = document.getElementById('carousel').clientWidth;
        currentTranslate = prevTranslate + diff;
        setTransform();
      }

      function pointerUp() {
        if (!isDragging) return;
        isDragging = false;
        track.classList.remove('grabbing');
        const width = document.getElementById('carousel').clientWidth;
        const movedBy = currentTranslate - prevTranslate;

        const threshold = width * 0.2;
        if (movedBy < -threshold) {
          next();
        } else if (movedBy > threshold) {
          prev();
        } else {
          // snap back
          currentTranslate = prevTranslate;
          setTransform();
        }
        prevTranslate = currentTranslate;
        resetAutoplay();
      }

      function resetAutoplay() {
        if (autoplayTimer) clearInterval(autoplayTimer);
        autoplayTimer = setInterval(() => { next(); }, autoplayDelay);
      }

      // attach pointer events
      // Use pointer events where available
      track.addEventListener('pointerdown', pointerDown, { passive: true });
      window.addEventListener('pointermove', pointerMove, { passive: true });
      window.addEventListener('pointerup', pointerUp);
      window.addEventListener('pointercancel', pointerUp);

      // keyboard navigation
      track.addEventListener('keydown', (e) => {
        if (e.key === 'ArrowLeft') { prev(); resetAutoplay(); }
        if (e.key === 'ArrowRight') { next(); resetAutoplay(); }
      });

      // responsive sizing
      window.addEventListener('resize', setSlidesWidth);
      window.addEventListener('orientationchange', setSlidesWidth);

      // initialize
      setSlidesWidth();
      buildIndicators();
      updateIndicators();
      resetAutoplay();
    })();

    /* =========================
       Banner marquee pause on hover
       ========================= */
    (function() {
      const m = document.getElementById('bannerMarquee');
      if (!m) return;
      m.addEventListener('mouseenter', () => m.style.animationPlayState = 'paused');
      m.addEventListener('mouseleave', () => m.style.animationPlayState = 'running');
    })();

    (function(){
      const wrap = document.getElementById('marqueeWrap');
      const m1 = document.getElementById('marquee1');
      const m2 = document.getElementById('marquee2');

      // Trim and sync texts
      m1.textContent = m1.textContent.trim();
      m2.textContent = m1.textContent;

      let styleEl = null;
      const speed = 60; // pixels per second (increase -> faster)

      function setup() {
        if (!wrap || !m1 || !m2) return;

        // remove previous dynamic style if exists
        if (styleEl) styleEl.remove();

        // measure sizes
        const wrapWidth = wrap.clientWidth;
        const textWidth = m1.scrollWidth;

        // distance we want to travel = wrapWidth + textWidth
        // start position: +wrapWidth (text entirely off right)
        // end position: -textWidth (text entirely off left)
        const distance = wrapWidth + textWidth;

        // compute duration so speed is consistent
        const duration = Math.max(4, distance / speed); // at least 4s to avoid too-fast tiny loops

        // create keyframes: from translateX(wrapWidth px) to translateX(-textWidth px)
        const animName = 'marqueeFromRight';
        styleEl = document.createElement('style');
        styleEl.id = 'marquee-dyn-style';
        styleEl.innerHTML = `
          @keyframes ${animName} {
            0% { transform: translateX(${wrapWidth}px); }
            100% { transform: translateX(-${textWidth}px); }
          }
          .marquee-animate {
            animation-name: ${animName};
            animation-duration: ${duration}s;
            animation-timing-function: linear;
            animation-iteration-count: infinite;
            will-change: transform;
          }
        `;
        document.head.appendChild(styleEl);

        // ensure both items are inline and appended back-to-back, then apply animation
        m1.classList.remove('marquee-animate');
        m2.classList.remove('marquee-animate');

        // position items inline naturally by container's flex/inline behavior
        // apply animation class after a reflow to avoid jump
        void m1.offsetWidth;
        m1.classList.add('marquee-animate');
        m2.classList.add('marquee-animate');
      }

      // run after load (fonts/images loaded)
      window.addEventListener('load', setup);
      // recompute on resize/orientation change
      let resizeTimer = null;
      window.addEventListener('resize', function(){
        if (resizeTimer) clearTimeout(resizeTimer);
        // remove animation classes briefly to avoid visible jump while recalculating
        if (m1) m1.classList.remove('marquee-animate');
        if (m2) m2.classList.remove('marquee-animate');
        resizeTimer = setTimeout(setup, 100);
      });
    })();



    /* =========================
       Count-up since 2025-10-22 00:00 Europe/Warsaw
       ========================= */
    (function() {
      // Replace with your start date (ISO format). Keep timezone offset if needed.
      const startDate = new Date('2025-10-22T00:00:00+01:00').getTime();

      // Elements for days/hours/minutes/seconds (must exist on page)
      const daysEl = document.getElementById('days');
      const hoursEl = document.getElementById('hours');
      const minutesEl = document.getElementById('minutes');
      const secondsEl = document.getElementById('seconds');

      // Optional label element to show phase text ("Starts in" | "Time since start")
      const phaseEl = document.getElementById('phase'); // may be null

      // Helper: convert total seconds to d/h/m/s components
      function secondsToDhms(totalSeconds) {
        // all arithmetic done step-by-step to avoid mistakes
        const days = Math.floor(totalSeconds / 86400); // 86400 = 24*3600
        let rem = totalSeconds - (days * 86400);

        const hours = Math.floor(rem / 3600); // 3600 = 60*60
        rem = rem - (hours * 3600);

        const minutes = Math.floor(rem / 60);
        const seconds = rem - (minutes * 60);

        return { days, hours, minutes, seconds };
      }

      // Update display function
      function update() {
        const now = Date.now();

        if (now < startDate) {
          // Start date is in the future -> show countdown to start
          const remainingSeconds = Math.floor((startDate - now) / 1000);
          const { days, hours, minutes, seconds } = secondsToDhms(remainingSeconds);

          if (phaseEl) phaseEl.textContent = 'Starts in';
          // pad days to 4 digits, others to 2
          daysEl.textContent = String(days).padStart(4, '0');
          hoursEl.textContent = String(hours).padStart(2, '0');
          minutesEl.textContent = String(minutes).padStart(2, '0');
          secondsEl.textContent = String(seconds).padStart(2, '0');
        } else {
          // Start date reached or passed -> show count up (time since start)
          const elapsedSeconds = Math.floor((now - startDate) / 1000);
          const { days, hours, minutes, seconds } = secondsToDhms(elapsedSeconds);

          if (phaseEl) phaseEl.textContent = 'Time since start';
          daysEl.textContent = String(days).padStart(4, '0');
          hoursEl.textContent = String(hours).padStart(2, '0');
          minutesEl.textContent = String(minutes).padStart(2, '0');
          secondsEl.textContent = String(seconds).padStart(2, '0');
        }
      }

      // Run immediately then every second
      update();
      setInterval(update, 1000);
    })();

    /* =========================
       Eye toggle for investment numbers
       ========================= */
    (function() {
      const eye = document.getElementById('eyeToggle');
      const balance = document.getElementById('balanceText');
      const count = document.getElementById('investCount');
      const income = document.getElementById('incomeText');

      const originals = { balance: balance.textContent, count: count.textContent, income: income.textContent };
      let visible = true;

      function dots(text) {
        const m = text.match(/^(\D+)/);
        const prefix = m ? m[1] : '';
        const body = text.slice(prefix.length);
        const len = Math.max(4, body.replace(/\s|,/g, '').length);
        return prefix + '•'.repeat(len);
      }

      eye.addEventListener('click', function() {
        visible = !visible;
        if (!visible) {
          balance.textContent = dots(originals.balance);
          count.textContent = dots(originals.count);
          income.textContent = dots(originals.income);
          balance.classList.add('masked-dots'); count.classList.add('masked-dots'); income.classList.add('masked-dots');
          eye.classList.remove('ri-eye-line'); eye.classList.add('ri-eye-off-line');
        } else {
          balance.textContent = originals.balance;
          count.textContent = originals.count;
          income.textContent = originals.income;
          balance.classList.remove('masked-dots'); count.classList.remove('masked-dots'); income.classList.remove('masked-dots');
          eye.classList.remove('ri-eye-off-line'); eye.classList.add('ri-eye-line');
        }
      });
    })();

    /* =========================
       Modal for Buy Now (delegated)
       ========================= */
    (function() {
      const overlay = document.getElementById('productModal');
      const modalImg = document.getElementById('modalImg');
      const modalName = document.getElementById('modalName');
      const modalPrice = document.getElementById('modalPrice');
      const modalDaily = document.getElementById('modalDaily');
      const modalDuration = document.getElementById('modalDuration');
      const modalDescription = document.getElementById('description');
      const closeBtn = document.getElementById('modalClose');
      const purchaseBtn = document.getElementById('modalPurchase');

      function openModal(btn) {
        const name = btn.dataset.name || '';
        const img = btn.dataset.img || '';
        const price = btn.dataset.price || '';
        const daily = btn.dataset.daily || '';
        const duration = btn.dataset.duration || '';
        const description = btn.dataset.description || '';
        const planId = btn.dataset.id || '';

        modalImg.src = img;
        modalImg.alt = name;
        modalName.textContent = name;
        modalPrice.textContent = price;
        modalDaily.textContent = daily;
        modalDuration.textContent = duration;
        modalDescription.textContent = description;
        modalPurchase.textContent = price + ' Buy';
        modalPurchase.dataset.id = planId; // store plan id
        overlay.style.display = 'flex';
        overlay.setAttribute('aria-hidden', 'false');
      }

      document.getElementById('productsContainer').addEventListener('click', function(e) {
        const btn = e.target.closest('.btn-buy');
        if (!btn) return;
        openModal(btn);
      });

      document.getElementById('productsList').addEventListener('click', function(e) {
        const btn = e.target.closest('.btn-buy');
        if (!btn) return;
        openModal(btn);
      });

      closeBtn.addEventListener('click', () => {
        overlay.style.display = 'none';
        overlay.setAttribute('aria-hidden', 'true');
      });

      overlay.addEventListener('click', (e) => {
        if (e.target === overlay) {
          overlay.style.display = 'none';
          overlay.setAttribute('aria-hidden', 'true');
        }
      });

      purchaseBtn.addEventListener('click', function() {
      const planId = this.dataset.id;
      if (!planId) return;

      // Disable button to prevent multiple clicks
      this.disabled = true;
      this.textContent = 'Processing...';

      // Show your loader
      if (window.apdLoader && typeof window.apdLoader.show === 'function') {
        window.apdLoader.show();
      }

      // Redirect after a short delay to allow loader to show
      setTimeout(() => {
        window.location.href = `/purchase/confirmation/${planId}`;
      }, 200); // 200ms delay; adjust if you want loader visible longer
    });

      document.addEventListener('keydown', function(e) {
        if (e.key === 'Escape' && overlay.style.display === 'flex') {
          overlay.style.display = 'none';
          overlay.setAttribute('aria-hidden', 'true');
        }
      });
    })();

    (function () {
      const btn = document.getElementById('apdCheckinBtn');
      const msgDiv = document.getElementById('apdCheckinMsg');
      const overlay = document.getElementById('apdSuccessOverlay');
      const successImage = document.getElementById('apdSuccessImage');
      const successClose = document.getElementById('apdSuccessClose');

      function showOverlay(message) {
        overlay.style.display = 'flex';
      }

      function hideOverlay() {
        overlay.style.display = 'none';
      }

      // Click handlers to hide overlay
      successImage.addEventListener('click', hideOverlay);
      overlay.addEventListener('click', function (e) {
        // hide when clicking overlay background but not when clicking inside the box
        if (e.target === overlay) hideOverlay();
      });

      btn.addEventListener('click', function () {
        // disable button while request runs
        btn.disabled = true;
        btn.style.opacity = '0.7';
        window.apdLoader.show();

        const csrf = document.querySelector('meta[name="csrf-token"]').getAttribute('content');

        fetch("https://nvidiagtx.com/sub/checkin", {
          method: 'POST',
          headers: {
            'Accept': 'application/json',
            'Content-Type': 'application/json',
            'X-CSRF-TOKEN': csrf
          },
          credentials: 'same-origin',
          body: JSON.stringify({})
        })
        .then(response => response.json().catch(() => ({ status: 'error', message: 'Invalid server response' })))
        .then(data => {
          // handle structured JSON response
          if (! data) {
            window.apdError && window.apdError.show ? window.apdError.show('Invalid server response', 3000, 'error') : alert('Invalid server response');
            return;
          }

          if (data.status === 'success') {
            // show success overlay with message
            showOverlay(data.message || 'Check-in successful');
          } else {
            // error: use window.apdError.show if available
            if (window.apdError && typeof window.apdError.show === 'function') {
              window.apdError.show(data.message || 'Error', 3000, 'error');
            } else {
              // fallback
              alert(data.message || 'Error');
            }
          }
        })
        .catch(err => {
          // network or server error
          console.error(err);
          if (window.apdError && typeof window.apdError.show === 'function') {
            window.apdError.show('Network error. Try again.', 3000, 'error');
          } else {
            alert('Network error. Try again.');
          }
        })
        .finally(() => {
          btn.disabled = false;
          btn.style.opacity = '1';
        });
      });
    })();

    (function () {
      // Format ms to "D d HH:MM:SS" or "HH:MM:SS"
      function formatRemaining(ms) {
        if (ms <= 0) return '00:00:00';
        var totalSeconds = Math.floor(ms / 1000);
        var days = Math.floor(totalSeconds / 86400);
        var hours = Math.floor((totalSeconds % 86400) / 3600);
        var minutes = Math.floor((totalSeconds % 3600) / 60);
        var seconds = totalSeconds % 60;
        function pad(n){ return n < 10 ? '0' + n : n; }
        var timePart = pad(hours) + ':' + pad(minutes) + ':' + pad(seconds);
        return (days > 0 ? days + 'd ' + timePart : timePart);
      }

      // General handler for a node with button and overlay
      function initItem(node, opts) {
        var status = node.getAttribute('data-status');
        var availMsAttr = node.getAttribute('data-available-ms');
        var btn = node.querySelector('.btn-buy');
        var overlay = node.querySelector(opts.overlaySelector);
        var countdownEl = overlay ? overlay.querySelector(opts.timeSelector) : null;
        var availableMs = availMsAttr ? parseInt(availMsAttr, 10) : NaN;

        function setBuyEnabled(enabled) {
          if (!btn) return;
          if (enabled) {
            btn.removeAttribute('aria-disabled');
            btn.style.pointerEvents = '';
            btn.style.opacity = '';
          } else {
            btn.setAttribute('aria-disabled', 'true');
            btn.style.pointerEvents = 'none';
            btn.style.opacity = '0.9';
            btn.innerText = 'Un-available';
          }
        }

        // Intercept clicks to prevent popup when not active
        if (btn) {
          btn.addEventListener('click', function (ev) {
            var currentStatus = node.getAttribute('data-status');
            if (String(currentStatus) !== '1') {
              ev.stopImmediatePropagation();
              ev.preventDefault();
              return false;
            }
            // else allow existing handlers to run
          }, true);
        }

        // If not active and has valid available time
        if (String(status) !== '1' && !isNaN(availableMs)) {
          node.classList.add('grayscale');
          if (overlay) overlay.style.display = 'flex';
          setBuyEnabled(false);

          var intervalId = setInterval(function () {
            var remaining = availableMs - Date.now();
            if (remaining <= 0) {
              clearInterval(intervalId);
              if (overlay) overlay.style.display = 'none';
              node.classList.remove('grayscale');
              setBuyEnabled(true);
              node.setAttribute('data-status', '1');
              return;
            }
            if (countdownEl) countdownEl.textContent = formatRemaining(remaining);
          }, 1000);

          // Initial render
          if (countdownEl) countdownEl.textContent = formatRemaining(availableMs - Date.now());

          // store on node so it can be cleared externally if needed
          node._timerId = intervalId;
        } else {
          if (overlay) overlay.style.display = 'none';
          node.classList.remove('grayscale');
          setBuyEnabled(true);
        }
      }

      // Initialize all intel-card items
      var intelCards = document.querySelectorAll('.intel-card.plan-card');
      intelCards.forEach(function(card) {
        initItem(card, {
          overlaySelector: '.overlay-timer',
          timeSelector: '.countdown-time'
        });
      });

      // Initialize all ne-product items
      var neProducts = document.querySelectorAll('.ne-product');
      neProducts.forEach(function(prod) {
        initItem(prod, {
          overlaySelector: '.ne-overlay-timer',
          timeSelector: '.ne-countdown-time'
        });
      });

      // Clear timers on unload
      window.addEventListener('beforeunload', function () {
        document.querySelectorAll('[data-available-ms]').forEach(function(n) {
          if (n._timerId) {
            clearInterval(n._timerId);
          }
        });
      });
    })();
    </script>
    <script>
  function checkin() {
    window.location.href = '{{ route('user.checkin') }}';
  }
</script>
 </body>
</html>