<nav class="navbar navbar-expand-lg navbar-dark p-0">
    <div class="container-fluid bg-danger">
        <a class="navbar-brand text-white fw-bold" href="<?php echo URL_APP; ?>"><?php echo COMPANY_ABBR; ?></a>
        <ul class="navbar-nav flex-row gap-3 gap-md-3 gap-lg-2 align-items-center">

            <?php if ( $user['admin'] ) : ?>
                <li class="nav-item">
                    <a class="nav-link" href="<?php echo URL_APP_ADMIN; ?>">Admin</a>
                </li>
            <?php endif; ?>

            <div class="vr text-white"></div>
            <div id="notificationsMenuContainer">
                <?php include '../src/load-notifications.php'; ?>
            </div>

            <?php if ( $user ) : ?>
                <div class="vr text-white"></div>
                <li class="nav-item dropdown">
                    <!-- <a class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                        Logout
                    </a> -->
                    <button class="btn btn-link nav-link dropdown-toggle" type="button" data-bs-toggle="dropdown">
                        <i class="bi bi-person-circle"></i>
                    </button>
                    <ul class="dropdown-menu dropdown-menu-end position-absolute">
                        <?php if ( isset($_COOKIE['btbImpersonate']) ) : ?>
                            <li><a class="dropdown-item" href="<?php echo URL_APP_ADMIN; ?>/src/end-impersonation.php">End impersonation</a></li>
                        <?php endif; ?>
                        <?php if ( !isset($_COOKIE['btbImpersonate']) ) : ?>
                            <li><a class="dropdown-item" href="<?php echo URL_APP_LOGOUT; ?>">Logout this device</a></li>
                            <li><a class="dropdown-item" href="<?php echo URL_APP_LOGOUT; ?>?all=1">Logout all devices</a></li>
                        <?php endif; ?>
                    </ul>
                </li>
            <?php endif; ?>

            <div class="vr text-white"></div>

            <li class="nav-item dropdown">
                <button class="btn btn-link nav-link dropdown-toggle theme-icon-active" id="bd-theme" type="button" data-bs-toggle="dropdown" data-bs-display="static">
                    <i class="bi bi-sun-fill"></i>
                    <!-- <span id="bd-theme-text" class="d-lg-none">Theme</span> -->
                </button>
                <ul class="dropdown-menu dropdown-menu-end position-absolute" aria-labelledby="bd-theme-text">
                    <li>
                        <button type="button" class="dropdown-item btbAction" data-bs-theme-value="light" data-action="click" data-target="theme mode light">
                            <i class="bi bi-sun-fill"></i>
                            <span class="ms-2">Light</span>
                        </button>
                    </li>
                    <li>
                        <button type="button" class="dropdown-item btbAction" data-bs-theme-value="dark" data-action="click" data-target="theme mode dark">
                            <i class="bi bi-moon-fill"></i>
                            <span class="ms-2">Dark</span>
                        </button>
                    </li>
                    <li>
                        <button type="button" class="dropdown-item btbAction" data-bs-theme-value="auto" data-action="click" data-target="theme mode auto">
                            <i class="bi bi-circle-half"></i>
                            <span class="ms-2">Auto</span>
                        </button>
                    </li>
                </ul>
            </li>
        </ul>
    </div>
</nav>