<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Dashboard - Bots de Traducción</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css">
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container-fluid">
            <a class="navbar-brand" href="/dashboard">
                <i class="bi bi-translate"></i> Bots de Traducción
            </a>
            <div class="d-flex">
                <a href="/logout" class="btn btn-outline-light btn-sm">Cerrar Sesión</a>
            </div>
        </div>
    </nav>

    <div class="container mt-5">
        <h2 class="mb-4">📊 Dashboard</h2>
        
        <div class="row">
            <div class="col-md-4">
                <div class="card text-white bg-primary mb-3">
                    <div class="card-body">
                        <h5 class="card-title"><i class="bi bi-discord"></i> Discord</h5>
                        <p class="card-text">Bot de traducción para servidores de Discord</p>
                        <a href="/config" class="btn btn-light btn-sm">Configurar</a>
                    </div>
                </div>
            </div>
            
            <div class="col-md-4">
                <div class="card text-white bg-info mb-3">
                    <div class="card-body">
                        <h5 class="card-title"><i class="bi bi-telegram"></i> Telegram</h5>
                        <p class="card-text">Bot de traducción para grupos de Telegram</p>
                        <a href="/config" class="btn btn-light btn-sm">Configurar</a>
                    </div>
                </div>
            </div>
            
            <div class="col-md-4">
                <div class="card text-white bg-success mb-3">
                    <div class="card-body">
                        <h5 class="card-title"><i class="bi bi-globe"></i> Idiomas</h5>
                        <p class="card-text">Administrar idiomas disponibles</p>
                        <a href="/languages" class="btn btn-light btn-sm">Administrar</a>
                    </div>
                </div>
            </div>
        </div>

        <div class="card mt-4">
            <div class="card-header">
                <h5 class="mb-0">📋 Estado de Configuración</h5>
            </div>
            <div class="card-body">
                <table class="table table-striped">
                    <tr>
                        <th>Token Discord</th>
                        <td>{{ '✅ Configurado' if config.discord.token and config.discord.token != 'TU_DISCORD_BOT_TOKEN' else '❌ No configurado' }}</td>
                    </tr>
                    <tr>
                        <th>Token Telegram</th>
                        <td>{{ '✅ Configurado' if config.telegram.token and config.telegram.token != 'TU_TELEGRAM_BOT_TOKEN' else '❌ No configurado' }}</td>
                    </tr>
                    <tr>
                        <th>LibreTranslate URL</th>
                        <td>{{ config.libretranslate.url if config.libretranslate.url else '❌ No configurado' }}</td>
                    </tr>
                    <tr>
                        <th>Idiomas activos</th>
                        <td>{{ config.languages.enabled|length }} idiomas</td>
                    </tr>
                    <tr>
                        <th>Tipo de Base de Datos</th>
                        <td>{{ config.database.type|upper }}</td>
                    </tr>
                    {% if config.database.type == 'mysql' %}
                    <tr>
                        <th>Host MySQL</th>
                        <td>{{ config.database.host }}:{{ config.database.port }}</td>
                    </tr>
                    <tr>
                        <th>Base de Datos</th>
                        <td>{{ config.database.name }}</td>
                    </tr>
                    <tr>
                        <th>Usuario MySQL</th>
                        <td>{{ config.database.user }}</td>
                    </tr>
                    {% else %}
                    <tr>
                        <th>Ruta SQLite</th>
                        <td>{{ config.database.path }}</td>
                    </tr>
                    {% endif %}
                </table>
            </div>
        </div>
    </div>
</body>
</html>
