{{-- Settings Sidebar Menu cu Categorii --}}
@php
    // Statistici pentru indicatori vizuali
    // Setting::get() returnează boolean pentru type='boolean', deci folosim cast explicit
    $smtpValue = \App\Models\Setting::get('smtp_enabled', false);
    $stats = [
        'smtp_enabled' => in_array($smtpValue, ['1', 1, true, 'true'], true),
        'captcha_enabled' => \Illuminate\Support\Facades\DB::table('captcha_settings')->where('enabled', 1)->exists(),
    ];
@endphp

<div class="w-72 flex-shrink-0">
    <div class="bg-white dark:bg-gray-800 rounded-xl shadow-sm overflow-hidden border border-gray-100 dark:border-gray-700">
        <nav class="p-3 space-y-1">
            {{-- === CONFIGURARE === --}}
            <div class="px-3 py-2 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider">
                <i class="fas fa-cogs mr-1"></i>Configurare
            </div>

            {{-- General Settings --}}
            <a href="{{ route('admin.settings.index') }}"
               class="flex items-center px-4 py-3 text-base font-medium rounded-lg transition {{ request()->routeIs('admin.settings.index') ? 'bg-blue-600 text-white' : 'text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700' }}">
                <div class="flex items-center justify-center w-8 h-8 rounded-lg {{ request()->routeIs('admin.settings.index') ? 'bg-white/20' : 'bg-blue-100 dark:bg-blue-900/30' }} mr-3">
                    <i class="fas fa-cog {{ request()->routeIs('admin.settings.index') ? 'text-white' : 'text-blue-600 dark:text-blue-400' }}"></i>
                </div>
                <span>@trans_db('general_settings', 'settings', 'General Settings')</span>
            </a>

            {{-- Advanced Settings (disabled) --}}
            <div class="flex items-center px-4 py-3 text-base font-medium rounded-lg text-gray-400 dark:text-gray-600 cursor-not-allowed opacity-50 group relative" title="Disponibil în curând">
                <div class="flex items-center justify-center w-8 h-8 rounded-lg bg-gray-100 dark:bg-gray-800 mr-3">
                    <i class="fas fa-sliders-h text-gray-400"></i>
                </div>
                <span>@trans_db('advanced_settings', 'settings', 'Advanced')</span>
                <span class="ml-auto text-xs bg-gray-200 dark:bg-gray-700 text-gray-500 dark:text-gray-400 px-2 py-0.5 rounded">Soon</span>
            </div>

            {{-- Appearance (disabled) --}}
            <div class="flex items-center px-4 py-3 text-base font-medium rounded-lg text-gray-400 dark:text-gray-600 cursor-not-allowed opacity-50 group relative" title="Disponibil în curând">
                <div class="flex items-center justify-center w-8 h-8 rounded-lg bg-gray-100 dark:bg-gray-800 mr-3">
                    <i class="fas fa-palette text-gray-400"></i>
                </div>
                <span>@trans_db('appearance', 'settings', 'Appearance')</span>
                <span class="ml-auto text-xs bg-gray-200 dark:bg-gray-700 text-gray-500 dark:text-gray-400 px-2 py-0.5 rounded">Soon</span>
            </div>

            {{-- === EMAIL === --}}
            <div class="px-3 py-2 mt-4 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider border-t border-gray-200 dark:border-gray-700 pt-4">
                <i class="fas fa-envelope mr-1"></i>Email
            </div>

            {{-- SMTP Settings --}}
            <a href="{{ route('admin.settings.smtp') }}"
               class="flex items-center px-4 py-3 text-base font-medium rounded-lg transition {{ request()->routeIs('admin.settings.smtp') ? 'bg-blue-600 text-white' : 'text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700' }}">
                <div class="flex items-center justify-center w-8 h-8 rounded-lg {{ request()->routeIs('admin.settings.smtp') ? 'bg-white/20' : 'bg-green-100 dark:bg-green-900/30' }} mr-3">
                    <i class="fas fa-server {{ request()->routeIs('admin.settings.smtp') ? 'text-white' : 'text-green-600 dark:text-green-400' }}"></i>
                </div>
                <span>@trans_db('smtp_settings', 'settings', 'SMTP')</span>
                @if($stats['smtp_enabled'] ?? false)
                    <span class="ml-auto w-2 h-2 bg-green-500 rounded-full"></span>
                @else
                    <span class="ml-auto w-2 h-2 bg-yellow-500 rounded-full"></span>
                @endif
            </a>

            {{-- Email Templates --}}
            <a href="{{ route('admin.settings.email-templates') }}"
               class="flex items-center px-4 py-3 text-base font-medium rounded-lg transition {{ request()->routeIs('admin.settings.email-templates') ? 'bg-blue-600 text-white' : 'text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700' }}">
                <div class="flex items-center justify-center w-8 h-8 rounded-lg {{ request()->routeIs('admin.settings.email-templates') ? 'bg-white/20' : 'bg-orange-100 dark:bg-orange-900/30' }} mr-3">
                    <i class="fas fa-file-alt {{ request()->routeIs('admin.settings.email-templates') ? 'text-white' : 'text-orange-600 dark:text-orange-400' }}"></i>
                </div>
                <span>@trans_db('email_templates', 'settings', 'Templates')</span>
            </a>

            {{-- === WEB & SEO === --}}
            <div class="px-3 py-2 mt-4 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider border-t border-gray-200 dark:border-gray-700 pt-4">
                <i class="fas fa-globe mr-1"></i>Web & SEO
            </div>

            {{-- SEO --}}
            <a href="{{ route('admin.settings.seo') }}"
               class="flex items-center px-4 py-3 text-base font-medium rounded-lg transition {{ request()->routeIs('admin.settings.seo') ? 'bg-blue-600 text-white' : 'text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700' }}">
                <div class="flex items-center justify-center w-8 h-8 rounded-lg {{ request()->routeIs('admin.settings.seo') ? 'bg-white/20' : 'bg-purple-100 dark:bg-purple-900/30' }} mr-3">
                    <i class="fas fa-search {{ request()->routeIs('admin.settings.seo') ? 'text-white' : 'text-purple-600 dark:text-purple-400' }}"></i>
                </div>
                <span>@trans_db('seo', 'settings', 'SEO')</span>
            </a>

            {{-- Languages --}}
            <a href="{{ route('admin.settings.languages.index') }}"
               class="flex items-center px-4 py-3 text-base font-medium rounded-lg transition {{ request()->routeIs('admin.settings.languages.*') ? 'bg-blue-600 text-white' : 'text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700' }}">
                <div class="flex items-center justify-center w-8 h-8 rounded-lg {{ request()->routeIs('admin.settings.languages.*') ? 'bg-white/20' : 'bg-cyan-100 dark:bg-cyan-900/30' }} mr-3">
                    <i class="fas fa-language {{ request()->routeIs('admin.settings.languages.*') ? 'text-white' : 'text-cyan-600 dark:text-cyan-400' }}"></i>
                </div>
                <span>@trans_db('title', 'languages', 'Languages')</span>
            </a>

            {{-- Blog Settings (disabled) --}}
            <div class="flex items-center px-4 py-3 text-base font-medium rounded-lg text-gray-400 dark:text-gray-600 cursor-not-allowed opacity-50" title="Disponibil în curând">
                <div class="flex items-center justify-center w-8 h-8 rounded-lg bg-gray-100 dark:bg-gray-800 mr-3">
                    <i class="fas fa-blog text-gray-400"></i>
                </div>
                <span>@trans_db('blog_settings', 'settings', 'Blog')</span>
                <span class="ml-auto text-xs bg-gray-200 dark:bg-gray-700 text-gray-500 dark:text-gray-400 px-2 py-0.5 rounded">Soon</span>
            </div>

            {{-- Ads (disabled) --}}
            <div class="flex items-center px-4 py-3 text-base font-medium rounded-lg text-gray-400 dark:text-gray-600 cursor-not-allowed opacity-50" title="Disponibil în curând">
                <div class="flex items-center justify-center w-8 h-8 rounded-lg bg-gray-100 dark:bg-gray-800 mr-3">
                    <i class="fas fa-ad text-gray-400"></i>
                </div>
                <span>@trans_db('ads', 'settings', 'Ads')</span>
                <span class="ml-auto text-xs bg-gray-200 dark:bg-gray-700 text-gray-500 dark:text-gray-400 px-2 py-0.5 rounded">Soon</span>
            </div>

            {{-- === SECURITATE === --}}
            <div class="px-3 py-2 mt-4 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider border-t border-gray-200 dark:border-gray-700 pt-4">
                <i class="fas fa-shield-alt mr-1"></i>Securitate
            </div>

            {{-- Captcha Settings --}}
            <a href="{{ route('admin.settings.captcha') }}"
               class="flex items-center px-4 py-3 text-base font-medium rounded-lg transition {{ request()->routeIs('admin.settings.captcha') ? 'bg-blue-600 text-white' : 'text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700' }}">
                <div class="flex items-center justify-center w-8 h-8 rounded-lg {{ request()->routeIs('admin.settings.captcha') ? 'bg-white/20' : 'bg-yellow-100 dark:bg-yellow-900/30' }} mr-3">
                    <i class="fas fa-robot {{ request()->routeIs('admin.settings.captcha') ? 'text-white' : 'text-yellow-600 dark:text-yellow-400' }}"></i>
                </div>
                <span>@trans_db('captcha_settings', 'settings', 'Captcha')</span>
                @if($stats['captcha_enabled'] ?? false)
                    <span class="ml-auto w-2 h-2 bg-green-500 rounded-full"></span>
                @endif
            </a>

            {{-- Security & 2FA --}}
            <a href="{{ route('admin.security.two-factor.index') }}"
               class="flex items-center px-4 py-3 text-base font-medium rounded-lg transition {{ request()->routeIs('admin.security.two-factor.*') ? 'bg-blue-600 text-white' : 'text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700' }}">
                <div class="flex items-center justify-center w-8 h-8 rounded-lg {{ request()->routeIs('admin.security.two-factor.*') ? 'bg-white/20' : 'bg-red-100 dark:bg-red-900/30' }} mr-3">
                    <i class="fas fa-lock {{ request()->routeIs('admin.security.two-factor.*') ? 'text-white' : 'text-red-600 dark:text-red-400' }}"></i>
                </div>
                <span>Securitate & 2FA</span>
            </a>

            {{-- API (disabled) --}}
            <div class="flex items-center px-4 py-3 text-base font-medium rounded-lg text-gray-400 dark:text-gray-600 cursor-not-allowed opacity-50" title="Disponibil în curând">
                <div class="flex items-center justify-center w-8 h-8 rounded-lg bg-gray-100 dark:bg-gray-800 mr-3">
                    <i class="fas fa-code text-gray-400"></i>
                </div>
                <span>@trans_db('api', 'settings', 'API')</span>
                <span class="ml-auto text-xs bg-gray-200 dark:bg-gray-700 text-gray-500 dark:text-gray-400 px-2 py-0.5 rounded">Soon</span>
            </div>

            {{-- === SISTEM === --}}
            <div class="px-3 py-2 mt-4 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider border-t border-gray-200 dark:border-gray-700 pt-4">
                <i class="fas fa-server mr-1"></i>Sistem
            </div>

            {{-- Admins (disabled) --}}
            <div class="flex items-center px-4 py-3 text-base font-medium rounded-lg text-gray-400 dark:text-gray-600 cursor-not-allowed opacity-50" title="Disponibil în curând">
                <div class="flex items-center justify-center w-8 h-8 rounded-lg bg-gray-100 dark:bg-gray-800 mr-3">
                    <i class="fas fa-users-cog text-gray-400"></i>
                </div>
                <span>@trans_db('admins', 'settings', 'Admins')</span>
                <span class="ml-auto text-xs bg-gray-200 dark:bg-gray-700 text-gray-500 dark:text-gray-400 px-2 py-0.5 rounded">Soon</span>
            </div>

            {{-- Cron Jobs --}}
            <a href="{{ route('admin.settings.cronjobs') }}"
               class="flex items-center px-4 py-3 text-base font-medium rounded-lg transition {{ request()->routeIs('admin.settings.cronjobs') ? 'bg-blue-600 text-white' : 'text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700' }}">
                <div class="flex items-center justify-center w-8 h-8 rounded-lg {{ request()->routeIs('admin.settings.cronjobs') ? 'bg-white/20' : 'bg-indigo-100 dark:bg-indigo-900/30' }} mr-3">
                    <i class="fas fa-clock {{ request()->routeIs('admin.settings.cronjobs') ? 'text-white' : 'text-indigo-600 dark:text-indigo-400' }}"></i>
                </div>
                <span>@trans_db('cron_jobs', 'settings', 'Cron Jobs')</span>
            </a>

            {{-- Cache (disabled) --}}
            <div class="flex items-center px-4 py-3 text-base font-medium rounded-lg text-gray-400 dark:text-gray-600 cursor-not-allowed opacity-50" title="Disponibil în curând">
                <div class="flex items-center justify-center w-8 h-8 rounded-lg bg-gray-100 dark:bg-gray-800 mr-3">
                    <i class="fas fa-database text-gray-400"></i>
                </div>
                <span>@trans_db('cache', 'settings', 'Cache')</span>
                <span class="ml-auto text-xs bg-gray-200 dark:bg-gray-700 text-gray-500 dark:text-gray-400 px-2 py-0.5 rounded">Soon</span>
            </div>
        </nav>
    </div>
</div>
