<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Web3 Derp — decentralized perpetuals trading with leverage, yield pools, and bank-grade security.">
    <title>@yield('title', 'Web3 Derp') — Decentralized Perpetuals Trading</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,300..900;1,300..900&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="{{ asset('css/content-width.css') }}">
    <link rel="stylesheet" href="{{ asset('css/app.css') }}">
    @stack('head')
</head>
<body>
    @unless($hideHeader ?? false)
        <header class="site-header">
            <div class="container header-inner">
                <a href="{{ route('home') }}" class="logo">
                    <span class="logo-icon">W3</span>
                    <span>Web3 Derp</span>
                </a>
                <nav>
                    <ul class="nav-links">
                        <li><a href="{{ route('home') }}#features">Features</a></li>
                        <li><a href="{{ route('home') }}#security">Security</a></li>
                        <li><a href="{{ route('home') }}#stats">Stats</a></li>
                    </ul>
                </nav>
                <div class="header-actions">
                    @auth
                        <a href="{{ auth()->user()->isAdmin() ? route('admin.dashboard') : route('client.home') }}" class="btn btn-ghost">Dashboard</a>
                        <form action="{{ route('logout') }}" method="POST" style="display:inline">
                            @csrf
                            <button type="submit" class="btn btn-outline">Log out</button>
                        </form>
                    @else
                        <a href="{{ route('login') }}" class="btn btn-ghost">Log in</a>
                        <a href="{{ route('register') }}" class="btn btn-primary">Get Started</a>
                    @endauth
                </div>
            </div>
        </header>
    @endunless

    <main>
        @yield('content')
    </main>

    @unless($hideFooter ?? false)
        <footer class="site-footer">
            <div class="container">
                <p>&copy; 2026 Web3 Derp — All Rights Reserved.</p>
            </div>
        </footer>
    @endunless
</body>
</html>
