<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Configuración - 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="/dashboard" class="btn btn-outline-light btn-sm me-2">Dashboard</a>
                <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">⚙️ Configuración</h2>
        
        <div class="alert alert-info">
            <i class="bi bi-info-circle"></i> La configuración se lee desde las variables de entorno de Docker.
        </div>
        
        <div class="row">
            <div class="col-md-6">
                <div class="card mb-4">
                    <div class="card-header">
                        <h5 class="mb-0"><i class="bi bi-discord"></i> Tokens de Bots</h5>
                    </div>
                    <div class="card-body">
                        <div class="mb-3">
                            <label class="form-label">Token de Discord</label>
                            <input type="text" class="form-control" 
                                   value="{{ config.discord.token }}" readonly>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">Token de Telegram</label>
                            <input type="text" class="form-control" 
                                   value="{{ config.telegram.token }}" readonly>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">URL de LibreTranslate</label>
                            <input type="text" class="form-control" 
                                   value="{{ config.libretranslate.url }}" readonly>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="col-md-6">
                <div class="card mb-4">
                    <div class="card-header">
                        <h5 class="mb-0"><i class="bi bi-globe"></i> Panel Web</h5>
                    </div>
                    <div class="card-body">
                        <div class="mb-3">
                            <label class="form-label">Usuario admin</label>
                            <input type="text" class="form-control" 
                                   value="{{ config.web.admin_username }}" readonly>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">Host</label>
                            <input type="text" class="form-control" 
                                   value="{{ config.web.host }}" readonly>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">Puerto</label>
                            <input type="number" class="form-control" 
                                   value="{{ config.web.port }}" readonly>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-6">
                <div class="card mb-4">
                    <div class="card-header">
                        <h5 class="mb-0"><i class="bi bi-database"></i> Base de Datos</h5>
                    </div>
                    <div class="card-body">
                        <div class="mb-3">
                            <label class="form-label">Tipo de Base de Datos</label>
                            <input type="text" class="form-control" 
                                   value="{{ config.database.type|upper }}" readonly>
                        </div>
                        
                        {% if config.database.type == 'mysql' %}
                        <div class="mb-3">
                            <label class="form-label">Host MySQL</label>
                            <input type="text" class="form-control" 
                                   value="{{ config.database.host }}" readonly>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">Puerto MySQL</label>
                            <input type="number" class="form-control" 
                                   value="{{ config.database.port }}" readonly>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">Usuario MySQL</label>
                            <input type="text" class="form-control" 
                                   value="{{ config.database.user }}" readonly>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">Nombre de Base de Datos</label>
                            <input type="text" class="form-control" 
                                   value="{{ config.database.name }}" readonly>
                        </div>
                        {% else %}
                        <div class="mb-3">
                            <label class="form-label">Ruta de la base de datos</label>
                            <input type="text" class="form-control" 
                                   value="{{ config.database.path }}" readonly>
                        </div>
                        {% endif %}
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
