{% extends "base.html" %}

{% block title %}Настройки дайджеста - Домовой Бот{% endblock %}

{% block nav_digest_settings %}active{% endblock %}

{% block extra_style %}
<style>
    .digest-settings-container { max-width: 900px; }
    .digest-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 30px; border-radius: 10px; margin-bottom: 30px; }
    .digest-header h1 { font-size: 2em; margin-bottom: 10px; }
    .digest-back-link { color: white; text-decoration: none; opacity: 0.9; }
    .digest-back-link:hover { opacity: 1; }
    .digest-card { background: white; padding: 25px; border-radius: 10px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
    .digest-card h3 { margin-bottom: 15px; color: #667eea; }
    .digest-form-group { margin-bottom: 20px; }
    .digest-form-group label { display: block; margin-bottom: 5px; font-weight: 500; }
    .digest-form-group input[type="time"], .digest-form-group select { width: 100%; padding: 10px; border: 2px solid #e2e8f0; border-radius: 5px; font-size: 1em; }
    .digest-checkbox-group { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
    .digest-checkbox-group input[type="checkbox"] { width: 20px; height: 20px; }
    .digest-btn { padding: 12px 24px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; background: #667eea; color: white; }
    .digest-btn:hover { background: #5568d3; }
</style>
{% endblock %}

{% block content %}
<div class="digest-settings-container">
    <div class="digest-header">
        <a href="/digests" class="digest-back-link">← Назад к дайджестам</a>
        <h1>⚙️ Настройки дайджеста</h1>
    </div>

    <div class="digest-card">
        <h3>📅 Расписание</h3>
        <div class="digest-form-group">
            <label>Автоматическая генерация</label>
            <div class="digest-checkbox-group">
                <input type="checkbox" id="autoGenerate" checked>
                <label for="autoGenerate">Включено (каждое воскресенье в 19:00)</label>
            </div>
        </div>
        <div class="digest-form-group">
            <label>Время генерации</label>
            <input type="time" value="19:00" disabled>
        </div>
    </div>

    <div class="digest-card">
        <h3>📊 Содержимое дайджеста</h3>
        <div class="digest-checkbox-group">
            <input type="checkbox" id="includeEvents" checked>
            <label for="includeEvents">🔔 События</label>
        </div>
        <div class="digest-checkbox-group">
            <input type="checkbox" id="includePolls" checked>
            <label for="includePolls">📊 Опросы</label>
        </div>
        <div class="digest-checkbox-group">
            <input type="checkbox" id="includeAds" checked>
            <label for="includeAds">📢 Объявления</label>
        </div>
        <div class="digest-checkbox-group">
            <input type="checkbox" id="includeTopUsers" checked>
            <label for="includeTopUsers">🏆 Топ активных жильцов</label>
        </div>
        <div class="digest-checkbox-group">
            <input type="checkbox" id="includeSchedule" checked>
            <label for="includeSchedule">⏰ Запланированные отключения</label>
        </div>
        <div class="digest-checkbox-group">
            <input type="checkbox" id="includeVerifications" checked>
            <label for="includeVerifications">✅ Верификации</label>
        </div>
        <div class="digest-checkbox-group">
            <input type="checkbox" id="includeStats" checked>
            <label for="includeStats">📈 Статистика чата</label>
        </div>
    </div>

    <div class="digest-card">
        <h3>📬 Отправка</h3>
        <div class="digest-checkbox-group">
            <input type="checkbox" id="sendPreview" checked>
            <label for="sendPreview">Отправлять превью админу для утверждения</label>
        </div>
        <div class="digest-checkbox-group">
            <input type="checkbox" id="autoSend">
            <label for="autoSend">Публиковать автоматически (без утверждения)</label>
        </div>
        <div class="digest-checkbox-group">
            <input type="checkbox" id="saveArchive" checked>
            <label for="saveArchive">Сохранять в архив</label>
        </div>
    </div>

    <button class="digest-btn" onclick="saveSettings()">💾 Сохранить настройки</button>
</div>
{% endblock %}

{% block extra_script %}
<script>
function saveSettings() {
    alert('✅ Настройки сохранены!');
}
</script>
{% endblock %}
