<div>
    
    <div class="d-flex justify-content-between align-items-center mb-4">
        <div>
            <h1 class="h3 mb-1"><?php echo e(__('System Update')); ?></h1>
            <p class="text-muted mb-0"><?php echo e(__('Manage database migrations, caches, and system optimization.')); ?></p>
        </div>
        <div class="badge bg-<?php echo e($maintenanceStatus === 'up' ? 'success' : 'danger'); ?> fs-6 px-3 py-2">
            <i class="fas fa-circle me-1"></i>
            <?php echo e($maintenanceStatus === 'up' ? __('System Online') : __('Maintenance Mode')); ?>

        </div>
    </div>

    
    <div class="row g-3 mb-4">
        <div class="col-md-4">
            <div class="card border-0 shadow-sm h-100">
                <div class="card-body d-flex align-items-center gap-3">
                    <div class="rounded-circle bg-primary bg-opacity-10 p-3">
                        <i class="fab fa-php text-primary fs-4"></i>
                    </div>
                    <div>
                        <div class="text-muted small"><?php echo e(__('PHP Version')); ?></div>
                        <div class="fw-bold"><?php echo e(PHP_VERSION); ?></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="card border-0 shadow-sm h-100">
                <div class="card-body d-flex align-items-center gap-3">
                    <div class="rounded-circle bg-danger bg-opacity-10 p-3">
                        <i class="fab fa-laravel text-danger fs-4"></i>
                    </div>
                    <div>
                        <div class="text-muted small"><?php echo e(__('Laravel Version')); ?></div>
                        <div class="fw-bold"><?php echo e(app()->version()); ?></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="card border-0 shadow-sm h-100">
                <div class="card-body d-flex align-items-center gap-3">
                    <div class="rounded-circle bg-success bg-opacity-10 p-3">
                        <i class="fas fa-server text-success fs-4"></i>
                    </div>
                    <div>
                        <div class="text-muted small"><?php echo e(__('Environment')); ?></div>
                        <div class="fw-bold text-capitalize"><?php echo e(app()->environment()); ?></div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="row g-4">
        
        <div class="col-lg-5">
            <div class="card border-0 shadow-sm">
                <div class="card-header bg-transparent border-bottom">
                    <h5 class="mb-0"><i class="fas fa-sliders-h me-2 text-primary"></i><?php echo e(__('Control Panel')); ?></h5>
                </div>
                <div class="card-body d-grid gap-3">

                    
                    <div class="p-3 border rounded-3">
                        <div class="d-flex justify-content-between align-items-start mb-2">
                            <div>
                                <h6 class="mb-1"><i class="fas fa-database me-2 text-primary"></i><?php echo e(__('Update Database')); ?></h6>
                                <p class="text-muted small mb-0"><?php echo e(__('Run pending migrations to apply new database changes.')); ?></p>
                            </div>
                        </div>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!$showMigrateConfirm): ?>
                            <button wire:click="$set('showMigrateConfirm', true)" class="btn btn-primary btn-sm w-100 mt-2" wire:loading.attr="disabled">
                                <i class="fas fa-play me-1"></i> <?php echo e(__('Run Migrations')); ?>

                            </button>
                        <?php else: ?>
                            <div class="alert alert-warning py-2 px-3 mb-2 small">
                                <i class="fas fa-exclamation-triangle me-1"></i>
                                <?php echo e(__('Are you sure? This will modify the database schema.')); ?>

                            </div>
                            <div class="d-flex gap-2">
                                <button wire:click="runMigration" class="btn btn-danger btn-sm flex-fill" wire:loading.attr="disabled">
                                    <span wire:loading wire:target="runMigration"><i class="fas fa-spinner fa-spin me-1"></i></span>
                                    <?php echo e(__('Yes, Migrate')); ?>

                                </button>
                                <button wire:click="$set('showMigrateConfirm', false)" class="btn btn-outline-secondary btn-sm flex-fill">
                                    <?php echo e(__('Cancel')); ?>

                                </button>
                            </div>
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </div>

                    
                    <div class="p-3 border rounded-3">
                        <h6 class="mb-1"><i class="fas fa-broom me-2 text-warning"></i><?php echo e(__('Clear Cache')); ?></h6>
                        <p class="text-muted small mb-2"><?php echo e(__('Clear config, route, view, and application caches.')); ?></p>
                        <button wire:click="clearCache" class="btn btn-warning btn-sm w-100" wire:loading.attr="disabled">
                            <span wire:loading wire:target="clearCache"><i class="fas fa-spinner fa-spin me-1"></i></span>
                            <i class="fas fa-trash-alt me-1"></i> <?php echo e(__('Clear All Caches')); ?>

                        </button>
                    </div>

                    
                    <div class="p-3 border rounded-3">
                        <h6 class="mb-1"><i class="fas fa-rocket me-2 text-success"></i><?php echo e(__('Optimize System')); ?></h6>
                        <p class="text-muted small mb-2"><?php echo e(__('Cache config, routes, and views for better performance.')); ?></p>
                        <button wire:click="runOptimize" class="btn btn-success btn-sm w-100" wire:loading.attr="disabled">
                            <span wire:loading wire:target="runOptimize"><i class="fas fa-spinner fa-spin me-1"></i></span>
                            <i class="fas fa-bolt me-1"></i> <?php echo e(__('Optimize')); ?>

                        </button>
                    </div>

                    
                    <div class="p-3 border border-danger rounded-3">
                        <h6 class="mb-1 text-danger"><i class="fas fa-hard-hat me-2"></i><?php echo e(__('Maintenance Mode')); ?></h6>
                        <p class="text-muted small mb-2">
                            <?php echo e($maintenanceStatus === 'up'
                                ? __('Take the site offline for visitors while you perform updates.')
                                : __('The site is currently offline. Click to bring it back online.')); ?>

                        </p>
                        <button wire:click="toggleMaintenance"
                                class="btn btn-sm w-100 <?php echo e($maintenanceStatus === 'up' ? 'btn-outline-danger' : 'btn-danger'); ?>"
                                wire:loading.attr="disabled">
                            <span wire:loading wire:target="toggleMaintenance"><i class="fas fa-spinner fa-spin me-1"></i></span>
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($maintenanceStatus === 'up'): ?>
                                <i class="fas fa-power-off me-1"></i> <?php echo e(__('Enable Maintenance Mode')); ?>

                            <?php else: ?>
                                <i class="fas fa-check-circle me-1"></i> <?php echo e(__('Disable Maintenance Mode')); ?>

                            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        </button>
                    </div>

                </div>
            </div>
        </div>

        
        <div class="col-lg-7">
            <div class="card border-0 shadow-sm h-100">
                <div class="card-header bg-transparent border-bottom d-flex justify-content-between align-items-center">
                    <h5 class="mb-0"><i class="fas fa-terminal me-2 text-success"></i><?php echo e(__('Console Output')); ?></h5>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($output): ?>
                        <button wire:click="clearOutput" class="btn btn-sm btn-outline-secondary">
                            <i class="fas fa-times me-1"></i><?php echo e(__('Clear')); ?>

                        </button>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>
                <div class="card-body p-0">
                    <pre id="console-output"
                         style="background:#1a1a2e; color:#00ff88; font-family:'Courier New', monospace; font-size:0.8rem; min-height:400px; max-height:600px; overflow-y:auto; padding:1.25rem; margin:0; border-radius:0 0 0.5rem 0.5rem; white-space:pre-wrap; word-break:break-word;"><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($output): ?><?php echo e($output); ?><?php else: ?><span style="color:#666;"><?php echo e(__('No output yet. Run an action from the Control Panel.')); ?></span><?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?></pre>
                </div>
            </div>
        </div>
    </div>
</div>

    <?php
        $__scriptKey = '2243364112-0';
        ob_start();
    ?>
<script>
    // Auto-scroll console output to bottom when updated
    Livewire.on('output-updated', () => {
        const el = document.getElementById('console-output');
        if (el) el.scrollTop = el.scrollHeight;
    });

    // Watch for output changes and scroll
    document.addEventListener('livewire:update', () => {
        const el = document.getElementById('console-output');
        if (el) el.scrollTop = el.scrollHeight;
    });
</script>
    <?php
        $__output = ob_get_clean();

        \Livewire\store($this)->push('scripts', $__output, $__scriptKey)
    ?>
<?php /**PATH C:\Users\Ahmed Megahed\.gemini\antigravity\scratch\mobivault360\resources\views/livewire/settings/system-update.blade.php ENDPATH**/ ?>