@*
    EN: POS terminal layout — Full-screen, status bar + content, touch-friendly.
    VI: Layout POS — Toàn màn hình, thanh trạng thái + nội dung, thân thiện cảm ứng.
    Design: pencil-design/src/pages/tPOS/pos/cafe/desktop.pen
*@
@inherits LayoutComponentBase
@inject IStringLocalizer<PosLayout> L
@inject NavigationManager NavigationManager

<MudThemeProvider IsDarkMode="true" Theme="_theme" />
<MudPopoverProvider />
<MudDialogProvider />
<MudSnackbarProvider />

<div class="pos-layout">
    @* ═══ STATUS BAR ═══ *@
    <header class="pos-status-bar">
        <div class="pos-status-bar__left">
            <span class="pos-status-bar__logo">GoodGo POS</span>
            <span class="pos-status-bar__store">@StoreName</span>
        </div>
        <div class="pos-status-bar__right">
            <div class="pos-status-bar__indicator pos-status-bar__indicator--online">
                <span style="width:6px;height:6px;border-radius:100px;background:currentColor;"></span>
                <span>Online</span>
            </div>
            <span style="font-size:13px;color:var(--pos-text-secondary);">@DateTime.Now.ToString("HH:mm")</span>
            <button class="admin-icon-btn" @onclick="GoToAdmin" title="Admin">
                <i data-lucide="settings"></i>
            </button>
        </div>
    </header>

    @* ═══ MAIN CONTENT ═══ *@
    <div class="pos-main">
        @Body
    </div>
</div>

@code {
    private string StoreName { get; set; } = "Coffee House Q1";

    private void GoToAdmin() => NavigationManager.NavigateTo("/admin");

    private MudTheme _theme = new()
    {
        PaletteDark = new PaletteDark()
        {
            Primary = "#FF5C00",
            PrimaryContrastText = "#FFFFFF",
            AppbarBackground = "#1A1A1D",
            AppbarText = "#FFFFFF",
            Background = "#0A0A0B",
            Surface = "#1A1A1D",
            TextPrimary = "#FFFFFF",
            TextSecondary = "#ADADB0",
            ActionDefault = "#FFFFFF",
            LinesDefault = "#1F1F23"
        }
    };
}
