<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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="match_parent">

    <!-- Main content buttons and text -->
    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <!-- Back button -->
        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            android:visibility="gone"
            android:id="@+id/back_button_container">

            <ImageView
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:importantForAccessibility="no"
                android:src="@drawable/button_shadow"
                app:layout_constraintBottom_toBottomOf="@id/back_button"
                app:layout_constraintEnd_toEndOf="@id/back_button"
                app:layout_constraintStart_toStartOf="@id/back_button"
                app:layout_constraintTop_toTopOf="@id/back_button"
                app:tint="@color/black"
                tools:ignore="ImageContrastCheck" />

            <com.google.android.material.button.MaterialButton
                android:id="@+id/back_button"
                style="@style/Widget.Material3.Button.IconButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="8dp"
                android:contentDescription="@string/cd_button_back"
                app:backgroundTint="@color/transparent"
                app:icon="@drawable/ic_back_nav"
                app:iconSize="24dp"
                app:iconTint="@android:color/white"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:rippleColor="@color/ripple" />
        </androidx.constraintlayout.widget.ConstraintLayout>

        <!-- Title section -->
        <LinearLayout
            android:id="@+id/title_section"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="12dp"
            android:layout_marginBottom="16dp"
            android:orientation="vertical"
            app:layout_constrainedWidth="true"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/buttons_section"
            app:layout_constraintStart_toStartOf="parent">

            <!-- Channel info row -->
            <LinearLayout
                android:id="@+id/channel_info"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="?android:attr/selectableItemBackground"
                android:clickable="true"
                android:focusable="true"
                android:gravity="center_vertical"
                android:minWidth="48dp"
                android:orientation="horizontal"
                android:paddingVertical="8dp">

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content">

                    <com.futo.platformplayer.views.others.CreatorThumbnail
                        android:id="@+id/creator_thumbnail"
                        android:layout_width="32dp"
                        android:layout_height="32dp"
                        android:contentDescription="@string/cd_creator_thumbnail"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                    <com.futo.platformplayer.views.platform.PlatformIndicator
                        android:id="@+id/short_platform_indicator"
                        android:layout_width="16dp"
                        android:layout_height="16dp"
                        android:layout_marginStart="-12dp"
                        android:layout_marginBottom="-12dp"
                        android:background="@drawable/rounded_square_outline"
                        android:clipToOutline="true"
                        app:layout_constraintBottom_toTopOf="@id/creator_thumbnail"
                        app:layout_constraintStart_toEndOf="@id/creator_thumbnail" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <TextView
                    android:id="@+id/channel_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="8dp"
                    android:paddingHorizontal="4dp"
                    android:shadowColor="@android:color/black"
                    android:shadowRadius="8"
                    android:text=""
                    android:textColor="@android:color/white"
                    android:textSize="14sp" />
            </LinearLayout>

            <!-- Video title -->
            <TextView
                android:id="@+id/video_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="4dp"
                android:ellipsize="end"
                android:maxLines="1"
                android:paddingHorizontal="4dp"
                android:shadowColor="@android:color/black"
                android:shadowRadius="8"
                android:text=""
                android:textColor="@android:color/white"
                android:textSize="14sp" />
            <TextView
                android:id="@+id/video_subtitle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="4dp"
                android:ellipsize="end"
                android:maxLines="1"
                android:paddingHorizontal="4dp"
                android:shadowColor="@android:color/black"
                android:shadowRadius="8"
                android:text=""
                android:textColor="#CCC"
                android:textSize="14sp" />
        </LinearLayout>

        <!-- Buttons section -->
        <LinearLayout
            android:id="@+id/buttons_section"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="4dp"
            android:layout_marginBottom="16dp"
            android:orientation="vertical"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent">

            <!-- Like button -->
            <com.futo.platformplayer.views.buttons.ShortsButton
                android:id="@+id/like_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:checkable="true"
                android:contentDescription="@string/cd_image_like_icon"
                app:backgroundTint="@color/transparent"
                app:buttonIcon_s="@drawable/ic_thumb_up_s"
                app:iconSize="24dp"
                app:iconTint="@android:color/white"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:rippleColor="@color/ripple"
                app:toggleCheckedStateOnClick="false" />

            <!-- Dislike button -->
            <com.futo.platformplayer.views.buttons.ShortsButton
                android:id="@+id/dislike_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20dp"
                android:checkable="true"
                android:contentDescription="@string/cd_image_dislike_icon"
                app:backgroundTint="@color/transparent"
                app:buttonIcon_s="@drawable/ic_thumb_down_s"
                app:iconSize="24dp"
                app:iconTint="@android:color/white"
                app:rippleColor="@color/ripple"
                app:toggleCheckedStateOnClick="false" />

            <!-- Comments button -->
            <com.futo.platformplayer.views.buttons.ShortsButton
                android:id="@+id/comments_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20dp"
                android:contentDescription="@string/comments"
                app:buttonIcon_s="@drawable/ic_comment_s"
                app:buttonText_s=""
                app:iconSize="24dp"
                app:iconTint="@android:color/white"
                app:rippleColor="@color/ripple" />

            <!-- Share button -->
            <com.futo.platformplayer.views.buttons.ShortsButton
                android:id="@+id/share_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20dp"
                android:contentDescription="@string/share"
                app:buttonIcon_s="@drawable/ic_share_s"
                app:iconSize="24dp"
                app:iconTint="@android:color/white"
                app:rippleColor="@color/ripple" />

            <!-- Refresh button -->
            <com.futo.platformplayer.views.buttons.ShortsButton
                android:id="@+id/refresh_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginBottom="20dp"
                android:contentDescription="@string/refresh"
                app:buttonIcon_s="@drawable/ic_refresh"
                app:iconSize="24dp"
                app:iconTint="@android:color/white"
                app:rippleColor="@color/ripple" />

            <!-- Quality/More button -->
            <com.futo.platformplayer.views.buttons.ShortsButton
                android:id="@+id/quality_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:contentDescription="@string/quality"
                app:buttonIcon_s="@drawable/ic_settings_s"
                app:iconSize="24dp"
                app:iconTint="@android:color/white"
                app:rippleColor="@color/ripple" />
        </LinearLayout>
    </androidx.constraintlayout.widget.ConstraintLayout>

    <!-- Play/Pause overlay -->
    <FrameLayout
        android:id="@+id/play_pause_overlay"
        android:layout_width="94dp"
        android:layout_height="94dp"
        android:layout_gravity="center"
        android:background="@drawable/rounded_outline"
        android:backgroundTint="@color/play_pause_background"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <ImageView
            android:id="@+id/play_pause_icon"
            android:layout_width="64dp"
            android:layout_height="64dp"
            android:layout_gravity="center"
            android:contentDescription="@string/play"
            android:src="@drawable/ic_play"
            app:tint="@android:color/white" />
    </FrameLayout>
</FrameLayout>
