<?php
/**
 * Global Data Hub admin view.
 *
 * @package Noesia_Smart_Waiter
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

$noesia_swa_gdh_settings         = $service->get_settings();
$noesia_swa_gdh_countries        = $service->get_country_options();
$noesia_swa_gdh_compare_defaults = $service->get_compare_default_country_codes();
?>
<section class="noesia-swa-gdh" data-gdh-root="1" data-ajax-url="<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>" data-nonce="<?php echo esc_attr( wp_create_nonce( 'noesia_swa_nonce' ) ); ?>">
    <header class="noesia-swa-gdh__hero">
        <div class="noesia-swa-gdh__hero-copy">
            <span class="noesia-swa-gdh__eyebrow"><?php esc_html_e( 'Strict Official Country Statistics', 'noesia-smart-waiter' ); ?></span>
            <h2><?php esc_html_e( 'Global Data Hub', 'noesia-smart-waiter' ); ?></h2>
            <p><?php esc_html_e( 'This build uses official provider APIs only. Tourism stays on Eurostat, World Bank stays pinned to WDI, Digital / Connectivity stays pinned to fixed WDI ICT indicators, Population & Society stays pinned to fixed World Bank demographic and social indicators, IMF Macro stays pinned to IMF DataMapper, OECD Insights stays pinned to fixed OECD Data Explorer selections, Health stays pinned to exact WHO GHO indicators, and Medical Evidence stays pinned to PubMed plus ClinicalTrials.gov. Each tab keeps its source boundaries explicit.', 'noesia-smart-waiter' ); ?></p>
        </div>
        <div class="noesia-swa-gdh__hero-actions">
            <button type="button" class="button button-secondary noesia-swa-gdh__button noesia-swa-gdh__button--ghost" data-gdh-refresh="1"><?php esc_html_e( 'Refresh Official Data', 'noesia-smart-waiter' ); ?></button>
            <span class="noesia-swa-gdh__status" data-gdh-status="hero"><?php esc_html_e( 'Ready', 'noesia-smart-waiter' ); ?></span>
        </div>
    </header>

    <div class="noesia-swa-gdh__provider-strip">
        <span class="noesia-swa-gdh__provider-pill">Eurostat</span>
        <span class="noesia-swa-gdh__provider-pill">World Bank WDI</span>
        <span class="noesia-swa-gdh__provider-pill">IMF DataMapper</span>
        <span class="noesia-swa-gdh__provider-pill">OECD Data Explorer</span>
        <span class="noesia-swa-gdh__provider-pill">WHO GHO</span>
        <span class="noesia-swa-gdh__provider-pill">PubMed</span>
        <span class="noesia-swa-gdh__provider-pill">ClinicalTrials.gov</span>
        <span class="noesia-swa-gdh__provider-pill"><?php esc_html_e( 'Strict mode', 'noesia-smart-waiter' ); ?></span>
    </div>

    <div class="noesia-swa-gdh__overview" data-gdh-overview="1">
        <article class="noesia-swa-gdh__metric-card"><span><?php esc_html_e( 'Country Scope', 'noesia-smart-waiter' ); ?></span><strong>—</strong><small><?php esc_html_e( 'Loading…', 'noesia-smart-waiter' ); ?></small></article>
        <article class="noesia-swa-gdh__metric-card"><span><?php esc_html_e( 'Source Stack', 'noesia-smart-waiter' ); ?></span><strong>—</strong><small><?php esc_html_e( 'Loading…', 'noesia-smart-waiter' ); ?></small></article>
        <article class="noesia-swa-gdh__metric-card"><span><?php esc_html_e( 'Refresh Window', 'noesia-smart-waiter' ); ?></span><strong>—</strong><small><?php esc_html_e( 'Loading…', 'noesia-smart-waiter' ); ?></small></article>
        <article class="noesia-swa-gdh__metric-card"><span><?php esc_html_e( 'Official Arrivals', 'noesia-smart-waiter' ); ?></span><strong>—</strong><small><?php esc_html_e( 'Loading…', 'noesia-smart-waiter' ); ?></small></article>
        <article class="noesia-swa-gdh__metric-card"><span><?php esc_html_e( 'Official Occupancy', 'noesia-smart-waiter' ); ?></span><strong>—</strong><small><?php esc_html_e( 'Loading…', 'noesia-smart-waiter' ); ?></small></article>
    </div>

    <nav class="noesia-swa-gdh__tabs" aria-label="<?php esc_attr_e( 'Global Data Hub tabs', 'noesia-smart-waiter' ); ?>">
        <button type="button" class="is-active" data-gdh-tab-target="tourism"><?php esc_html_e( 'Tourism', 'noesia-smart-waiter' ); ?></button>
        <button type="button" data-gdh-tab-target="development"><?php esc_html_e( 'World Bank', 'noesia-smart-waiter' ); ?></button>
        <button type="button" data-gdh-tab-target="imf-macro"><?php esc_html_e( 'IMF Macro', 'noesia-smart-waiter' ); ?></button>
        <button type="button" data-gdh-tab-target="oecd-insights"><?php esc_html_e( 'OECD Insights', 'noesia-smart-waiter' ); ?></button>
        <button type="button" data-gdh-tab-target="health"><?php esc_html_e( 'Health', 'noesia-smart-waiter' ); ?></button>
        <button type="button" data-gdh-tab-target="digital-connectivity"><?php esc_html_e( 'Digital / Connectivity', 'noesia-smart-waiter' ); ?></button>
        <button type="button" data-gdh-tab-target="population-society"><?php esc_html_e( 'Population & Society', 'noesia-smart-waiter' ); ?></button>
        <button type="button" data-gdh-tab-target="compare-countries"><?php esc_html_e( 'Compare Countries', 'noesia-smart-waiter' ); ?></button>
        <button type="button" data-gdh-tab-target="medical-evidence"><?php esc_html_e( 'Medical Evidence', 'noesia-smart-waiter' ); ?></button>
        <button type="button" data-gdh-tab-target="sources-methodology"><?php esc_html_e( 'Sources & Methodology', 'noesia-smart-waiter' ); ?></button>
        <button type="button" data-gdh-tab-target="settings"><?php esc_html_e( 'Settings', 'noesia-smart-waiter' ); ?></button>
    </nav>

    <div class="noesia-swa-gdh__panels">
        <div class="noesia-swa-gdh__panel is-active" data-gdh-tab="tourism">
            <div class="noesia-swa-gdh__grid noesia-swa-gdh__grid--tourism">
                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Strict Tourism Overview', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'Eurostat tourism is shown with clear separation between accommodation arrivals, accommodation nights, and hotel occupancy. Arrivals and nights are split by guest origin when the official series provides it.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div class="noesia-swa-gdh__cards-inline" data-gdh-tourism-cards="1"></div>
                    <div class="noesia-swa-gdh__notice" data-gdh-tourism-note="1"><?php esc_html_e( 'Loading official tourism summary…', 'noesia-smart-waiter' ); ?></div>
                </article>

                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Official Arrivals', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'Source dataset: tour_occ_arm. This panel shows accommodation arrivals only and never border arrivals.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div data-gdh-dataset="arrivals"></div>
                </article>

                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Official Nights Spent', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'Source dataset: tour_occ_nim. Only official accommodation nights are shown, split by guest origin when available.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div data-gdh-dataset="nights"></div>
                </article>

                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Official Occupancy Rate', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'Source dataset: tour_occ_mnor. Hotel occupancy stays separate from arrivals and nights; bed-places and bedrooms are shown separately when the official series provides both.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div data-gdh-dataset="occupancy"></div>
                </article>
            </div>
        </div>



        <div class="noesia-swa-gdh__panel" data-gdh-tab="development">
            <div class="noesia-swa-gdh__grid">
                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Strict World Bank Overview', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'This layer is pinned to World Bank WDI source 2 and uses only fixed official indicator codes grouped into clear domains.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div class="noesia-swa-gdh__cards-inline" data-gdh-development-cards="1"></div>
                    <div class="noesia-swa-gdh__notice" data-gdh-development-note="1"><?php esc_html_e( 'Open the World Bank tab to load official WDI indicators…', 'noesia-smart-waiter' ); ?></div>
                </article>

                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'World Bank WDI indicator deck', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'Only fixed official indicators are shown in this build: population, life expectancy, urban population, GDP, GDP per capita, trade, unemployment, internet users, access to electricity, and carbon emissions per capita. Digital and connectivity indicators now live in their own dedicated tab.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div data-gdh-development-indicators="1"><?php esc_html_e( 'Open the World Bank tab to load official indicators…', 'noesia-smart-waiter' ); ?></div>
                </article>
            </div>
        </div>


        <div class="noesia-swa-gdh__panel" data-gdh-tab="imf-macro">
            <div class="noesia-swa-gdh__grid">
                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Strict IMF Macro Overview', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'This layer uses only fixed IMF DataMapper WEO indicator codes. No mixed providers and no inferred substitutions are used.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div class="noesia-swa-gdh__cards-inline" data-gdh-imf-cards="1"></div>
                    <div class="noesia-swa-gdh__notice" data-gdh-imf-note="1"><?php esc_html_e( 'Open the IMF Macro tab to load official IMF macro indicators…', 'noesia-smart-waiter' ); ?></div>
                </article>

                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'IMF World Economic Outlook indicators', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'Fixed official indicator codes only: GDP growth, inflation, unemployment, current account balance, and general government gross debt.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div data-gdh-imf-indicators="1"><?php esc_html_e( 'Open the IMF Macro tab to load official IMF indicators…', 'noesia-smart-waiter' ); ?></div>
                </article>
            </div>
        </div>

        <div class="noesia-swa-gdh__panel" data-gdh-tab="oecd-insights">
            <div class="noesia-swa-gdh__grid">
                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Strict OECD Insights Overview', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'This first OECD stage is intentionally labour-and-activity focused. It uses only fixed OECD Data Explorer SDMX selections for unemployment, youth unemployment, employment, and labour force participation.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div class="noesia-swa-gdh__cards-inline" data-gdh-oecd-cards="1"></div>
                    <div class="noesia-swa-gdh__notice" data-gdh-oecd-note="1"><?php esc_html_e( 'Open the OECD Insights tab to load official OECD indicators…', 'noesia-smart-waiter' ); ?></div>
                </article>

                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'OECD labour and activity indicators', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'Only fixed OECD Data Explorer selections are enabled in this stage. Broader OECD domains can be added later once their country coverage and selection rules are verified the same way.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div data-gdh-oecd-indicators="1"><?php esc_html_e( 'Open the OECD Insights tab to load official OECD indicators…', 'noesia-smart-waiter' ); ?></div>
                </article>
            </div>
        </div>



        <div class="noesia-swa-gdh__panel" data-gdh-tab="health">
            <div class="noesia-swa-gdh__grid">
                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Strict WHO Health Overview', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'This first Health stage is pinned to exact WHO Global Health Observatory indicator titles. It is focused on UHC, mortality, and health expenditure only.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div class="noesia-swa-gdh__cards-inline" data-gdh-health-cards="1"></div>
                    <div class="noesia-swa-gdh__notice" data-gdh-health-note="1"><?php esc_html_e( 'Open the Health tab to load official WHO indicators…', 'noesia-smart-waiter' ); ?></div>
                </article>

                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'WHO Global Health Observatory indicator deck', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'Only fixed WHO health indicators are enabled in this stage: UHC service coverage, maternal mortality, under-five mortality, neonatal mortality, current health expenditure as % of GDP, and government health expenditure per capita.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div data-gdh-health-indicators="1"><?php esc_html_e( 'Open the Health tab to load official WHO indicators…', 'noesia-smart-waiter' ); ?></div>
                </article>
            </div>
        </div>

        <div class="noesia-swa-gdh__panel" data-gdh-tab="digital-connectivity">
            <div class="noesia-swa-gdh__grid">
                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Strict Digital / Connectivity Overview', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'This stage is pinned to World Bank WDI source 2 and uses only fixed ICT indicator codes. The cards stay explicit about whether the metadata points to ITU or another official source.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div class="noesia-swa-gdh__cards-inline" data-gdh-digital-cards="1"></div>
                    <div class="noesia-swa-gdh__notice" data-gdh-digital-note="1"><?php esc_html_e( 'Open the Digital / Connectivity tab to load official ICT indicators…', 'noesia-smart-waiter' ); ?></div>
                </article>

                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Digital and connectivity indicator deck', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'Only fixed official ICT indicators are enabled in this stage: internet users, mobile cellular subscriptions, fixed broadband subscriptions, secure Internet servers, and male/female Internet usage rates where the official series is available.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div data-gdh-digital-indicators="1"><?php esc_html_e( 'Open the Digital / Connectivity tab to load official ICT indicators…', 'noesia-smart-waiter' ); ?></div>
                </article>
            </div>
        </div>

        <div class="noesia-swa-gdh__panel" data-gdh-tab="population-society">
            <div class="noesia-swa-gdh__grid">
                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Strict Population & Society Overview', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'This stage is pinned to World Bank WDI source 2 and uses only fixed demographic and social indicator codes. It is intentionally separate from the broader World Bank deck and from Health.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div class="noesia-swa-gdh__cards-inline" data-gdh-population-cards="1"></div>
                    <div class="noesia-swa-gdh__notice" data-gdh-population-note="1"><?php esc_html_e( 'Open the Population & Society tab to load official demographic indicators…', 'noesia-smart-waiter' ); ?></div>
                </article>

                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Population and society indicator deck', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'Only fixed official World Bank demographic and social indicators are enabled in this stage: population growth, age structure, age dependency, fertility, crude birth rate, female population share, international migrant stock, and rural population share.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div data-gdh-population-indicators="1"><?php esc_html_e( 'Open the Population & Society tab to load official demographic indicators…', 'noesia-smart-waiter' ); ?></div>
                </article>
            </div>
        </div>


        <div class="noesia-swa-gdh__panel" data-gdh-tab="compare-countries">
            <div class="noesia-swa-gdh__grid">
                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Strict Compare Countries', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'This comparison deck reuses only fixed official metrics that are already enabled elsewhere in Global Data Hub. No fuzzy matches, derived rankings, or mixed-source substitutions are used.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div class="noesia-swa-gdh__settings-grid">
                        <label>
                            <span><?php esc_html_e( 'Primary country', 'noesia-smart-waiter' ); ?></span>
                            <select data-gdh-compare-country="0">
                                <?php foreach ( $noesia_swa_gdh_countries as $noesia_swa_gdh_country_code => $noesia_swa_gdh_country_label ) : ?>
                                    <option value="<?php echo esc_attr( $noesia_swa_gdh_country_code ); ?>" <?php selected( isset( $noesia_swa_gdh_compare_defaults[0] ) ? $noesia_swa_gdh_compare_defaults[0] : '', $noesia_swa_gdh_country_code ); ?>><?php echo esc_html( $noesia_swa_gdh_country_label ); ?></option>
                                <?php endforeach; ?>
                            </select>
                        </label>
                        <?php for ( $noesia_swa_gdh_compare_index = 1; $noesia_swa_gdh_compare_index < 4; $noesia_swa_gdh_compare_index++ ) : ?>
                            <label>
                                <span><?php
                                /* translators: %d: comparison country slot number. */
                                echo esc_html( sprintf( __( 'Compare country %d', 'noesia-smart-waiter' ), $noesia_swa_gdh_compare_index ) );
                                ?></span>
                                <select data-gdh-compare-country="<?php echo esc_attr( (string) $noesia_swa_gdh_compare_index ); ?>">
                                    <option value=""><?php esc_html_e( 'None', 'noesia-smart-waiter' ); ?></option>
                                    <?php foreach ( $noesia_swa_gdh_countries as $noesia_swa_gdh_country_code => $noesia_swa_gdh_country_label ) : ?>
                                        <option value="<?php echo esc_attr( $noesia_swa_gdh_country_code ); ?>" <?php selected( isset( $noesia_swa_gdh_compare_defaults[ $noesia_swa_gdh_compare_index ] ) ? $noesia_swa_gdh_compare_defaults[ $noesia_swa_gdh_compare_index ] : '', $noesia_swa_gdh_country_code ); ?>><?php echo esc_html( $noesia_swa_gdh_country_label ); ?></option>
                                    <?php endforeach; ?>
                                </select>
                            </label>
                        <?php endfor; ?>
                    </div>
                    <div class="noesia-swa-gdh__button-row">
                        <button type="button" class="button button-primary noesia-swa-gdh__button" data-gdh-compare-load="1"><?php esc_html_e( 'Load Comparison', 'noesia-smart-waiter' ); ?></button>
                    </div>
                    <div class="noesia-swa-gdh__cards-inline" data-gdh-compare-cards="1"></div>
                    <div class="noesia-swa-gdh__notice" data-gdh-compare-note="1"><?php esc_html_e( 'Open the Compare Countries tab to load the strict comparison deck…', 'noesia-smart-waiter' ); ?></div>
                </article>

                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Official comparison deck', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'Only fixed official metrics are compared in this first stage: Eurostat hotel occupancy, World Bank GDP per capita, life expectancy, and Internet users, plus IMF real GDP growth and inflation. Each row keeps its own latest reference period instead of forcing countries into fake synchronized dates.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div data-gdh-compare-results="1"><?php esc_html_e( 'Open the Compare Countries tab to load official comparisons…', 'noesia-smart-waiter' ); ?></div>
                </article>
            </div>
        </div>

        <div class="noesia-swa-gdh__panel" data-gdh-tab="medical-evidence">
            <div class="noesia-swa-gdh__grid">
                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Strict Medical Evidence Search', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'Search stays inside the app. Loco translates the interface only. PubMed and ClinicalTrials.gov record content stays in the official returned language. Official source pages open in a new tab only when the user chooses to open them.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div class="noesia-swa-gdh__settings-grid">
                        <label>
                            <span><?php esc_html_e( 'Medical topic', 'noesia-smart-waiter' ); ?></span>
                            <input type="text" value="" placeholder="vitamin B depression" data-gdh-medical-query="1" />
                        </label>
                    </div>
                    <div class="noesia-swa-gdh__button-row">
                        <button type="button" class="button button-primary noesia-swa-gdh__button" data-gdh-medical-search="1"><?php esc_html_e( 'Search Medical Evidence', 'noesia-smart-waiter' ); ?></button>
                    </div>
                    <div class="noesia-swa-gdh__cards-inline" data-gdh-medical-cards="1"></div>
                    <div class="noesia-swa-gdh__notice" data-gdh-medical-note="1"><?php esc_html_e( 'Enter a medical topic to search official PubMed and ClinicalTrials.gov records…', 'noesia-smart-waiter' ); ?></div>
                </article>

                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'PubMed evidence results', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'Articles stay inside the app as a readable result list. Open official source opens the PubMed record in a new tab.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div data-gdh-medical-pubmed="1"><?php esc_html_e( 'Run a medical evidence search to load PubMed results…', 'noesia-smart-waiter' ); ?></div>
                </article>

                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'ClinicalTrials.gov registry results', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'This section shows official trial registry records, status, phase, sponsor, and a short study summary when returned by the official API.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div data-gdh-medical-trials="1"><?php esc_html_e( 'Run a medical evidence search to load ClinicalTrials.gov records…', 'noesia-smart-waiter' ); ?></div>
                </article>
            </div>
        </div>

        <div class="noesia-swa-gdh__panel" data-gdh-tab="sources-methodology">
            <div class="noesia-swa-gdh__grid">
                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Sources & Methodology', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'This tab explains exactly what the current build shows, which official providers are active, how strict selection works, and when the app intentionally hides a value instead of guessing.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div class="noesia-swa-gdh__cards-inline">
                        <article class="noesia-swa-gdh__mini-card"><span><?php esc_html_e( 'Source policy', 'noesia-smart-waiter' ); ?></span><strong><?php esc_html_e( 'Official only', 'noesia-smart-waiter' ); ?></strong><small><?php esc_html_e( 'No synthetic or estimated values are introduced by this plugin layer.', 'noesia-smart-waiter' ); ?></small></article>
                        <article class="noesia-swa-gdh__mini-card"><span><?php esc_html_e( 'Failure policy', 'noesia-smart-waiter' ); ?></span><strong><?php esc_html_e( 'Fail closed', 'noesia-smart-waiter' ); ?></strong><small><?php esc_html_e( 'Ambiguous, unsupported, or unreadable series are hidden instead of being approximated.', 'noesia-smart-waiter' ); ?></small></article>
                        <article class="noesia-swa-gdh__mini-card"><span><?php esc_html_e( 'Compare policy', 'noesia-smart-waiter' ); ?></span><strong><?php esc_html_e( 'No fake harmonization', 'noesia-smart-waiter' ); ?></strong><small><?php esc_html_e( 'Each country keeps its own latest official reference period for every metric.', 'noesia-smart-waiter' ); ?></small></article>
                        <article class="noesia-swa-gdh__mini-card"><span><?php esc_html_e( 'Cache policy', 'noesia-smart-waiter' ); ?></span><strong><?php esc_html_e( 'Transient based', 'noesia-smart-waiter' ); ?></strong><small><?php esc_html_e( 'Responses are cached by country and layer to reduce API load and avoid unstable repeated pulls.', 'noesia-smart-waiter' ); ?></small></article>
                    </div>
                    <div class="noesia-swa-gdh__notice is-info">
                        <strong><?php esc_html_e( 'Methodology note', 'noesia-smart-waiter' ); ?></strong>
                        <p><?php esc_html_e( 'Global Data Hub keeps source boundaries explicit. Eurostat tourism never mixes with border-arrival interpretations. World Bank WDI indicators stay separate from IMF macro indicators. OECD labour indicators stay separate from World Bank labour indicators. WHO health indicators stay separate from all other health or demographic sources.', 'noesia-smart-waiter' ); ?></p>
                    </div>
                </article>

                <article class="noesia-swa-gdh__card">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Active official providers', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'These are the official providers currently active in this build.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <ul class="noesia-swa-gdh__source-list">
                        <li><strong>Eurostat</strong> — <?php esc_html_e( 'Official tourism accommodation datasets only.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>World Bank WDI</strong> — <?php esc_html_e( 'Official fixed indicators for development, digital, and population layers.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>IMF DataMapper / WEO</strong> — <?php esc_html_e( 'Official fixed macroeconomic indicators only.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>OECD Data Explorer</strong> — <?php esc_html_e( 'Official fixed labour and activity selections only.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>WHO GHO</strong> — <?php esc_html_e( 'Official fixed health indicators only.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>PubMed</strong> — <?php esc_html_e( 'Official biomedical literature search via NCBI E-utilities.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>ClinicalTrials.gov</strong> — <?php esc_html_e( 'Official clinical study registry search with separate study-record handling.', 'noesia-smart-waiter' ); ?></li>
                    </ul>
                </article>

                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-3">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Approved dataset and indicator deck', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'Only the following exact datasets and indicator codes are approved in the current build.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div class="noesia-swa-gdh__grid">
                        <article class="noesia-swa-gdh__card">
                            <div class="noesia-swa-gdh__card-head"><div><h3><?php esc_html_e( 'Tourism', 'noesia-smart-waiter' ); ?></h3><p><?php esc_html_e( 'Eurostat accommodation tourism only.', 'noesia-smart-waiter' ); ?></p></div></div>
                            <ul class="noesia-swa-gdh__source-list">
                                <li><strong>tour_occ_arm</strong> — <?php esc_html_e( 'Arrivals at tourist accommodation establishments.', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>tour_occ_nim</strong> — <?php esc_html_e( 'Nights spent at tourist accommodation establishments.', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>tour_occ_mnor</strong> — <?php esc_html_e( 'Net occupancy rate of bed-places and bedrooms in hotels and similar accommodation.', 'noesia-smart-waiter' ); ?></li>
                            </ul>
                        </article>
                        <article class="noesia-swa-gdh__card">
                            <div class="noesia-swa-gdh__card-head"><div><h3><?php esc_html_e( 'World Bank', 'noesia-smart-waiter' ); ?></h3><p><?php esc_html_e( 'Development, digital, and population indicators pinned to WDI.', 'noesia-smart-waiter' ); ?></p></div></div>
                            <ul class="noesia-swa-gdh__source-list">
                                <li><strong>SP.POP.TOTL</strong> — <?php esc_html_e( 'Population, total.', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>SP.DYN.LE00.IN</strong> — <?php esc_html_e( 'Life expectancy at birth, total (years).', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>NY.GDP.PCAP.CD</strong> — <?php esc_html_e( 'GDP per capita (current US$).', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>IT.NET.USER.ZS</strong> — <?php esc_html_e( 'Individuals using the Internet (% of population).', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>IT.CEL.SETS.P2</strong> — <?php esc_html_e( 'Mobile cellular subscriptions (per 100 people).', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>IT.NET.BBND.P2</strong> — <?php esc_html_e( 'Fixed broadband subscriptions (per 100 people).', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>IT.NET.SECR.P6</strong> — <?php esc_html_e( 'Secure Internet servers (per 1 million people).', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>SP.POP.GROW</strong> — <?php esc_html_e( 'Population growth (annual %).', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>SP.POP.0014.TO.ZS</strong> — <?php esc_html_e( 'Population ages 0-14 (% of total population).', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>SP.POP.65UP.TO.ZS</strong> — <?php esc_html_e( 'Population ages 65 and above (% of total population).', 'noesia-smart-waiter' ); ?></li>
                            </ul>
                        </article>
                        <article class="noesia-swa-gdh__card">
                            <div class="noesia-swa-gdh__card-head"><div><h3><?php esc_html_e( 'IMF / OECD / WHO', 'noesia-smart-waiter' ); ?></h3><p><?php esc_html_e( 'Fixed official codes and selections only.', 'noesia-smart-waiter' ); ?></p></div></div>
                            <ul class="noesia-swa-gdh__source-list">
                                <li><strong>NGDP_RPCH</strong> — <?php esc_html_e( 'IMF real GDP growth.', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>PCPIPCH</strong> — <?php esc_html_e( 'IMF inflation rate.', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>LUR</strong> — <?php esc_html_e( 'IMF unemployment rate.', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>DSD_LFS@DF_IALFS_INDIC</strong> — <?php esc_html_e( 'OECD labour and activity selections.', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>UHC service coverage index</strong> — <?php esc_html_e( 'WHO GHO exact indicator title matching.', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>MDG_0000000007</strong> — <?php esc_html_e( 'WHO under-five mortality rate.', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>WHOSIS_000003</strong> — <?php esc_html_e( 'WHO neonatal mortality rate.', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>PubMed / NCBI E-utilities</strong> — <?php esc_html_e( 'Internal medical evidence search with article metadata and abstract snippets when the official record provides them.', 'noesia-smart-waiter' ); ?></li>
                                <li><strong>ClinicalTrials.gov API</strong> — <?php esc_html_e( 'Internal trial registry search with status, phase, sponsor, and official study links.', 'noesia-smart-waiter' ); ?></li>
                            </ul>
                        </article>
                    </div>
                </article>

                <article class="noesia-swa-gdh__card">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Compare Countries methodology', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'The comparison deck intentionally stays small and reuses only metrics that are already active elsewhere in the hub.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <ul class="noesia-swa-gdh__source-list">
                        <li><?php esc_html_e( 'Eurostat hotel occupancy rate', 'noesia-smart-waiter' ); ?></li>
                        <li><?php esc_html_e( 'World Bank GDP per capita', 'noesia-smart-waiter' ); ?></li>
                        <li><?php esc_html_e( 'World Bank life expectancy', 'noesia-smart-waiter' ); ?></li>
                        <li><?php esc_html_e( 'World Bank Internet users', 'noesia-smart-waiter' ); ?></li>
                        <li><?php esc_html_e( 'IMF real GDP growth', 'noesia-smart-waiter' ); ?></li>
                        <li><?php esc_html_e( 'IMF inflation rate', 'noesia-smart-waiter' ); ?></li>
                    </ul>
                </article>

                <article class="noesia-swa-gdh__card">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Planned next layers', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'These layers are approved conceptually but are not active in this build yet.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <ul class="noesia-swa-gdh__source-list">
                        <li><strong>EPA</strong> — <?php esc_html_e( 'US-focused environment, facilities, or compliance data as a separate strict tab.', 'noesia-smart-waiter' ); ?></li>
                    </ul>
                </article>
            </div>
        </div>

        <div class="noesia-swa-gdh__panel" data-gdh-tab="settings">
            <div class="noesia-swa-gdh__grid">
                <article class="noesia-swa-gdh__card noesia-swa-gdh__card--span-2">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Strict Hub Settings', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'Select only a supported Eurostat country and a cache refresh window. Unsupported countries are intentionally not listed.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <div class="noesia-swa-gdh__settings-grid">
                        <label>
                            <span><?php esc_html_e( 'Country', 'noesia-smart-waiter' ); ?></span>
                            <select data-gdh-setting="country_code">
                                <?php foreach ( $noesia_swa_gdh_countries as $noesia_swa_gdh_country_code => $noesia_swa_gdh_country_label ) : ?>
                                    <option value="<?php echo esc_attr( $noesia_swa_gdh_country_code ); ?>" <?php selected( $noesia_swa_gdh_settings['country_code'], $noesia_swa_gdh_country_code ); ?>><?php echo esc_html( $noesia_swa_gdh_country_label ); ?></option>
                                <?php endforeach; ?>
                            </select>
                        </label>
                        <label>
                            <span><?php esc_html_e( 'Refresh hours', 'noesia-smart-waiter' ); ?></span>
                            <input type="number" min="1" max="72" value="<?php echo esc_attr( (string) $noesia_swa_gdh_settings['refresh_hours'] ); ?>" data-gdh-setting="refresh_hours" />
                        </label>
                    </div>
                    <div class="noesia-swa-gdh__button-row">
                        <button type="button" class="button button-primary noesia-swa-gdh__button" data-gdh-save="1"><?php esc_html_e( 'Save Settings', 'noesia-smart-waiter' ); ?></button>
                    </div>
                    <div class="noesia-swa-gdh__notice is-info">
                        <strong><?php esc_html_e( 'Strict source policy', 'noesia-smart-waiter' ); ?></strong>
                        <p><?php esc_html_e( 'This build keeps every tab strict: Eurostat tourism stays on official accommodation datasets, World Bank stays pinned to WDI, Digital / Connectivity stays pinned to fixed WDI ICT indicators, Population & Society stays pinned to fixed World Bank demographic and social indicators, IMF Macro stays pinned to fixed IMF indicators, OECD Insights stays pinned to fixed OECD Data Explorer selections, and Health stays pinned to exact WHO GHO indicators, and Medical Evidence stays pinned to PubMed plus ClinicalTrials.gov. Unsupported or ambiguous series are hidden instead of being approximated or replaced.', 'noesia-smart-waiter' ); ?></p>
                    </div>
                </article>

                <article class="noesia-swa-gdh__card">
                    <div class="noesia-swa-gdh__card-head">
                        <div>
                            <h3><?php esc_html_e( 'Included dataset codes', 'noesia-smart-waiter' ); ?></h3>
                            <p><?php esc_html_e( 'Only these fixed official dataset codes and indicators are enabled in this build.', 'noesia-smart-waiter' ); ?></p>
                        </div>
                    </div>
                    <ul class="noesia-swa-gdh__source-list">
                        <li><strong>tour_occ_arm</strong> — <?php esc_html_e( 'Arrivals at tourist accommodation establishments - monthly data.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>tour_occ_nim</strong> — <?php esc_html_e( 'Nights spent at tourist accommodation establishments - monthly data.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>tour_occ_mnor</strong> — <?php esc_html_e( 'Net occupancy rate of bed-places and bedrooms in hotels and similar accommodation.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>SP.POP.TOTL</strong> — <?php esc_html_e( 'Population, total.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>SP.DYN.LE00.IN</strong> — <?php esc_html_e( 'Life expectancy at birth, total (years).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>SP.URB.TOTL.IN.ZS</strong> — <?php esc_html_e( 'Urban population (% of total population).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>NY.GDP.MKTP.CD</strong> — <?php esc_html_e( 'GDP (current US$).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>NY.GDP.PCAP.CD</strong> — <?php esc_html_e( 'GDP per capita (current US$).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>NE.TRD.GNFS.ZS</strong> — <?php esc_html_e( 'Trade (% of GDP).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>SL.UEM.TOTL.ZS</strong> — <?php esc_html_e( 'Unemployment, total (% of total labor force) (modeled ILO estimate).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>IT.NET.USER.ZS</strong> — <?php esc_html_e( 'Individuals using the Internet (% of population).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>EG.ELC.ACCS.ZS</strong> — <?php esc_html_e( 'Access to electricity (% of population).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>EN.GHG.CO2.PC.CE.AR5</strong> — <?php esc_html_e( 'Carbon dioxide emissions from fuel combustion and cement production (metric tons per capita).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>IT.CEL.SETS.P2</strong> — <?php esc_html_e( 'Mobile cellular subscriptions (per 100 people).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>IT.NET.BBND.P2</strong> — <?php esc_html_e( 'Fixed broadband subscriptions (per 100 people).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>IT.NET.SECR.P6</strong> — <?php esc_html_e( 'Secure Internet servers (per 1 million people).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>IT.NET.USER.FE.ZS</strong> — <?php esc_html_e( 'Individuals using the Internet, female (% of female population).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>IT.NET.USER.MA.ZS</strong> — <?php esc_html_e( 'Individuals using the Internet, male (% of male population).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>SP.POP.GROW</strong> — <?php esc_html_e( 'Population growth (annual %).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>SP.POP.0014.TO.ZS</strong> — <?php esc_html_e( 'Population ages 0-14 (% of total population).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>SP.POP.1564.TO.ZS</strong> — <?php esc_html_e( 'Population ages 15-64 (% of total population).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>SP.POP.65UP.TO.ZS</strong> — <?php esc_html_e( 'Population ages 65 and above (% of total population).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>SP.POP.DPND</strong> — <?php esc_html_e( 'Age dependency ratio (% of working-age population).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>SP.DYN.TFRT.IN</strong> — <?php esc_html_e( 'Fertility rate, total (births per woman).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>SP.DYN.CBRT.IN</strong> — <?php esc_html_e( 'Birth rate, crude (per 1,000 people).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>SP.POP.TOTL.FE.ZS</strong> — <?php esc_html_e( 'Population, female (% of total population).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>SM.POP.TOTL.ZS</strong> — <?php esc_html_e( 'International migrant stock (% of population).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>SP.RUR.TOTL.ZS</strong> — <?php esc_html_e( 'Rural population (% of total population).', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>NGDP_RPCH</strong> — <?php esc_html_e( 'Real GDP growth, annual percent change.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>PCPIPCH</strong> — <?php esc_html_e( 'Inflation rate, average consumer prices, annual percent change.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>LUR</strong> — <?php esc_html_e( 'Unemployment rate, percent of total labor force.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>BCA_NGDPD</strong> — <?php esc_html_e( 'Current account balance, percent of GDP.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>GGXWDG_NGDP</strong> — <?php esc_html_e( 'General government gross debt, percent of GDP.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>DSD_LFS@DF_IALFS_UNE_M</strong> — <?php esc_html_e( 'OECD monthly unemployment rate selections for total and youth unemployment.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>DSD_LFS@DF_IALFS_EMP_WAP_Q</strong> — <?php esc_html_e( 'OECD quarterly employment rate selection for ages 15 to 64.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>DSD_LFS@DF_IALFS_LF_WAP_Q</strong> — <?php esc_html_e( 'OECD quarterly labour force participation selection for ages 15 to 64.', 'noesia-smart-waiter' ); ?></li>
                        <li><strong>WHO GHO exact indicator titles</strong> — <?php esc_html_e( 'UHC service coverage index, maternal mortality ratio, under-five mortality rate, neonatal mortality rate, current health expenditure as % of GDP, and domestic general government health expenditure per capita.', 'noesia-smart-waiter' ); ?></li>
                    </ul>
                </article>
            </div>
        </div>
    </div>
</section>
