<!DOCTYPE html>
<html lang="tr">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <title>DW Ads Reporter | @yield('title', $page_title ?? 'Müşteri Portalı')</title>
    <link rel="icon" type="image/png" sizes="16x16" href="{{ asset('images/favicon.png') }}">
    <link href="{{ asset('vendor/bootstrap-select/dist/css/bootstrap-select.min.css') }}" rel="stylesheet">
    <link href="{{ asset('css/style.css') }}" rel="stylesheet">
    <style>
        body { background:#f6f7fb; }
        .portal-shell { min-height:100vh; }
        .portal-topbar { background:#fff; border-bottom:1px solid #ececec; position:sticky; top:0; z-index:20; }
        .portal-brand { font-weight:800; color:#111; letter-spacing:-.3px; }
        .portal-brand span { display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px; border-radius:12px; background:#2f4cdd; color:#fff; margin-right:10px; }
        .portal-nav a { color:#555; font-weight:600; padding:10px 12px; border-radius:10px; display:inline-block; }
        .portal-nav a.active, .portal-nav a:hover { background:#f0f3ff; color:#2f4cdd; }
        .metric-card { border:0; box-shadow:0 8px 26px rgba(20,20,40,.05); border-radius:16px; }
        .metric-value { font-size:26px; font-weight:800; color:#111; }
        .soft-panel { border:0; border-radius:16px; box-shadow:0 8px 26px rgba(20,20,40,.05); }
        .portal-muted { color:#7c8291; }
    </style>
</head>
<body>
<div class="portal-shell">
    <div class="portal-topbar">
        <div class="container-fluid px-4 py-3">
            <div class="d-flex align-items-center justify-content-between flex-wrap gap-3">
                <a href="{{ route('portal.dashboard') }}" class="portal-brand d-flex align-items-center text-decoration-none">
                    <span>DW</span> Ads Reporter
                </a>
                @auth
                    <div class="portal-nav d-flex align-items-center gap-1 flex-wrap">
                        <a href="{{ route('portal.dashboard') }}" class="{{ request()->routeIs('portal.dashboard') ? 'active' : '' }}">Dashboard</a>
                        <a href="{{ route('portal.reports') }}" class="{{ request()->routeIs('portal.reports*') ? 'active' : '' }}">Raporlarım</a>
                        <a href="{{ route('portal.alerts') }}" class="{{ request()->routeIs('portal.alerts') ? 'active' : '' }}">Uyarılarım</a>
                    </div>
                    <form action="{{ route('portal.logout') }}" method="POST" class="mb-0">
                        @csrf
                        <button class="btn btn-light btn-sm" type="submit">Çıkış</button>
                    </form>
                @endauth
            </div>
        </div>
    </div>

    <main class="container-fluid px-4 py-4">
        @if(session('success'))
            <div class="alert alert-success">{{ session('success') }}</div>
        @endif
        @if(session('error'))
            <div class="alert alert-danger">{{ session('error') }}</div>
        @endif

        @yield('content')
    </main>
</div>
<script src="{{ asset('vendor/global/global.min.js') }}"></script>
<script src="{{ asset('vendor/bootstrap-select/dist/js/bootstrap-select.min.js') }}"></script>
@stack('scripts')
</body>
</html>
