<?php if (!defined("FXH_PORTAL")) { die("No direct access"); } ?>

<div id="fxh-sidebar" class="fxh-sidebar">
    <div class="fxh-sidebar-header">
        <img src="/portal/user/assets/fx-hunter-logo.png" class="fxh-logo">
    </div>

    <ul class="fxh-menu">
        <li class="<?= ($pageTitle=='Dashboard'?'active':'') ?>"><a href="/portal/user/dashboard.php">📊 Dashboard</a></li>
        <li class="<?= ($pageTitle=='Open Trades'?'active':'') ?>"><a href="/portal/user/open_trades.php">📈 Open Trades</a></li>
        <li class="<?= ($pageTitle=='Trade History'?'active':'') ?>"><a href="/portal/user/history.php">📜 Trade History</a></li>
        <li class="<?= ($pageTitle=='Signals'?'active':'') ?>"><a href="/portal/user/signals.php">🔔 Signals</a></li>
    
        <li class="<?= ($pageTitle=='Plans'?'active':'') ?>"><a href="/portal/plans.php">💳 Plans</a></li>
        <li class="<?= ($pageTitle=='Plans'?'active':'') ?>"><a href="/portal/affiliate.php">🏆 Re-Seller</a></li>
        <li class="<?= ($pageTitle=='Licenses'?'active':'') ?>"><a href="/portal/user/licenses.php">🔑 My License Keys</a></li>
    
        <li class="<?= ($pageTitle=='Account Settings'?'active':'') ?>"><a href="/portal/user/account.php">👤 Account Settings</a></li>
        <li><a href="/portal/logout.php" class="logout">🚪 Logout</a></li>
    </ul>
</div>

<button id="fxh-hamburger" class="fxh-hamburger" onclick="toggleSidebar()">
    <span></span><span></span><span></span>
</button>

<style>
/* HAMBURGER */
.fxh-hamburger {
    position: fixed;
    top: 18px;
    left: 18px;
    width: 38px;
    height: 32px;
    z-index: 10000;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 8px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}
.fxh-hamburger span {
    height: 4px;
    width: 100%;
    background: #00eaff;
    border-radius: 3px;
}

/* HAMBURGER → X */
body.sidebar-collapsed .fxh-hamburger span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
body.sidebar-collapsed .fxh-hamburger span:nth-child(2) { opacity: 0; }
body.sidebar-collapsed .fxh-hamburger span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

/* SIDEBAR */
.fxh-sidebar {
    width: 260px;
    height: 100vh;
    background: rgba(12,18,28,.55);
    border-right: 1px solid rgba(0,255,255,.15);
    backdrop-filter: blur(14px);
    position: fixed;
    left: 0;
    top: 0;
    padding: 20px 10px;
    transition: .35s ease;
    z-index: 9999;
}

body.sidebar-collapsed .fxh-sidebar {
    transform: translateX(-260px);
}

@media (max-width:900px) {
    .fxh-sidebar { transform: translateX(-260px); }
    body.sidebar-collapsed .fxh-sidebar { transform: translateX(0); }
}
</style>

<script>
function toggleSidebar() {
    document.body.classList.toggle("sidebar-collapsed");
}
</script>
