A serious problem facing power systems today is the deterioration of power quality (PQ), driven mainly by the widespread use of non-linear loads, such as power electronic converters and adjustable-speed drives. These loads inject harmonic currents into the network, resulting in voltage distortion, increased losses, overheating, and reduced system efficiency. Therefore, harmonic mitigation and reactive power compensation are necessary to ensure stable and reliable operation. This paper presents the development of a Shunt Active Power Filter (SAPF) to become an intelligent Shunt Active Power Filter Conditioner (SAPFC) that operates under different loading conditions (linear, non-linear, or mixed). As a result, a conventional PI controller is upgraded with a Fuzzy Gain Scheduling (FGS) technique optimized by the Whale Optimization Algorithm (WOA) in order to keep the DC-link capacitor voltage stable. In addition, an adaptive instantaneous dq theory is used to produce accurate reference currents. The proposed intelligent SAPFC is implemented and validated in MATLAB-Simulink, where simulation results show maximizing the SAPFC's effectiveness in minimizing harmonic distortion to less than 0.7% and achieving a near-unity power factor under different operating conditions. The integrated SAPFC, with its intelligent control, offers a robust and adaptive solution for improving power quality in modern electrical systems, thereby increasing efficiency and reducing power losses.