<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

$current_provider = SftcyWordaiBase::sc_wordai_get_current_ai_provider();
$wordai_header_logo_url = SFTCY_WORDAI_PLUGIN_URL . 'admin/css/images/wordai-2026-icon.svg';
$wordai_docs_base_url = defined( 'SFTCY_WORDAI_DOCS_BASE_URL' ) && SFTCY_WORDAI_DOCS_BASE_URL
	? SFTCY_WORDAI_DOCS_BASE_URL
	: 'https://softcoy.com/docs';
$wordai_docs_base_url = esc_url_raw( $wordai_docs_base_url );
if ( '' === $wordai_docs_base_url ) {
	$wordai_docs_base_url = 'https://softcoy.com/docs';
}
$wordai_current_page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '';
$wordai_docs_map     = array(
	'word-ai-topmenu'                 => 'wordai-pro-api-settings',
	'sc-wordai-content-settings'      => 'wordai-pro-content-settings',
	'sc-wordai-image-settings'        => 'wordai-pro-image-settings',
	'sc-wordai-seo-scan'              => 'wordai-pro-seo-scan-ai-auto-fix',
	'sc-wordai-search-console'        => 'wordai-pro-search-console-reports',
	'sc-wordai-ai-agent-settings'     => 'wordai-pro-ai-agent',
	'sc-wordai-support'               => 'wordai-pro-support',
	'wordai-license'                  => 'wordai-pro-license',
	'wordai-get-pro'                  => 'wordai-pro-get-pro',
);
$wordai_docs_slug = isset( $wordai_docs_map[ $wordai_current_page ] ) ? $wordai_docs_map[ $wordai_current_page ] : 'wordai-pro-overview';
$wordai_docs_url  = trailingslashit( $wordai_docs_base_url ) . $wordai_docs_slug;
// Previous header logo: SFTCY_WORDAI_PLUGIN_URL . 'admin/css/images/wordai-light-50x50.svg'
?>

<!-- ================================
     WORDAI GLOBAL PAGE HEADER
================================ -->
<div class="wrap sc-wordai-admin-header">

    <!-- Left Section: Logo + Title -->
    <div class="sc-wordai-header-left">
        <img 
            src="<?php echo esc_url( $wordai_header_logo_url ); ?>"
            alt="WordAI Logo" 
            class="sc-wordai-header-logo"
        />

        <span class="sc-wordai-header-title" aria-label="WordAI">
            <span class="sc-wordai-header-title-word">Word</span><span class="sc-wordai-header-title-ai">AI</span>
        </span>
    </div>

    <!-- Right Section: AI Provider Selection -->
    <div class="sc-wordai-header-right">
        <!-- <label for="sc-wordai-ai-provider" class="sc-wordai-provider-label">
            <i class="dashicons dashicons-share-alt"></i>
            AI Provider
        </label>

        <div class="sc-wordai-select-wrapper">
        <select 
            id="sc-wordai-ai-provider"
            name="sc-wordai-ai-provider"
            class="sc-wordai-provider-select"
            aria-label="Select AI Provider"
            data-provider="<?php //echo esc_attr( $current_provider ); ?>"
        >
            <option value="openai" <?php //selected( $current_provider, 'openai' ); ?>>
                OpenAI
            </option>

            <option value="google" <?php //selected( $current_provider, 'google' ); ?>>
                Google Gemini
            </option>
        </select>
        </div> -->

        <a class="sc-wordai-docs-link" href="<?php echo esc_url( $wordai_docs_url ); ?>" target="_blank" rel="noopener">
            <span class="dashicons dashicons-media-document" aria-hidden="true"></span>
            <?php esc_html_e( 'Documentation', defined( 'SFTCY_WORDAI_TEXT_DOMAIN' ) ? SFTCY_WORDAI_TEXT_DOMAIN : 'wordai-pro' ); ?>
        </a>


        <?php
            SftcyWordaiBase::sc_wordai_render_provider_selector([
                'id'      => 'sc-wordai-ai-provider',
                'context' => 'settings_header',
            ]);
        ?>
        
    </div>

</div>
<!-- END: WORDAI HEADER -->



