@page "/"
@namespace WerksverkaufScanner.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="utf-8" />
    <base href="/pvk/scanner/" /> <!-- WICHTIG für Ressourcen-Pfade! -->
    <title>ScannerPilot</title>

    <!-- Wichtig für Mobile -->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <meta name="theme-color" content="#0d6efd" />

    <!-- Bootstrap CSS (CDN) -->
    <link rel="stylesheet"
          href="css/bootstrap/bootstrap.min.css"
          crossorigin="anonymous" />

    <!-- DevExpress-Blazor Theme -->
    <link href="_content/DevExpress.Blazor.Themes/blazing-berry.bs5.min.css" rel="stylesheet" />

    <!-- Eigene globale Styles -->
    <link rel="stylesheet" href="css/site.css" />

    <!-- Blazor Scoped CSS der Assembly (Name = dein Projektname) -->
    <link rel="stylesheet" href="WerksverkaufScanner.styles.css" />

    <!-- PWA Icons/Manifest (optional) -->
    <link rel="manifest" href="/pvk/scanner/manifest.webmanifest">
    <link rel="icon" sizes="192x192" href="/pvk/scanner/icons/icon-192.png">
    <link rel="apple-touch-icon" href="/pvk/scanner/icons/icon-192.png">
</head>
<body>
    <app>
        <component type="typeof(App)" render-mode="Server" />
    </app>

    <!-- Blazor Server Script -->
    <script src="_framework/blazor.server.js"></script>

    <!-- Bootstrap BUNDLE (für Offcanvas, Collapse etc.) -->
    <script src="js/bootstrap.bundle.min.js"
            crossorigin="anonymous"></script>

    <!-- DevExpress Blazor JS (ohne dieses Script funktioniert das Grid NICHT!) -->
    <!--<script src="_content/DevExpress.Blazor/dx-blazor.js"></script>-->
    <script src="_content/DevExpress.Blazor.Resources/js/import-scripts.js"></script>

    <!-- (Optional) Service Worker Registrierung -->
    <script>
        if ('serviceWorker' in navigator) {
            navigator.serviceWorker.register('/service-worker.js');
        }
    </script>
    <script>
        function hideOffcanvas(selector) {
            try {
                var el = document.querySelector(selector);
                if (!el || !window.bootstrap) return;
                var inst = bootstrap.Offcanvas.getOrCreateInstance(el);
                inst.hide();
            } catch (e) { console.warn('hideOffcanvas failed', e); }
        }
    </script>
    <script>
        window.removeFocus = function (element) {
          if (element) element.blur();
        }
    </script>
</body>
</html>
