<?php
/**
 * Enqueues admin CSS on Conflict Radar screens and the dashboard (for the widget).
 * No JS is required for the Phase 4 display-only UI.
 *
 * @package ConflictRadar\Admin
 */

declare( strict_types=1 );

namespace ConflictRadar\Admin;

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

class Assets {

	public function register(): void {
		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
	}

	public function enqueue(): void {
		$screen = get_current_screen();
		if ( ! $screen ) {
			return;
		}

		$on_cr_screen   = false !== strpos( $screen->id, 'conflict-radar' );
		$on_dashboard   = 'dashboard' === $screen->id; // index.php — hosts the widget.

		if ( ! $on_cr_screen && ! $on_dashboard ) {
			return;
		}

		wp_enqueue_style(
			'conflict-radar-admin',
			CONFLICT_RADAR_URL . 'assets/css/admin.css',
			array(),
			CONFLICT_RADAR_VERSION
		);
	}
}
