Consider the code below. 
I want to make the 'Start' button Green instead of Red and blinking when symbol name is entered.

# gui.py

import sys
from PyQt5.QtWidgets import (
    QApplication, QWidget, QVBoxLayout, QLabel, QPushButton,
    QFileDialog, QLineEdit, QMessageBox, QTextEdit, QHBoxLayout,
    QButtonGroup, QTableWidget, QTableWidgetItem
)
from PyQt5.QtCore import Qt, QThread, pyqtSignal, QTimer
from PyQt5.QtGui import QFont, QPalette, QColor, QIcon
from main import multi_stock_prediction
from config import START_DATE, END_DATE, INTERVAL
from utils import setup_logging, log_message
import os
import pandas as pd  # Added for saving predictions

class WorkerThread(QThread):
    # Define custom signals
    progress = pyqtSignal(str)
    finished = pyqtSignal(dict)
    
    def __init__(self, stock_symbols, start_date, end_date, interval, train_mode):
        super().__init__()
        self.stock_symbols = stock_symbols
        self.start_date = start_date
        self.end_date = end_date
        self.interval = interval
        self.train_mode = train_mode
        self.predictions = {}
    
    def run(self):
        log_message("WorkerThread started.")
        self.predictions = multi_stock_prediction(
            self.stock_symbols, 
            self.start_date, 
            self.end_date, 
            self.interval, 
            self.train_mode,
            progress_callback=self.emit_progress
        )
        self.finished.emit(self.predictions)
        log_message("WorkerThread finished.")
    
    def emit_progress(self, message: str):
        self.progress.emit(message)

