@page "/account/access-denied"
@using Indotalent.Features.Root
@using MudBlazor
@layout MainLayout

<PageTitle>Access Denied - Insufficient Permissions</PageTitle>

<MudContainer MaxWidth="MaxWidth.Medium" Class="d-flex align-center justify-center" Style="height: calc(100vh - 64px);">

    <div class="text-center">

        <MudIcon Icon="@Icons.Material.Filled.GppBad"
                 Size="Size.Large"
                 Color="Color.Error"
                 Class="mb-6"
                 Style="font-size: 120px;" />

        <MudText Typo="Typo.h3" Class="mb-4" Style="font-weight: 800; color: #1a1a1a;">Access Denied</MudText>

        <MudText Typo="Typo.body1" Class="mb-6" Style="color: #64748b;">
            Sorry, you do not have the required permissions to access this module.<br />
            This area is restricted to authorized administrative personnel only.
        </MudText>

        <MudPaper Elevation="1" Class="pa-4 mb-8 d-inline-block" Style="border-radius: 0px; border: 1px solid #DCEBFA;">
            <MudText Typo="Typo.subtitle2" Class="mb-1">
                <strong>Error Code:</strong> <code>AGS_AUTH_INSUFFICIENT_PERMISSIONS</code>
            </MudText>
            <MudText Typo="Typo.caption" Style="color: #94a3b8; font-family: 'Consolas', monospace;">
                Verification failed for the current security context.
            </MudText>
        </MudPaper>

        <div class="d-flex align-center justify-center gap-4">
            <MudButton Variant="Variant.Filled"
                       Color="Color.Primary"
                       Size="Size.Large"
                       OnClick="GoHome"
                       StartIcon="@Icons.Material.Filled.Home"
                       Style="border-radius: 0px; font-weight: 700;">
                Back to Home
            </MudButton>

            <MudButton Variant="Variant.Outlined"
                       Color="Color.Default"
                       Size="Size.Large"
                       OnClick="Logout"
                       StartIcon="@Icons.Material.Filled.Logout"
                       Style="border-radius: 0px; font-weight: 700; border: 2px solid #e2e8f0;">
                Logout & Switch Account
            </MudButton>
        </div>

    </div>

</MudContainer>

@code {
    [Inject] private NavigationManager Nav { get; set; } = default!;

    private void GoHome() => Nav.NavigateTo("/");
    private void Logout() => Nav.NavigateTo("/account/logout");
}