from PyQt5.QtWidgets import QFrame, QVBoxLayout, QLabel
from PyQt5.QtCore import Qt

def create_canvas_area(parent):
    """Create the canvas area for video display"""
    try:
        # Create frame container for canvas
        canvas_frame = QFrame(parent)
        canvas_frame.setStyleSheet("border: 1px solid gray; background: black; border-radius: 20px;")
        canvas_frame.setFixedSize(900, 750)
        canvas_layout = QVBoxLayout(canvas_frame)
        canvas_layout.setContentsMargins(10, 10, 10, 10)

        # Create label for video display
        canvas_label = QLabel()
        canvas_label.setAlignment(Qt.AlignCenter)
        canvas_label.setStyleSheet("border: none; background: transparent;")
        canvas_label.setMinimumSize(880, 730)  # Set minimum size to ensure proper display
        canvas_layout.addWidget(canvas_label)

        return canvas_frame, canvas_label
    except Exception as e:
        print(f"Error in create_canvas_area: {e}")
        return QFrame(parent), QLabel(parent)