<?php
// phpcs:ignoreFile
if ( ! defined( 'ABSPATH' ) ) { exit; }

$current_user = wp_get_current_user();
?>
<div class="lc-card">
    <div class="lc-card-header">
        <span class="lc-section-number">2</span>
        <h3><?php esc_html_e( 'Connect Your AI Client', 'lolacore' ); ?></h3>
    </div>
    
    <div class="lc-mcp-cred-form__step">
        <p class="description" style="margin-bottom: 12px;">
            <?php esc_html_e( 'Create an Application Password to let your MCP client authenticate safely.', 'lolacore' ); ?>
            <a href="<?php echo esc_url( admin_url( 'profile.php#application-passwords-section' ) ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Manage Application Passwords &rarr;', 'lolacore' ); ?></a>
        </p>
        
        <table class="form-table lc-form-table">
            <tr>
                <th scope="row"><label for="lc-mcp-username"><?php esc_html_e( 'Username', 'lolacore' ); ?></label></th>
                <td><input type="text" id="lc-mcp-username" class="lc-input" value="<?php echo esc_attr( $current_user->user_login ); ?>" readonly></td>
            </tr>
            <tr>
                <th scope="row"><label for="lc-mcp-app-password"><?php esc_html_e( 'Application Password', 'lolacore' ); ?></label></th>
                <td><input type="password" id="lc-mcp-app-password" class="lc-input" placeholder="xxxx xxxx xxxx xxxx xxxx xxxx"></td>
            </tr>
        </table>
        
        <div style="margin-top: 16px;">
            <button type="button" id="lc-mcp-generate-configs" class="lc-action-btn primary">
                <?php esc_html_e( 'Generate Configs', 'lolacore' ); ?>
            </button>
        </div>
    </div>
</div>
