Electrocardiogram (ECG) analysis is crucial for diagnosing cardiovascular diseases (CVD), especially atrial fibrillation (AF), a prevalent cardiac rhythm abnormality. However, the variability and complexity of ECG signals make AF classification challenging, highlighting the need for more accurate and reliable methods. This paper introduces a novel deep learning (DL) architecture designed to enhance the processing, feature extraction, and analysis of ECG signals. The proposed model utilizes a hybrid framework that combines standard and dilated convolutional networks, advanced attention mechanisms, and temporal sequence learning to address the complexities of ECG data. A parallel architecture integrates a MobileViT block for efficient spatial feature extraction and an Efficient Channel Attention (ECA) module to refine feature representations. Simultaneously, a Long Short-Term Memory (LSTM) network captures temporal dependencies in the data. The concatenation of the outputs from both the MobileViT-ECA block and the LSTM network allows for the extraction of both local and global features. Fully connected layers, along with dropout regularization, ensure robust performance and effective classification. We analyzed ECG signals of three different lengths (1, 2, and 3 seconds) to investigate how segment length affects model performance. Additionally, we conducted various classification scenarios and an ablation study to simulate real-world conditions and identify key components of the architecture. Our experimental findings show that the model attains high accuracy in ECG classification and AF identification, with average metrics including accuracy of 87.80%, recall of 87.80%, F1-score of 87.45%, and specificity of 95.66%. The proposed model outperforms existing methods on the same AF dataset, demonstrating its superior performance. This method accurately classifies ECG signals and detects AF, highlighting its potential for clinical application. The results help move forward the development of automated tools for diagnosing heart diseases and create new opportunities for flexible solutions in this field. © 2025 Elsevier B.V., All rights reserved.