<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@yield('title', AleshaSetting::get('site_name', config('app.name')))</title>
    <meta name="description" content="@yield('description', AleshaSetting::get('meta_description', ''))">
    @php $favicon = AleshaSetting::get('site_favicon'); @endphp
    @if($favicon)
    <link rel="icon" href="{{ $favicon }}" type="{{ str_ends_with($favicon, '.ico') ? 'image/x-icon' : 'image/png' }}">
    <link rel="shortcut icon" href="{{ $favicon }}">
    @endif
    <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=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
    @vite(['resources/css/theme.css'])
    @php
        $_dc = AleshaSetting::get('theme_colors.default', []);
        $_dp = $_dc['primary'] ?? '#4f46e5';
        $_dd = $_dc['primary_dark'] ?? '#4338ca';
    @endphp
    @if($_dp !== '#4f46e5' || $_dd !== '#4338ca')
    <style>
        :root { --theme-primary: {{ $_dp }}; --theme-primary-dark: {{ $_dd }}; }
        .bg-indigo-600, .hover\:bg-indigo-700:hover { background-color: var(--theme-primary) !important; }
        .bg-indigo-500 { background-color: var(--theme-primary) !important; }
        .text-indigo-600, .hover\:text-indigo-600:hover { color: var(--theme-primary) !important; }
        .text-indigo-300 { color: color-mix(in srgb, var(--theme-primary) 60%, #fff) !important; }
        .border-indigo-500, .ring-indigo-500 { border-color: var(--theme-primary) !important; }
        .bg-indigo-50 { background-color: color-mix(in srgb, var(--theme-primary) 8%, #fff) !important; }
        .bg-indigo-100, .bg-indigo-200 { background-color: color-mix(in srgb, var(--theme-primary) 20%, #fff) !important; }
        .from-indigo-500, .from-indigo-950 { --tw-gradient-from: var(--theme-primary) !important; }
        .to-violet-500, .to-violet-900 { --tw-gradient-to: var(--theme-primary-dark) !important; }
        .focus\:ring-indigo-500:focus { --tw-ring-color: var(--theme-primary) !important; }
    </style>
    @endif
    @yield('head')
</head>
<body class="bg-white text-gray-900 antialiased">
    @include('theme-default::partials.header')
    <main>
        @yield('content')
    </main>
    @include('theme-default::partials.footer')
    @yield('scripts')
</body>
</html>
