<?php
/**
 * Super Admin Topbar Component
 * Uso: include __DIR__ . '/includes/topbar.php';
 * Variáveis necessárias: $pageTitle, $superAdmin
 */
$pageTitle = $pageTitle ?? 'MontaLoja';
$superAdmin = $superAdmin ?? ['name' => 'Admin'];
?>
<header class="topbar">
    <div class="topbar-left">
        <button class="mobile-menu-btn" id="mobileMenuBtn" aria-label="Menu">
            <iconify-icon icon="solar:hamburger-menu-bold"></iconify-icon>
        </button>
        <h2 class="topbar-title"><?= htmlspecialchars($pageTitle) ?></h2>
    </div>
    <div class="topbar-right">
        <!-- Theme Switcher -->
        <div class="theme-switcher">
            <button class="theme-btn" data-theme="light" title="Modo Claro">
                <iconify-icon icon="solar:sun-bold"></iconify-icon>
            </button>
            <button class="theme-btn" data-theme="dark" title="Modo Escuro">
                <iconify-icon icon="solar:moon-bold"></iconify-icon>
            </button>
            <button class="theme-btn" data-theme="auto" title="Automático">
                <iconify-icon icon="solar:monitor-bold"></iconify-icon>
            </button>
        </div>

        <div class="user-menu">
            <img src="https://ui-avatars.com/api/?name=<?= urlencode($superAdmin['name'] ?? 'Admin') ?>&background=CCA43B&color=1A1A1A" class="user-avatar" alt="Avatar">
            <div class="user-info">
                <span class="user-name"><?= htmlspecialchars($superAdmin['name'] ?? 'Super Admin') ?></span>
                <span class="user-role">Administrador</span>
            </div>
        </div>
    </div>
</header>
