<?php $__env->startSection('title', 'Custom CSS & JS'); ?>

<?php $__env->startPush('styles'); ?>
    <link rel="stylesheet" href="<?php echo e(asset('assets/admin/modules/codemirror/lib/codemirror.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('assets/admin/modules/codemirror/theme/duotone-dark.css')); ?>">
    <style>
        .CodeMirror {
            height: 250px;
            border: 1px solid #e4e6fc;
            border-radius: 5px;
        }
    </style>
<?php $__env->stopPush(); ?>

<?php $__env->startSection('breadcrumb'); ?>
    <div class="section-header-breadcrumb">
        <div class="breadcrumb-item"><a href="<?php echo e(route('admin.dashboard')); ?>">Dashboard</a></div>
        <div class="breadcrumb-item"><a href="<?php echo e(route('admin.settings.index')); ?>">Settings</a></div>
        <div class="breadcrumb-item active">Custom CSS & JS</div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('main-content'); ?>
    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-header d-flex justify-content-between align-items-center">
                    <h4>Custom Scripts & Styling</h4>
                    <a href="<?php echo e(route('admin.settings.index')); ?>" class="btn btn-secondary"> <i
                            class="fas fa-arrow-left"></i> Back to Settings</a>
                </div>
                <form action="<?php echo e(route('admin.settings.custom_scripts.update')); ?>" method="POST">
                    <?php echo csrf_field(); ?>
                    <?php echo method_field('PUT'); ?>
                    <div class="card-body">
                        <div class="alert alert-info">
                            <i class="fas fa-info-circle"></i> Use these fields to inject custom code into your platform. These changes will reflect on the frontend.
                        </div>

                        <div class="form-group">
                            <label for="custom_css">Custom CSS</label>
                            <p class="text-muted small">Enter CSS code without <code>&lt;style&gt;</code> tags. This will be injected into the <code>&lt;head&gt;</code> of all pages.</p>
                            <textarea name="custom_css" id="custom_css" class="form-control"><?php echo e(old('custom_css', $settings['custom_css'] ?? '')); ?></textarea>
                            <?php $__errorArgs = ['custom_css'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <div class="invalid-feedback d-block"><?php echo e($message); ?></div>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="form-group">
                            <label for="custom_js">Custom JavaScript</label>
                            <p class="text-muted small">Enter JS code without <code>&lt;script&gt;</code> tags. This will be injected before the <code>&lt;/body&gt;</code> tag.</p>
                            <textarea name="custom_js" id="custom_js" class="form-control"><?php echo e(old('custom_js', $settings['custom_js'] ?? '')); ?></textarea>
                            <?php $__errorArgs = ['custom_js'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <div class="invalid-feedback d-block"><?php echo e($message); ?></div>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <hr>

                        <div class="form-group">
                            <label for="header_script">Header Scripts (Full Script Tags)</label>
                            <p class="text-muted small">Enter full HTML tags (e.g., <code>&lt;script&gt;...&lt;/script&gt;</code>, <code>&lt;meta&gt;</code>). Injected into the <code>&lt;head&gt;</code>.</p>
                            <textarea name="header_script" id="header_script" class="form-control"><?php echo e(old('header_script', $settings['header_script'] ?? '')); ?></textarea>
                            <?php $__errorArgs = ['header_script'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <div class="invalid-feedback d-block"><?php echo e($message); ?></div>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="form-group">
                            <label for="footer_script">Footer Scripts (Full Script Tags)</label>
                            <p class="text-muted small">Enter full HTML tags (e.g., <code>&lt;script&gt;...&lt;/script&gt;</code>). Injected before the <code>&lt;/body&gt;</code>.</p>
                            <textarea name="footer_script" id="footer_script" class="form-control"><?php echo e(old('footer_script', $settings['footer_script'] ?? '')); ?></textarea>
                            <?php $__errorArgs = ['footer_script'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <div class="invalid-feedback d-block"><?php echo e($message); ?></div>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                    </div>
                    <div class="card-footer text-right">
                        <button type="submit" class="btn btn-primary">Save Custom Scripts</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('scripts'); ?>
    <script src="<?php echo e(asset('assets/admin/modules/codemirror/lib/codemirror.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/admin/modules/codemirror/mode/javascript/javascript.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/admin/modules/codemirror/mode/css/css.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/admin/modules/codemirror/mode/htmlmixed/htmlmixed.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/admin/modules/codemirror/mode/xml/xml.js')); ?>"></script>
    <script>
        $(document).ready(function() {
            var cssEditor = CodeMirror.fromTextArea(document.getElementById("custom_css"), {
                lineNumbers: true,
                mode: "css",
                theme: "duotone-dark",
            });
            var jsEditor = CodeMirror.fromTextArea(document.getElementById("custom_js"), {
                lineNumbers: true,
                mode: "javascript",
                theme: "duotone-dark",
            });
            var headerEditor = CodeMirror.fromTextArea(document.getElementById("header_script"), {
                lineNumbers: true,
                mode: "htmlmixed",
                theme: "duotone-dark",
            });
            var footerEditor = CodeMirror.fromTextArea(document.getElementById("footer_script"), {
                lineNumbers: true,
                mode: "htmlmixed",
                theme: "duotone-dark",
            });
        });
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/mahmudul/Codecanyone/edu_ex_full/Eduex_laravel/resources/views/admin/settings/custom-scripts.blade.php ENDPATH**/ ?>