<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="8dp"
    app:cardCornerRadius="8dp"
    app:cardElevation="2dp">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="16dp">

        <TextView
            android:id="@+id/textViewGameVersion"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textAppearance="?attr/textAppearanceSubtitle1"
            android:textColor="@color/tetris_turquoise"
            android:textStyle="bold" 
            tools:text="Tetris (NES)"/>

        <TextView
            android:id="@+id/textViewScore"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textAppearance="?attr/textAppearanceHeadline5"
            android:textColor="@color/tetris_navy"
            android:textStyle="bold"
            tools:text="999,999" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="8dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Date: "
                android:textStyle="bold"
                android:textAppearance="?attr/textAppearanceBody2" />

            <TextView
                android:id="@+id/textViewDate"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textAppearance="?attr/textAppearanceBody2"
                tools:text="03/20/2025" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="4dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Levels: "
                android:textStyle="bold"
                android:textAppearance="?attr/textAppearanceBody2" />

            <TextView
                android:id="@+id/textViewLevelInfo"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textAppearance="?attr/textAppearanceBody2"
                tools:text="18 → 29" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/layoutLinesCleared"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="4dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Lines: "
                android:textStyle="bold"
                android:textAppearance="?attr/textAppearanceBody2" />

            <TextView
                android:id="@+id/textViewLinesCleared"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textAppearance="?attr/textAppearanceBody2"
                tools:text="230" />
        </LinearLayout>

        <!-- Media section -->
        <FrameLayout
            android:id="@+id/mediaContainer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp">

            <!-- Media preview -->
            <androidx.cardview.widget.CardView
                android:id="@+id/cardViewMedia"
                android:layout_width="match_parent"
                android:layout_height="180dp"
                android:visibility="gone"
                app:cardCornerRadius="4dp"
                tools:visibility="visible">

                <!-- ImageView for photos -->
                <ImageView
                    android:id="@+id/imageViewMedia"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:scaleType="centerCrop"
                    android:contentDescription="Score media"
                    android:foreground="?attr/selectableItemBackground" />

                <!-- Video thumbnail with play indicator -->
                <FrameLayout
                    android:id="@+id/videoContainer"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:foreground="?attr/selectableItemBackground"
                    android:visibility="gone">

                    <VideoView
                        android:id="@+id/videoViewMedia"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:visibility="gone" />

                    <ImageView
                        android:id="@+id/imageViewVideoThumbnail"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:scaleType="centerCrop"
                        android:contentDescription="Video thumbnail" />

                    <ImageView
                        android:layout_width="48dp"
                        android:layout_height="48dp"
                        android:layout_gravity="center"
                        android:src="@android:drawable/ic_media_play"
                        android:alpha="0.7"
                        android:contentDescription="Play video" />
                </FrameLayout>

                <!-- Long press hint -->
                <TextView
                    android:id="@+id/textHintLongPress"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom|end"
                    android:text="Long press to remove"
                    android:textSize="10sp"
                    android:textStyle="italic"
                    android:background="#80000000"
                    android:textColor="#FFFFFF"
                    android:padding="4dp"
                    android:layout_margin="4dp" />
            </androidx.cardview.widget.CardView>

            <!-- Media buttons layout -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <!-- Add media button -->
                <com.google.android.material.button.MaterialButton
                    android:id="@+id/buttonAddMedia"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:text="Add Photo/Video"
                    app:icon="@android:drawable/ic_menu_camera"
                    style="@style/Widget.MaterialComponents.Button.OutlinedButton" />

                <!-- Remove media button -->
                <com.google.android.material.button.MaterialButton
                    android:id="@+id/buttonRemoveMedia"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:text="Remove Media"
                    android:visibility="gone"
                    app:icon="@android:drawable/ic_menu_close_clear_cancel"
                    style="@style/Widget.MaterialComponents.Button.OutlinedButton" />
            </LinearLayout>
        </FrameLayout>

    </LinearLayout>

</com.google.android.material.card.MaterialCardView> 