using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.UI;
using Unheimlich.Core;
using Unheimlich.Features.DetectiveBoard;
using Unheimlich.Features.Player;
using Unheimlich.World.CameraSystem;
using System.Collections.Generic;
using UnityEngine.EventSystems;
namespace Unheimlich.Features.DetectiveBoard.UI
{
///
/// Handles mouse interaction for the detective board World Space canvas.
/// Manages hover, selection, dragging, and click forwarding for Post-It nodes.
/// Interactions are only active when the board is in inspection mode.
///
public class DetectiveBoardInteraction : Singleton
{
[Header("Settings")]
[SerializeField] private LayerMask _boardLayer;
[SerializeField] private float _minInteractionDistance = 0.1f;
[SerializeField] private float _maxInteractionDistance = 10f;
private Camera _camera;
private Canvas _boardCanvas;
private RectTransform _boardArea;
private DetectiveBoardController _boardController;
private DetectiveBoardCanvas _canvasManager;
private PostItNode _hoveredNode;
private PostItNode _selectedNode;
private ConnectionLine _hoveredLine;
private bool _isDragging;
private Plane _canvasPlane;
private Vector3 _dragOffset;
protected override void OnAwake() { }
private void Start()
{
_boardCanvas = GetComponent