{% extends "layouts/admin.twig" %}

{% block title %}{{ ta.security|default('Beveiliging') }} - {{ ta.admin_title|default('CodePress Admin') }}{% endblock %}

{% block content %}
<h2 class="mb-4"><i class="bi bi-shield-check"></i> {{ ta.security_bots|default('Beveiliging & Bot Bescherming') }}</h2>

<form method="POST" action="/admin/security">
    <input type="hidden" name="csrf_token" value="{{ csrf_token }}">
    
    <div class="card shadow-sm mb-4">
        <div class="card-header">{{ ta.bot_protection|default('Bot Bescherming') }}</div>
        <div class="card-body">
            <div class="form-check form-switch mb-3">
                <input class="form-check-input" type="checkbox" id="botguard_enabled" name="botguard_enabled" {{ config.security.botguard_enabled ?? true ? 'checked' : '' }}>
                <label class="form-check-label" for="botguard_enabled">{{ ta.botguard_enabled|default('BotGuard ingeschakeld') }}</label>
            </div>
            <div class="form-check form-switch mb-3">
                <input class="form-check-input" type="checkbox" id="block_bad_bots" name="block_bad_bots" {{ config.security.block_bad_bots ?? true ? 'checked' : '' }}>
                <label class="form-check-label" for="block_bad_bots">{{ ta.block_bad_bots|default('Blokkeer slechte bots') }}</label>
            </div>
        </div>
    </div>
    
    <div class="card shadow-sm mb-4">
        <div class="card-header">{{ ta.session_settings|default('Sessie Instellingen') }}</div>
        <div class="card-body">
            <div class="mb-3">
                <label for="session_timeout" class="form-label">{{ ta.session_timeout|default('Sessie timeout (seconden)') }}</label>
                <input type="number" class="form-control" id="session_timeout" name="session_timeout" value="{{ config.security.session_timeout ?? 3600 }}">
            </div>
            <div class="mb-3">
                <label for="max_login_attempts" class="form-label">{{ ta.max_login_attempts|default('Maximale login pogingen') }}</label>
                <input type="number" class="form-control" id="max_login_attempts" name="max_login_attempts" value="{{ config.security.max_login_attempts ?? 5 }}">
            </div>
        </div>
    </div>
    
    <button type="submit" class="btn btn-primary">
        <i class="bi bi-check-lg"></i> {{ ta.save|default('Opslaan') }}
    </button>
    <a href="/admin/dashboard" class="btn btn-outline-secondary">{{ ta.cancel|default('Annuleren') }}</a>
</form>
{% endblock %}