<?php
/**
 * diagnose_tools.php
 * Übersichtsseite für System-Diagnose-Tools
 */

// Backend config laden (enthält requireBackendAccess)
require_once '../backend/config.php';
requireBackendAccess();

$pageTitle = 'Diagnose-Tools';

// Backend Header & Sidebar
include '../backend/layout/header.php';
?>

<!-- Main Content -->
<main class="backend-main">

<style>
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.tool-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.tool-icon {
    font-size: 64px;
    margin-bottom: 15px;
    display: block;
}

.tool-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.tool-description {
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.5;
}

.tool-card.system { border-top: 4px solid #3498db; }
.tool-card.backup { border-top: 4px solid #2ecc71; }
.tool-card.cache { border-top: 4px solid #e74c3c; }
.tool-card.version { border-top: 4px solid #f39c12; }

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}
</style>

<div class="content-header">
    <h1>🛠️ Diagnose-Tools</h1>
    <p>Werkzeuge zur System-Überwachung und Fehlerbehebung</p>
</div>

<div class="tools-grid">
    <!-- System-Info -->
    <a href="system_diagnose.php" class="tool-card system">
        <span class="tool-icon">🔍</span>
        <div class="tool-title">System-Info</div>
        <div class="tool-description">
            PHP-Version, Datenbank-Status, Upload-Verzeichnis und Dateiberechtigungen prüfen
        </div>
    </a>

    <!-- Backup-Info -->
    <a href="backup_diagnose.php" class="tool-card backup">
        <span class="tool-icon">💾</span>
        <div class="tool-title">Backup-Info</div>
        <div class="tool-description">
            Vorhandene Backups anzeigen, Größen prüfen und Backup-Verzeichnis analysieren
        </div>
    </a>

    <!-- Cache leeren -->
    <a href="clear_cache.php" class="tool-card cache">
        <span class="tool-icon">🗑️</span>
        <div class="tool-title">Cache leeren</div>
        <div class="tool-description">
            PHP OpCache zurücksetzen - nützlich wenn Updates nicht sofort wirken
        </div>
    </a>

    <!-- Version Check -->
    <a href="version_check.php" class="tool-card version">
        <span class="tool-icon">🔄</span>
        <div class="tool-title">Version-Check</div>
        <div class="tool-description">
            Prüfen welche Datei-Versionen auf dem Server laufen und ob Updates korrekt hochgeladen wurden
        </div>
    </a>
</div>

<a href="../backend/index.php" class="back-link">← Zurück zum Dashboard</a>

</main>
<!-- End Main Content -->

<?php include '../backend/layout/footer.php'; ?>
