<?php
require_once 'db.php';
require_once 'auth_check.php';
$_sup = $conn->query("SELECT key_value FROM settings WHERE key_name='support_url'");
$support_url = ($_sup && $_row = $_sup->fetch_assoc()) ? ($_row['key_value'] ?? '#') : '#';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FAQ</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.11.3/font/bootstrap-icons.min.css">
<style>
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
body{background:linear-gradient(160deg,#b8cba8 0%,#a8bc96 40%,#8faa7a 100%);min-height:100vh;font-family:'Segoe UI',system-ui,sans-serif;color:#1a2a0a;padding-bottom:90px}

.topbar{background:rgba(255,255,255,.6);backdrop-filter:blur(8px);border-bottom:1px solid rgba(255,255,255,.5);padding:13px 16px;display:flex;align-items:center;gap:12px;position:sticky;top:0;z-index:200}
.back-btn{color:#3a5a2a;font-size:20px;text-decoration:none}
.topbar-title{font-weight:700;font-size:16px;color:#1a2a0a}

.hero{background:rgba(255,255,255,.35);border-bottom:1px solid rgba(255,255,255,.4);padding:28px 20px 24px;text-align:center}
.hero i{font-size:44px;color:#3a7a4a;display:block;margin-bottom:10px}
.hero h1{font-size:20px;font-weight:800;color:#1a2a0a;margin-bottom:6px}
.hero p{font-size:13px;color:#3a5a2a;line-height:1.6}

.tabs-wrap{display:flex;gap:8px;overflow-x:auto;padding:14px 14px 4px;scrollbar-width:none}
.tabs-wrap::-webkit-scrollbar{display:none}
.tab-btn{flex-shrink:0;background:rgba(255,255,255,.6);border:1px solid rgba(255,255,255,.7);color:#3a5a2a;border-radius:20px;padding:7px 16px;font-size:12px;font-weight:600;cursor:pointer;transition:all .2s;white-space:nowrap}
.tab-btn.active{background:#3a7a4a;border-color:#3a7a4a;color:#fff}

.faq-section{display:none;padding:10px 0}
.faq-section.visible{display:block}

.sec-head{display:flex;align-items:center;gap:8px;padding:12px 14px 8px;font-size:11px;font-weight:700;color:#3a5a2a;text-transform:uppercase;letter-spacing:.5px}
.sec-dot{width:6px;height:6px;border-radius:50%;background:#3a7a4a;flex-shrink:0}

.faq-item{background:rgba(255,255,255,.75);border:1px solid rgba(255,255,255,.65);border-radius:14px;margin:0 14px 10px;overflow:hidden;box-shadow:0 2px 8px rgba(0,0,0,.06)}
.faq-q{display:flex;align-items:center;padding:15px 16px;cursor:pointer;gap:10px;font-size:13.5px;font-weight:600;color:#1a2a0a}
.faq-q .q-icon{flex-shrink:0;width:28px;height:28px;background:rgba(58,122,74,.15);border-radius:8px;display:flex;align-items:center;justify-content:center;color:#3a7a4a;font-size:14px}
.faq-q .q-text{flex:1;line-height:1.4}
.faq-q .chevron{flex-shrink:0;color:#6a8a5a;font-size:15px;transition:transform .3s}
.faq-item.open .chevron{transform:rotate(180deg)}

.faq-a{max-height:0;overflow:hidden;transition:max-height .35s ease,padding .3s;padding:0 16px;font-size:13px;color:#3a5a2a;line-height:1.75}
.faq-item.open .faq-a{max-height:500px;padding:14px 16px;border-top:1px solid rgba(58,122,74,.15)}
.faq-a ul{padding-left:16px;margin-top:6px}
.faq-a ul li{margin-bottom:5px}
.faq-a strong{color:#1a2a0a}

.support-cta{background:rgba(255,255,255,.75);border:1px solid rgba(255,255,255,.65);border-radius:16px;margin:10px 14px 20px;padding:20px;text-align:center;box-shadow:0 2px 10px rgba(0,0,0,.06)}
.support-cta i{font-size:30px;color:#3a7a4a;display:block;margin-bottom:8px}
.support-cta h3{font-size:15px;font-weight:700;margin-bottom:6px;color:#1a2a0a}
.support-cta p{font-size:12px;color:#3a5a2a;margin-bottom:14px}
.support-cta a{display:inline-block;background:linear-gradient(135deg,#3a7a4a,#5aaa6a);color:#fff;text-decoration:none;padding:11px 28px;border-radius:10px;font-size:13px;font-weight:700}
</style>
</head>
<body>

<div class="topbar">
  <a href="javascript:history.back()" class="back-btn"><i class="bi bi-arrow-left"></i></a>
  <span class="topbar-title"><i class="bi bi-question-circle me-1" style="color:#3a7a4a"></i> FAQ</span>
</div>

<div class="hero">
  <i class="bi bi-patch-question-fill"></i>
  <h1>Frequently Asked Questions</h1>
  <p>Find answers to the most common questions<br>about our platform and services.</p>
</div>

<div class="tabs-wrap">
  <button class="tab-btn active" onclick="showTab('general',this)">General</button>
  <button class="tab-btn" onclick="showTab('account',this)">Account</button>
  <button class="tab-btn" onclick="showTab('tasks',this)">Tasks & Videos</button>
  <button class="tab-btn" onclick="showTab('investment',this)">Investment</button>
  <button class="tab-btn" onclick="showTab('wallet',this)">Wallet</button>
  <button class="tab-btn" onclick="showTab('security',this)">Security</button>
</div>

<!-- GENERAL -->
<div class="faq-section visible" id="tab-general">
  <div class="sec-head"><div class="sec-dot"></div>General</div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-info-circle"></i></div><span class="q-text">What is this platform?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">We are a <strong>video task and wealth fund platform</strong> focused on enhancing individual development. Members earn income by engaging with video content including movies, promotions, and educational clips, while also accessing long-term legitimate investment plans that grow their wealth over time.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-people"></i></div><span class="q-text">Who can join this platform?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">Membership is open to individuals who are <strong>18 years of age or older</strong>. By registering, you confirm that you meet this age requirement. We do not accept registrations from minors under any circumstances.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-globe"></i></div><span class="q-text">Is this platform available in my country?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">Our platform is available internationally. However, certain financial features including deposits, withdrawals, and investment plans may be subject to your local laws and regulations. It is your responsibility to ensure you comply with the laws of your country.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-currency-dollar"></i></div><span class="q-text">Is it free to join?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">Registration is <strong>completely free</strong>. You only need to fund your account when you wish to activate a task plan or make an investment. There are no hidden sign-up fees.</div>
  </div>
</div>

<!-- ACCOUNT -->
<div class="faq-section" id="tab-account">
  <div class="sec-head"><div class="sec-dot"></div>Account</div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-person-plus"></i></div><span class="q-text">How do I create an account?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">Click the <strong>Register</strong> button on the login page. Fill in your full name, phone number or email, and create a secure password. You may also be required to enter an invitation code if you were referred by another member.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-key"></i></div><span class="q-text">I forgot my password. What should I do?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">On the login page, tap <strong>Forgot Password</strong> and follow the steps to reset it via your registered phone number or email. If you face issues, contact our support team directly.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-person-check"></i></div><span class="q-text">Can I have more than one account?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a"><strong>No.</strong> Each person is allowed only one account. Creating multiple accounts is a violation of our terms and will result in all accounts being permanently suspended and any funds forfeited.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-pencil-square"></i></div><span class="q-text">How do I update my profile information?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">Go to <strong>Account → Profile Settings</strong> to update your name, phone number, avatar, and withdrawal details. Some changes may require identity verification for security purposes.</div>
  </div>
</div>

<!-- TASKS -->
<div class="faq-section" id="tab-tasks">
  <div class="sec-head"><div class="sec-dot"></div>Tasks & Videos</div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-play-circle"></i></div><span class="q-text">How do video tasks work?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">After activating a plan, you are assigned daily video tasks. Watch or interact with each video to earn your daily task income. Tasks include movies, promotional content, and platform partner videos. Your earnings are credited automatically after completing each task.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-calendar-check"></i></div><span class="q-text">How many tasks can I complete per day?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">The number of daily tasks depends on your active plan. Each plan has a defined number of tasks per day. Once you reach your daily limit, tasks will reset the following day.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-patch-question"></i></div><span class="q-text">What happens if I miss a day?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">Uncompleted tasks do <strong>not carry over</strong> to the next day. Missing a day means you miss that day's earnings. We recommend completing your tasks daily to maximize your income.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-film"></i></div><span class="q-text">What type of videos are on the platform?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">Our video library includes:<ul><li>Movies and short film clips</li><li>Brand promotional videos</li><li>Educational and personal development content</li><li>Platform partner advertisements</li></ul>All content is reviewed to meet our community standards.</div>
  </div>
</div>

<!-- INVESTMENT -->
<div class="faq-section" id="tab-investment">
  <div class="sec-head"><div class="sec-dot"></div>Investment</div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-graph-up-arrow"></i></div><span class="q-text">What are investment plans?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">Our investment plans are <strong>long-term wealth fund products</strong> where you deposit a fixed amount for a defined cycle. During the cycle, your investment earns a daily return rate. At maturity, the total principal plus profit is returned to your account balance.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-shield-check"></i></div><span class="q-text">Are investments safe and legitimate?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">Yes. Our wealth fund investments are backed by our platform's revenue from video advertising partnerships and media licensing. All plans are clearly defined with fixed rates and cycles. We operate transparently with no hidden fees.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-clock-history"></i></div><span class="q-text">When do I receive my investment returns?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">Your total return (principal + profit) is credited automatically when your investment cycle matures. The maturity date is shown on each investment card. You can then withdraw or reinvest.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-x-circle"></i></div><span class="q-text">Can I cancel an investment early?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">Investment plans are <strong>locked until maturity</strong>. Early cancellation is not supported to protect the integrity of the wealth fund. Please only invest amounts you are comfortable locking for the full cycle duration.</div>
  </div>
</div>

<!-- WALLET -->
<div class="faq-section" id="tab-wallet">
  <div class="sec-head"><div class="sec-dot"></div>Wallet</div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-wallet2"></i></div><span class="q-text">How do I deposit funds?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">Go to <strong>Recharge</strong> from the home menu. Select your preferred payment method, enter the amount, and follow the instructions. Deposits are reflected in your balance once confirmed.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-bank"></i></div><span class="q-text">How do I withdraw my earnings?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">Go to <strong>Withdraw</strong> from the home menu. Enter the amount and confirm your withdrawal details. Withdrawals are processed within 1–3 business days depending on your payment method.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-clock"></i></div><span class="q-text">How long do withdrawals take?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">Processing times:<ul><li><strong>Mobile Money:</strong> Within 24 hours</li><li><strong>Bank Transfer:</strong> 1–3 business days</li><li><strong>Other methods:</strong> As stated at time of request</li></ul>Delays may occur during weekends or public holidays.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-people-fill"></i></div><span class="q-text">How does the referral bonus work?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">When you invite a friend who registers and activates a plan, you receive a referral commission. The commission varies by plan level. Track your team earnings under the <strong>Team</strong> section.</div>
  </div>
</div>

<!-- SECURITY -->
<div class="faq-section" id="tab-security">
  <div class="sec-head"><div class="sec-dot"></div>Security & Privacy</div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-lock-fill"></i></div><span class="q-text">How is my personal data protected?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">All your registration and personal data is protected using <strong>end-to-end encryption</strong>. We do not sell, share, or disclose your personal information to third parties without your explicit consent.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-eye-slash"></i></div><span class="q-text">Can others see my account balance?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">No. Your account balance, transaction history, and investment details are <strong>completely private</strong>. Only you can view this information when logged in.</div>
  </div>
  <div class="faq-item">
    <div class="faq-q" onclick="toggle(this)"><div class="q-icon"><i class="bi bi-shield-exclamation"></i></div><span class="q-text">What should I do if I suspect unauthorized access?</span><i class="bi bi-chevron-down chevron"></i></div>
    <div class="faq-a">Immediately change your password and contact our support team. Recommendations:<ul><li>Use a strong, unique password</li><li>Never share your login credentials</li><li>Log out after each session on shared devices</li><li>Report any suspicious activity immediately</li></ul></div>
  </div>
</div>

<div class="support-cta">
  <i class="bi bi-headset"></i>
  <h3>Still have questions?</h3>
  <p>Our support team is available 24/7 to help you.</p>
  <a href="<?= htmlspecialchars($support_url) ?>" target="_blank"><i class="bi bi-chat-dots me-1"></i>Contact Support</a>
</div>

<?php include 'navigation_bottom.php'; ?>
<script>
function showTab(id,btn){document.querySelectorAll('.faq-section').forEach(s=>s.classList.remove('visible'));document.querySelectorAll('.tab-btn').forEach(b=>b.classList.remove('active'));document.getElementById('tab-'+id).classList.add('visible');btn.classList.add('active')}
function toggle(q){q.closest('.faq-item').classList.toggle('open')}
</script>
</body>
</html>