<?php $__env->startSection('title', 'System Settings'); ?>

<?php $__env->startSection('content'); ?>

    <div class="mb-8">
        <h1 class="text-3xl font-extrabold text-white tracking-tight">System Configuration</h1>
        <p class="text-slate-400 mt-1 text-sm">Manage API keys, authentication, mail, branding, and security from one place.</p>
    </div>

    <?php if(session('success')): ?>
        <div class="bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 px-4 py-3 rounded-xl mb-6 flex items-center gap-3">
            <i class="fas fa-check-circle"></i> <?php echo e(session('success')); ?>

        </div>
    <?php endif; ?>
    <?php if(session('error')): ?>
        <div class="bg-red-500/10 border border-red-500/20 text-red-400 px-4 py-3 rounded-xl mb-6 flex items-center gap-3">
            <i class="fas fa-exclamation-triangle"></i> <?php echo e(session('error')); ?>

        </div>
    <?php endif; ?>

    <form action="<?php echo e(route('admin.settings.update')); ?>" method="POST" enctype="multipart/form-data">
        <?php echo csrf_field(); ?>
        
        <div class="bg-slate-800/40 border border-slate-700 rounded-2xl p-2 mb-6 flex overflow-x-auto custom-scrollbar shadow-sm">
            <button type="button" onclick="switchTab('tab-general')" id="btn-tab-general" class="tab-btn active whitespace-nowrap flex-1 py-3 px-4 rounded-xl text-sm font-bold transition-all flex items-center justify-center gap-2">
                <i class="fas fa-paint-brush"></i> General & SEO
            </button>
            <button type="button" onclick="switchTab('tab-auth')" id="btn-tab-auth" class="tab-btn whitespace-nowrap flex-1 py-3 px-4 rounded-xl text-sm font-bold text-slate-400 hover:text-white transition-all flex items-center justify-center gap-2">
                <i class="fas fa-shield-alt"></i> Auth & Security
            </button>
            <button type="button" onclick="switchTab('tab-mail')" id="btn-tab-mail" class="tab-btn whitespace-nowrap flex-1 py-3 px-4 rounded-xl text-sm font-bold text-slate-400 hover:text-white transition-all flex items-center justify-center gap-2">
                <i class="fas fa-envelope"></i> Mail (SMTP)
            </button>
            <button type="button" onclick="switchTab('tab-api')" id="btn-tab-api" class="tab-btn whitespace-nowrap flex-1 py-3 px-4 rounded-xl text-sm font-bold text-slate-400 hover:text-white transition-all flex items-center justify-center gap-2">
                <i class="fas fa-plug"></i> Gateways & Bots
            </button>
            <button type="button" onclick="switchTab('tab-admin')" id="btn-tab-admin" class="tab-btn whitespace-nowrap flex-1 py-3 px-4 rounded-xl text-sm font-bold text-slate-400 hover:text-white transition-all flex items-center justify-center gap-2">
                <i class="fas fa-user-lock"></i> Admin Profile
            </button>
        </div>

        <div class="bg-slate-800/40 border border-slate-700 rounded-2xl p-6 md:p-8 shadow-lg relative min-h-[400px]">
            
            <div id="tab-general" class="tab-content block animate-fadeIn">
                <h2 class="text-xl font-bold text-white mb-6 flex items-center gap-2 border-b border-slate-700 pb-4"><i class="fas fa-image text-blue-400"></i> Branding</h2>
                
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
                    <div class="bg-slate-900/50 border border-slate-700 rounded-xl p-5 text-center flex flex-col items-center justify-center">
                        <?php if(\App\Models\Setting::val('site_logo')): ?>
                            <img src="<?php echo e(asset(\App\Models\Setting::val('site_logo'))); ?>" alt="Logo" class="h-12 mb-4 object-contain">
                        <?php else: ?>
                            <div class="h-12 w-12 mb-4 bg-slate-800 rounded flex items-center justify-center text-slate-500"><i class="fas fa-image"></i></div>
                        <?php endif; ?>
                        <label class="block text-xs font-bold text-slate-400 uppercase mb-2">Upload Site Logo</label>
                        <input type="file" name="site_logo" accept="image/*" class="text-sm text-slate-400 file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-semibold file:bg-blue-500/10 file:text-blue-400 cursor-pointer">
                    </div>

                    <div class="bg-slate-900/50 border border-slate-700 rounded-xl p-5 text-center flex flex-col items-center justify-center">
                        <?php if(\App\Models\Setting::val('site_favicon')): ?>
                            <img src="<?php echo e(asset(\App\Models\Setting::val('site_favicon'))); ?>" alt="Favicon" class="h-8 w-8 mb-4 object-contain">
                        <?php else: ?>
                            <div class="h-8 w-8 mb-4 bg-slate-800 rounded flex items-center justify-center text-slate-500"><i class="fas fa-globe"></i></div>
                        <?php endif; ?>
                        <label class="block text-xs font-bold text-slate-400 uppercase mb-2">Upload Favicon</label>
                        <input type="file" name="site_favicon" accept="image/*" class="text-sm text-slate-400 file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-semibold file:bg-indigo-500/10 file:text-indigo-400 cursor-pointer">
                    </div>
                </div>

                <div class="space-y-5">
                    <div>
                        <label class="block text-xs font-bold text-slate-400 uppercase mb-2">Site Name</label>
                        <input type="text" name="site_name" value="<?php echo e(\App\Models\Setting::val('site_name')); ?>" class="w-full bg-slate-900 border border-slate-700 text-white rounded-xl focus:border-blue-500 p-3 outline-none transition-colors">
                    </div>
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-5">
                        <div>
                            <label class="block text-xs font-bold text-slate-400 uppercase mb-2">SEO Title</label>
                            <input type="text" name="seo_title" value="<?php echo e(\App\Models\Setting::val('seo_title')); ?>" class="w-full bg-slate-900 border border-slate-700 text-white rounded-xl focus:border-blue-500 p-3 outline-none transition-colors">
                        </div>
                        <div>
                            <label class="block text-xs font-bold text-slate-400 uppercase mb-2">SEO Description</label>
                            <input type="text" name="seo_description" value="<?php echo e(\App\Models\Setting::val('seo_description')); ?>" class="w-full bg-slate-900 border border-slate-700 text-white rounded-xl focus:border-blue-500 p-3 outline-none transition-colors">
                        </div>
                    </div>
                </div>
            </div>

            <div id="tab-auth" class="tab-content hidden animate-fadeIn">
                
                <div class="mb-8 bg-slate-900/30 border border-slate-700/50 p-6 rounded-2xl">
                    <div class="flex items-center justify-between mb-4 border-b border-slate-700/50 pb-4">
                        <div>
                            <h3 class="text-lg font-bold text-white flex items-center gap-2"><img src="https://www.svgrepo.com/show/475656/google-color.svg" class="w-5 h-5"> Google Login API</h3>
                            <p class="text-xs text-slate-400 mt-1">Allow users to register and login using their Google account.</p>
                        </div>
                        <label class="relative inline-flex items-center cursor-pointer">
                            <input type="checkbox" name="enable_google_login" value="yes" class="sr-only peer" <?php echo e(\App\Models\Setting::val('enable_google_login') == 'yes' ? 'checked' : ''); ?>>
                            <div class="w-11 h-6 bg-slate-700 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-emerald-500"></div>
                        </label>
                    </div>
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-5">
                        <div>
                            <label class="block text-[10px] font-bold text-slate-500 uppercase mb-2">Google Client ID</label>
                            <input type="text" name="google_client_id" value="<?php echo e(\App\Models\Setting::val('google_client_id')); ?>" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-lg focus:border-blue-500 p-3 outline-none font-mono">
                        </div>
                        <div>
                            <label class="block text-[10px] font-bold text-slate-500 uppercase mb-2">Google Client Secret</label>
                            <input type="password" name="google_client_secret" value="<?php echo e(\App\Models\Setting::val('google_client_secret')); ?>" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-lg focus:border-blue-500 p-3 outline-none font-mono">
                        </div>
                    </div>
                </div>

                <div class="bg-slate-900/30 border border-slate-700/50 p-6 rounded-2xl">
                    <div class="flex items-center justify-between mb-4 border-b border-slate-700/50 pb-4">
                        <div>
                            <h3 class="text-lg font-bold text-white flex items-center gap-2"><i class="fas fa-robot text-emerald-400"></i> Google reCAPTCHA v2</h3>
                            <p class="text-xs text-slate-400 mt-1">Protect login and registration pages from bots and spam.</p>
                        </div>
                        <label class="relative inline-flex items-center cursor-pointer">
                            <input type="checkbox" name="enable_captcha" value="yes" class="sr-only peer" <?php echo e(\App\Models\Setting::val('enable_captcha') == 'yes' ? 'checked' : ''); ?>>
                            <div class="w-11 h-6 bg-slate-700 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-emerald-500"></div>
                        </label>
                    </div>
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-5">
                        <div>
                            <label class="block text-[10px] font-bold text-slate-500 uppercase mb-2">Site Key</label>
                            <input type="text" name="recaptcha_site_key" value="<?php echo e(\App\Models\Setting::val('recaptcha_site_key')); ?>" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-lg focus:border-blue-500 p-3 outline-none font-mono">
                        </div>
                        <div>
                            <label class="block text-[10px] font-bold text-slate-500 uppercase mb-2">Secret Key</label>
                            <input type="password" name="recaptcha_secret_key" value="<?php echo e(\App\Models\Setting::val('recaptcha_secret_key')); ?>" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-lg focus:border-blue-500 p-3 outline-none font-mono">
                        </div>
                    </div>
                </div>
            </div>

            <div id="tab-mail" class="tab-content hidden animate-fadeIn">
                <div class="flex items-center justify-between mb-6 border-b border-slate-700 pb-4">
                    <div>
                        <h2 class="text-xl font-bold text-white flex items-center gap-2"><i class="fas fa-envelope text-indigo-400"></i> SMTP Configuration</h2>
                        <p class="text-xs text-slate-400 mt-1">Configure email settings for sending verification links and notifications.</p>
                    </div>
                    <div class="bg-indigo-500/10 border border-indigo-500/20 px-4 py-2 rounded-xl flex items-center gap-3">
                        <span class="text-xs font-bold text-indigo-400 uppercase">Require Email Verification?</span>
                        <label class="relative inline-flex items-center cursor-pointer">
                            <input type="checkbox" name="enable_email_verify" value="yes" class="sr-only peer" <?php echo e(\App\Models\Setting::val('enable_email_verify') == 'yes' ? 'checked' : ''); ?>>
                            <div class="w-9 h-5 bg-slate-700 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-indigo-500"></div>
                        </label>
                    </div>
                </div>

                <div class="grid grid-cols-1 md:grid-cols-2 gap-5 mb-5">
                    <div>
                        <label class="block text-xs font-bold text-slate-400 uppercase mb-2">SMTP Host</label>
                        <input type="text" name="smtp_host" value="<?php echo e(\App\Models\Setting::val('smtp_host')); ?>" placeholder="smtp.gmail.com" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-xl focus:border-indigo-500 p-3 outline-none">
                    </div>
                    <div>
                        <label class="block text-xs font-bold text-slate-400 uppercase mb-2">SMTP Port</label>
                        <input type="text" name="smtp_port" value="<?php echo e(\App\Models\Setting::val('smtp_port')); ?>" placeholder="465 or 587" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-xl focus:border-indigo-500 p-3 outline-none">
                    </div>
                    <div class="md:col-span-2">
                        <label class="block text-xs font-bold text-slate-400 uppercase mb-2">Sender Email Address (From)</label>
                        <input type="email" name="mail_from_address" value="<?php echo e(\App\Models\Setting::val('mail_from_address')); ?>" placeholder="noreply@yourdomain.com" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-xl focus:border-indigo-500 p-3 outline-none">
                    </div>
                    <div>
                        <label class="block text-xs font-bold text-slate-400 uppercase mb-2">SMTP Username</label>
                        <input type="text" name="smtp_username" value="<?php echo e(\App\Models\Setting::val('smtp_username')); ?>" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-xl focus:border-indigo-500 p-3 outline-none">
                    </div>
                    <div>
                        <label class="block text-xs font-bold text-slate-400 uppercase mb-2">SMTP Password / App Password</label>
                        <input type="password" name="smtp_password" value="<?php echo e(\App\Models\Setting::val('smtp_password')); ?>" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-xl focus:border-indigo-500 p-3 outline-none font-mono">
                    </div>
                    <div class="md:col-span-2">
                        <label class="block text-xs font-bold text-slate-400 uppercase mb-2">Encryption Type</label>
                        <select name="smtp_encryption" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-xl focus:border-indigo-500 p-3 outline-none">
                            <option value="tls" <?php echo e(\App\Models\Setting::val('smtp_encryption') == 'tls' ? 'selected' : ''); ?>>TLS</option>
                            <option value="ssl" <?php echo e(\App\Models\Setting::val('smtp_encryption') == 'ssl' ? 'selected' : ''); ?>>SSL</option>
                        </select>
                    </div>
                </div>
            </div>

            <div id="tab-api" class="tab-content hidden animate-fadeIn">
                <div class="mb-6 border-b border-slate-700 pb-6">
                    <h3 class="text-lg font-bold text-white mb-4 flex items-center gap-2"><i class="fas fa-credit-card text-emerald-400"></i> PayFastBD Integration</h3>
                    <div>
                        <label class="block text-xs font-bold text-slate-400 uppercase mb-2">Merchant API Key</label>
                        <input type="text" name="payfastbd_api_key" value="<?php echo e(\App\Models\Setting::val('payfastbd_api_key')); ?>" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-xl focus:border-emerald-500 p-3 outline-none font-mono">
                    </div>
                </div>

                <div class="mb-6 border-b border-slate-700 pb-6">
                    <h3 class="text-lg font-bold text-white mb-4 flex items-center gap-2"><i class="fab fa-telegram text-blue-400"></i> Telegram Bot</h3>
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-5">
                        <div>
                            <label class="block text-xs font-bold text-slate-400 uppercase mb-2">Bot Token</label>
                            <input type="text" name="telegram_bot_token" value="<?php echo e(\App\Models\Setting::val('telegram_bot_token')); ?>" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-xl focus:border-blue-500 p-3 outline-none font-mono">
                        </div>
                        <div>
                            <label class="block text-xs font-bold text-slate-400 uppercase mb-2">Admin Chat ID</label>
                            <input type="text" name="telegram_admin_id" value="<?php echo e(\App\Models\Setting::val('telegram_admin_id')); ?>" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-xl focus:border-blue-500 p-3 outline-none font-mono">
                        </div>
                    </div>
                </div>

                <div>
                    <h3 class="text-lg font-bold text-white mb-4 flex items-center gap-2"><i class="fas fa-headset text-purple-400"></i> Contact & Notice</h3>
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-5 mb-5">
                        <div>
                            <label class="block text-xs font-bold text-slate-400 uppercase mb-2">Support Email</label>
                            <input type="email" name="site_email" value="<?php echo e(\App\Models\Setting::val('site_email')); ?>" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-xl focus:border-purple-500 p-3 outline-none">
                        </div>
                        <div>
                            <label class="block text-xs font-bold text-slate-400 uppercase mb-2">WhatsApp / Phone</label>
                            <input type="text" name="site_phone" value="<?php echo e(\App\Models\Setting::val('site_phone')); ?>" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-xl focus:border-purple-500 p-3 outline-none">
                        </div>
                        <div class="md:col-span-2">
                            <label class="block text-xs font-bold text-slate-400 uppercase mb-2">Global Notice Board (User Dashboard)</label>
                            <textarea name="notice_text" rows="3" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-xl focus:border-purple-500 p-3 outline-none resize-none"><?php echo e(\App\Models\Setting::val('notice_text')); ?></textarea>
                        </div>
                    </div>
                </div>
            </div>

            <div id="tab-admin" class="tab-content hidden animate-fadeIn">
                <h2 class="text-xl font-bold text-white mb-6 border-b border-slate-700 pb-3"><i class="fas fa-user-shield text-red-400 mr-2"></i> Admin Security</h2>
                
                <div class="p-4 bg-orange-500/10 border border-orange-500/20 rounded-xl mb-6">
                    <p class="text-xs text-orange-400 font-medium"><i class="fas fa-exclamation-triangle mr-1"></i> Fill these fields ONLY if you want to change your admin password. Leave blank otherwise.</p>
                </div>

                <div class="space-y-5 max-w-2xl">
                    <div>
                        <label class="block text-xs font-bold text-slate-400 uppercase mb-2">Current Password</label>
                        <input type="password" name="current_password" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-xl focus:border-red-500 p-3 outline-none">
                    </div>
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-5">
                        <div>
                            <label class="block text-xs font-bold text-slate-400 uppercase mb-2">New Password</label>
                            <input type="password" name="new_password" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-xl focus:border-red-500 p-3 outline-none">
                        </div>
                        <div>
                            <label class="block text-xs font-bold text-slate-400 uppercase mb-2">Confirm New Password</label>
                            <input type="password" name="confirm_password" class="w-full bg-slate-900 border border-slate-700 text-white text-sm rounded-xl focus:border-red-500 p-3 outline-none">
                        </div>
                    </div>
                </div>
            </div>

            <div class="absolute bottom-6 right-6">
                <button type="submit" class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-8 rounded-xl shadow-lg shadow-blue-600/30 transition-all hover:scale-[1.02] flex items-center justify-center gap-2 border border-blue-500">
                    <i class="fas fa-save"></i> Save All Settings
                </button>
            </div>
            
        </div>
    </form>

    <script>
        function switchTab(tabId) {
            document.querySelectorAll('.tab-content').forEach(el => el.classList.add('hidden'));
            document.querySelectorAll('.tab-btn').forEach(el => {
                el.classList.remove('bg-blue-600/20', 'text-blue-400', 'border-blue-500');
                el.classList.add('text-slate-400');
            });

            document.getElementById(tabId).classList.remove('hidden');
            let activeBtn = document.getElementById('btn-' + tabId);
            activeBtn.classList.remove('text-slate-400');
            activeBtn.classList.add('bg-blue-600/20', 'text-blue-400');
        }
        
        // Apply animation style dynamically
        document.head.insertAdjacentHTML("beforeend", `<style>.animate-fadeIn { animation: fadeIn 0.4s ease-in-out; } @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } .custom-scrollbar::-webkit-scrollbar { height: 4px; } .custom-scrollbar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }</style>`);
        
        // Initialize first tab
        switchTab('tab-general');
    </script>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/anstserv/shop.bd1b.com/resources/views/admin/settings/index.blade.php ENDPATH**/ ?>