class StockPredictionApp(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("Stock Prediction Application")
        self.setGeometry(100, 100, 800, 700)  # Adjusted height for better layout
        self.init_ui()
        self.worker = None

    def init_ui(self):
        self.layout = QVBoxLayout()
        
        self.step_labels = []
        # Step 1: Mode Selection
        self.create_mode_selection()
        
        # Step 2: Stock Input
        self.create_stock_input()
        
        # Step 3: Display Models
        self.create_model_display()
        
        # Start Button
        self.create_start_button()
        
        # Progress Display
        self.create_progress_display()
        
        # Prediction Output
        self.create_output_display()
        
        # Set Layout
        self.setLayout(self.layout)
        
        # Initialize blinking steps
        self.current_step = 0
        self.start_blinking()

    def create_mode_selection(self):
        mode_layout = QHBoxLayout()
        mode_label = QLabel("Select Mode:")
        mode_label.setFont(QFont('Arial', 14, QFont.Bold))
        
        # Mode Buttons
        self.mode_group = QButtonGroup(self)
        self.train_button = QPushButton("TRAIN")
        self.use_button = QPushButton("USE")
        
        # Make buttons checkable
        self.train_button.setCheckable(True)
        self.use_button.setCheckable(True)
        
        # Set fixed sizes for better aesthetics
        self.train_button.setFixedSize(150, 60)
        self.use_button.setFixedSize(150, 60)
        
        # Set fonts
        self.train_button.setFont(QFont('Arial', 16, QFont.Bold))
        self.use_button.setFont(QFont('Arial', 16, QFont.Bold))
        
        # Apply stylesheets for TRAIN button
        self.train_button.setStyleSheet("""
            QPushButton {
                background-color: grey;
                color: white;
                border-radius: 15px;
                font-size: 16px;
                border: 2px solid grey;
            }
            QPushButton:hover {
                background-color: lightgrey;
            }
            QPushButton:checked {
                background-color: green;
                border: 2px solid green;
            }
        """)
        
        # Apply stylesheets for USE button
        self.use_button.setStyleSheet("""
            QPushButton {
                background-color: grey;
                color: white;
                border-radius: 15px;
                font-size: 16px;
                border: 2px solid grey;
            }
            QPushButton:hover {
                background-color: lightgrey;
            }
            QPushButton:checked {
                background-color: green;
                border: 2px solid green;
            }
        """)
        
        self.mode_group.addButton(self.train_button)
        self.mode_group.addButton(self.use_button)

        self.mode_group.buttonClicked.connect(self.on_mode_selected)

        mode_layout.addWidget(mode_label)
        mode_layout.addWidget(self.train_button)
        mode_layout.addWidget(self.use_button)
        self.layout.addLayout(mode_layout)
        
        # Blinking message for mode selection
        self.mode_blink_label = QLabel("Please select a mode to proceed.")
        self.mode_blink_label.setFont(QFont('Arial', 14))
        self.layout.addWidget(self.mode_blink_label)
        self.step_labels.append(self.mode_blink_label)

    def create_stock_input(self):
        stock_layout = QHBoxLayout()
        stock_label = QLabel("Stock Symbols (comma-separated):")
        stock_label.setFont(QFont('Arial', 14))
        self.stock_input = QLineEdit()
        self.stock_input.setPlaceholderText("e.g., AAPL, GOOGL, MSFT")
        self.stock_input.setDisabled(True)
        stock_layout.addWidget(stock_label)
        stock_layout.addWidget(self.stock_input)
        self.layout.addLayout(stock_layout)
        
        # Connect textChanged and returnPressed signals to state handler
        self.stock_input.textChanged.connect(self.set_start_button_state)
        self.stock_input.returnPressed.connect(self.handle_return_pressed)  # Handle 'Enter' key
        
        # Or Load from File
        file_layout = QHBoxLayout()
        self.load_button = QPushButton("Load Stocks from File")
        self.load_button.setDisabled(True)
        self.load_button.clicked.connect(self.load_stocks_from_file)
        self.load_button.setFixedSize(200, 40)
        self.load_button.setFont(QFont('Arial', 12, QFont.Bold))
        self.load_button.setStyleSheet("""
            QPushButton {
                background-color: #FF9800;
                color: white;
                border-radius: 10px;
                font-size: 14px;
            }
            QPushButton:hover {
                background-color: #FB8C00;
            }
            QPushButton:disabled {
                background-color: gray;
            }
        """)
        file_layout.addWidget(self.load_button)
        self.layout.addLayout(file_layout)
        
        # Blinking message for stock input
        self.stock_blink_label = QLabel("Enter stock symbols or load from a file.")
        self.stock_blink_label.setFont(QFont('Arial', 14))
        self.layout.addWidget(self.stock_blink_label)
        self.step_labels.append(self.stock_blink_label)

    def create_model_display(self):
        # Model Selection (Display)
        model_layout = QVBoxLayout()
        model_label = QLabel("Available Models and Parameters:")
        model_label.setFont(QFont('Arial', 16, QFont.Bold))
        self.model_text = QTextEdit()
        self.model_text.setReadOnly(True)
        self.display_models()
        self.model_text.setFont(QFont('Arial', 12))
        model_layout.addWidget(model_label)
        model_layout.addWidget(self.model_text)
        self.layout.addLayout(model_layout)

    def create_start_button(self):
        self.start_button = QPushButton("START")
        self.start_button.setDisabled(True)
        self.start_button.clicked.connect(self.start_process)
        self.start_button.setFixedSize(200, 60)
        self.start_button.setFont(QFont('Arial', 18, QFont.Bold))
        self.start_button.setStyleSheet("""
            QPushButton {
                background-color: #FF5722;
                color: white;
                border-radius: 30px;
                font-size: 18px;
            }
            QPushButton:hover {
                background-color: #E64A19;
            }
            QPushButton:disabled {
                background-color: gray;
            }
        """)
        self.layout.addWidget(self.start_button, alignment=Qt.AlignCenter)

    def create_progress_display(self):
        progress_label = QLabel("Progress:")
        progress_label.setFont(QFont('Arial', 16, QFont.Bold))
        self.progress_text = QTextEdit()
        self.progress_text.setReadOnly(True)
        self.progress_text.setFont(QFont('Arial', 12))
        self.layout.addWidget(progress_label)
        self.layout.addWidget(self.progress_text)

    def create_output_display(self):
        output_label = QLabel("Final Predictions:")
        output_label.setFont(QFont('Arial', 16, QFont.Bold))  # Increased font size
        self.output_table = QTableWidget()
        self.output_table.setColumnCount(2)
        self.output_table.setHorizontalHeaderLabels(["Symbol", "Predicted Price"])
        self.output_table.horizontalHeader().setStretchLastSection(True)
        self.output_table.setFont(QFont('Arial', 12))
        self.output_table.setStyleSheet("""
            QTableWidget {
                background-color: #f0f0f0;
                gridline-color: #d3d3d3;
            }
            QHeaderView::section {
                background-color: #4CAF50;
                color: white;
                padding: 4px;
                border: 1px solid #d3d3d3;
                font-size: 14px;
            }
        """)
        self.layout.addWidget(output_label)
        self.layout.addWidget(self.output_table)

    def start_blinking(self):
        # Set up a timer for blinking effect
        self.blink_timer = QTimer()
        self.blink_timer.timeout.connect(self.blink_label)
        self.blink_state = False
        self.blink_timer.start(500)  # Blink every 500 ms

    def blink_label(self):
        # Blink only the current step label
        for i, label in enumerate(self.step_labels):
            if i == self.current_step:
                palette = label.palette()
                if self.blink_state:
                    palette.setColor(QPalette.WindowText, Qt.red)
                else:
                    palette.setColor(QPalette.WindowText, Qt.black)
                label.setPalette(palette)
            else:
                # Ensure other labels are in default state
                palette = label.palette()
                palette.setColor(QPalette.WindowText, Qt.black)
                label.setPalette(palette)
        self.blink_state = not self.blink_state

    def on_mode_selected(self):
        # When a mode is selected, enable the stock input
        self.stock_input.setDisabled(False)
        self.load_button.setDisabled(False)
        self.current_step = 1  # Move to next step

    def display_models(self):
        models_info = """
Available Models:

1. LSTM
   - Layers: 2 LSTM layers (50 units each), 2 Dense layers
   - Optimizer: Adam
   - Loss: Mean Squared Error
   - Epochs: 100
   - Batch Size: 64

2. XGBoost
   - n_estimators: 100
   - learning_rate: 0.1
   - max_depth: 5

3. Random Forest
   - n_estimators: 100
   - max_depth: None
   - min_samples_split: 2

4. Linear Regression
   - No hyperparameters
"""
        self.model_text.setText(models_info)

    def load_stocks_from_file(self):
        options = QFileDialog.Options()
        filename, _ = QFileDialog.getOpenFileName(
            self, "Select Stock List File", "", 
            "Text Files (*.txt);;CSV Files (*.csv);;All Files (*)", 
            options=options
        )
        if filename:
            try:
                ext = os.path.splitext(filename)[1]
                if ext.lower() == '.txt':
                    with open(filename, 'r') as file:
                        stocks = file.read().splitlines()
                else:
                    df = pd.read_csv(filename)
                    stocks = df.iloc[:, 0].tolist()
                self.stock_input.setText(','.join(stocks))
                log_message(f"Loaded stocks from file: {filename}")
                self.set_start_button_state()  # Enable 'START' button if symbols are loaded
            except Exception as e:
                QMessageBox.critical(self, "Error", f"Failed to load file: {e}")

    def set_start_button_state(self):
        stock_text = self.stock_input.text().strip()
        if stock_text:
            self.start_button.setDisabled(False)
        else:
            self.start_button.setDisabled(True)
    
    def handle_return_pressed(self):
        if not self.start_button.isEnabled():
            QMessageBox.information(self, "Information", "Please enter valid stock symbols to enable the Start button.")
        else:
            self.start_process()

    def start_process(self):
        stock_text = self.stock_input.text().strip()
        if not stock_text:
            QMessageBox.warning(self, "Input Error", "Please enter at least one stock symbol.")
            return
        stock_symbols = [s.strip() for s in stock_text.split(',') if s.strip()]
        if not stock_symbols:
            QMessageBox.warning(self, "Input Error", "Please enter valid stock symbols.")
            return

        # Determine mode
        mode = ""
        if self.train_button.isChecked():
            mode = 'train'
        elif self.use_button.isChecked():
            mode = 'use'
        else:
            QMessageBox.warning(self, "Input Error", "Please select a mode.")
            return

        # Disable UI elements during processing
        self.start_button.setDisabled(True)
        self.progress_text.clear()
        self.output_table.setRowCount(0)  # Clear previous predictions
        self.stock_input.setDisabled(True)
        self.load_button.setDisabled(True)
        self.train_button.setDisabled(True)
        self.use_button.setDisabled(True)
        # Stop blinking
        self.blink_timer.stop()
        # Start Worker Thread
        self.worker = WorkerThread(stock_symbols, START_DATE, END_DATE, INTERVAL, mode)
        self.worker.progress.connect(self.update_progress)
        self.worker.finished.connect(self.process_finished)
        self.worker.start()
        log_message("Started processing in WorkerThread.")

    def update_progress(self, message: str):
        self.progress_text.append(message)

    def process_finished(self, predictions: dict):
        self.output_table.setRowCount(0)  # Clear existing rows
        for stock, predicted_price in predictions.items():
            row_position = self.output_table.rowCount()
            self.output_table.insertRow(row_position)

            # Symbol
            symbol_item = QTableWidgetItem(stock)
            symbol_item.setTextAlignment(Qt.AlignCenter)
            self.output_table.setItem(row_position, 0, symbol_item)

            # Predicted Price
            predicted_item = QTableWidgetItem(f"{predicted_price:.2f}")
            predicted_item.setTextAlignment(Qt.AlignCenter)
            self.output_table.setItem(row_position, 1, predicted_item)

        # Adjust Column Widths
        self.output_table.resizeColumnsToContents()

        # Save predictions to CSV
        if predictions:
            data_to_save = []
            for stock, pred_price in predictions.items():
                data_to_save.append({
                    'Symbol': stock,
                    'Predicted Price': pred_price
                })
            pred_df = pd.DataFrame(data_to_save)
            # Ensure 'models' directory exists
            os.makedirs('models', exist_ok=True)
            try:
                pred_df.to_csv(os.path.join('models', 'predictions.csv'), index=False)
                log_message("Saved predictions to predictions.csv")
            except Exception as e:
                log_message(f"Error saving predictions: {e}")
                QMessageBox.critical(self, "Error", f"Failed to save predictions: {e}")
        # Re-enable UI elements
        self.start_button.setDisabled(False)
        self.stock_input.setDisabled(False)
        self.load_button.setDisabled(False)
        self.train_button.setDisabled(False)
        self.use_button.setDisabled(False)
        # Restart blinking for new session
        self.current_step = 0
        self.blink_timer.start(500)
        log_message("Processing completed.")
        QMessageBox.information(self, "Success", "Stock predictions completed successfully.")

if __name__ == "__main__":
    # Initialize logging before launching the GUI
    from utils import setup_logging
    setup_logging()
    
    app = QApplication(sys.argv)
    window = StockPredictionApp()
    window.show()
    sys.exit(app.exec_())