<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
    android:orientation="vertical"
    android:background="@drawable/bottom_menu_border"
    android:id="@+id/videodetail_root"
    android:clickable="true">

    <com.futo.platformplayer.views.behavior.TouchInterceptFrameLayout
        android:id="@+id/layout_player_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingBottom="6dp"
        android:elevation="2dp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent">

        <com.futo.platformplayer.views.video.FutoVideoPlayer
            android:id="@+id/videodetail_player"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:showSettings="true"
            app:showFullScreen="true"
            app:showMinimize="true"
            android:elevation="3dp"
            android:background="@color/transparent" />

        <com.futo.platformplayer.views.casting.CastView
            android:id="@+id/videodetail_cast"
            android:layout_width="match_parent"
            android:layout_height="300dp"
            android:background="@color/transparent"
            android:visibility="gone"
            android:elevation="4dp"
            android:layout_marginBottom="6dp" />

        <androidx.media3.ui.PlayerControlView
            android:id="@+id/videodetail_progress"
            android:layout_width="match_parent"
            android:layout_height="12dp"
            android:layout_gravity="bottom"
            android:layout_marginLeft="-6dp"
            android:layout_marginRight="-6dp"
            android:layout_marginBottom="6dp"
            app:show_timeout="-1"
            android:elevation="2dp"
            app:controller_layout_id="@layout/video_player_ui_bar" />
    </com.futo.platformplayer.views.behavior.TouchInterceptFrameLayout>

    <!--Minimized Controls-->
    <LinearLayout
        android:id="@+id/minimize_controls"
        android:orientation="horizontal"
        android:layout_width="0dp"
        android:layout_height="60dp"
        android:gravity="center_vertical"
        android:paddingStart="10dp"
        android:clickable="false"
        android:elevation="5dp"
        android:alpha="1"
        app:layout_constraintTop_toTopOf="@id/layout_player_container"
        app:layout_constraintBottom_toBottomOf="@id/layout_player_container"
        app:layout_constraintEnd_toEndOf="@id/layout_player_container"
        app:layout_constraintWidth_percent="0.7">
        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:layout_marginEnd="10dp"
            android:orientation="vertical">
            <!--Video Title-->
            <TextView
                android:id="@+id/videodetail_title_minimized"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginEnd="10dp"
                android:maxLines="1"
                android:fontFamily="@font/inter_medium"
                android:textColor="@color/white"
                android:textSize="12dp"
                tools:text="Some video titles or whatever"/>
            <!--Meta (Views+Time)-->
            <TextView
                android:id="@+id/videodetail_meta_minimized"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginEnd="10dp"
                android:maxLines="1"
                android:fontFamily="@font/inter_regular"
                android:textColor="#ACACAC"
                android:textSize="8dp"
                tools:text="Louis Rossman"/>

        </LinearLayout>


        <ImageButton
            android:id="@+id/minimize_play"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:contentDescription="@string/cd_minimize_play"
            android:padding="10dp"
            android:clickable="true"
            android:scaleType="fitCenter"
            app:srcCompat="@drawable/ic_play_white_nopad" />
        <ImageButton
            android:id="@+id/minimize_pause"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:contentDescription="@string/cd_minimize_pause"
            android:padding="5dp"
            android:scaleType="fitCenter"
            android:clickable="true"
            app:srcCompat="@drawable/ic_pause_white" />
        <ImageButton
            android:id="@+id/minimize_close"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:contentDescription="@string/cd_minimize_close"
            android:padding="5dp"
            android:scaleType="fitCenter"
            android:layout_marginStart="2dp"
            android:clickable="true"
            app:srcCompat="@drawable/ic_close" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/layout_resume"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:elevation="5dp"
        android:background="@drawable/background_button_transparent_round"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:paddingTop="6dp"
        android:paddingBottom="6dp"
        android:paddingStart="12dp"
        android:paddingEnd="12dp"
        android:layout_marginTop="10dp"
        android:visibility="gone">

        <TextView
            android:id="@+id/text_resume"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            tools:text="Resume at 00:00"
            android:textSize="12dp"
            android:fontFamily="@font/inter_light" />
    </LinearLayout>
    <LinearLayout
        android:id="@+id/layout_skip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:elevation="5dp"
        android:background="@drawable/background_button_transparent_round"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:paddingTop="6dp"
        android:paddingBottom="6dp"
        android:paddingStart="12dp"
        android:paddingEnd="12dp"
        android:layout_marginTop="10dp"
        android:visibility="gone">

        <TextView
            android:id="@+id/text_skip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Skip"
            android:textSize="12dp"
            android:fontFamily="@font/inter_light" />
    </LinearLayout>

    <FrameLayout
        android:id="@+id/contentContainer"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginTop="-18dp"
        android:elevation="1dp"
        app:layout_constraintTop_toBottomOf="@id/layout_player_container"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent">

        <FrameLayout
            android:id="@+id/videodetail_container_main"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/black"
            tools:ignore="SpeakableTextPresentCheck">

            <LinearLayout
                android:id="@+id/layout_top"
                android:orientation="vertical"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <!--Title Segment-->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <!--Title + Meta-->
                    <androidx.constraintlayout.widget.ConstraintLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="14dp"
                        android:layout_marginEnd="14dp"
                        android:layout_marginTop="10dp">

                        <TextView
                            android:id="@+id/videodetail_title"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginEnd="10dp"
                            android:fontFamily="@font/inter_medium"
                            android:textColor="@color/white"
                            android:textSize="17dp"
                            tools:text="Some Text"
                            app:layout_constraintLeft_toLeftOf="parent"
                            app:layout_constraintRight_toLeftOf="@id/layout_title_right"
                            app:layout_constraintTop_toTopOf="parent" />

                        <TextView
                            android:id="@+id/videodetail_meta"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginEnd="10dp"
                            android:fontFamily="@font/inter_regular"
                            android:textColor="#ACACAC"
                            android:textSize="10dp"
                            tools:text="51K views - 3 years ago"
                            app:layout_constraintLeft_toLeftOf="@id/videodetail_title"
                            app:layout_constraintTop_toBottomOf="@id/videodetail_title"
                            app:layout_constraintRight_toLeftOf="@id/layout_title_right"/>

                        <!--Source Button-->

                        <LinearLayout
                            android:id="@+id/layout_title_right"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:orientation="vertical"
                            android:gravity="end"
                            app:layout_constraintRight_toRightOf="parent"
                            app:layout_constraintTop_toTopOf="parent">

                            <com.futo.platformplayer.views.platform.PlatformIndicator
                                android:id="@+id/videodetail_platform"
                                android:layout_width="25dp"
                                android:layout_height="25dp"
                                app:layout_constraintRight_toRightOf="parent"
                                app:layout_constraintTop_toTopOf="parent" />

                            <LinearLayout
                                android:id="@+id/layout_rating"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:orientation="vertical"
                                android:gravity="center_vertical">

                                <LinearLayout
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:orientation="horizontal">
                                    <ImageView
                                        android:id="@+id/image_like_icon"
                                        android:layout_width="14dp"
                                        android:layout_height="14dp"
                                        app:tint="#ACACAC"
                                        app:srcCompat="@drawable/ic_thumb_up" />

                                    <TextView
                                        android:id="@+id/text_likes"
                                        android:layout_width="wrap_content"
                                        android:layout_height="18dp"
                                        android:gravity="center_vertical"
                                        android:layout_marginStart="4dp"
                                        tools:text="500K"
                                        android:textColor="#ACACAC"
                                        android:textSize="10dp" />
                                </LinearLayout>

                                <LinearLayout
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:orientation="horizontal">
                                    <ImageView
                                        android:id="@+id/image_dislike_icon"
                                        android:layout_width="14dp"
                                        android:layout_height="14dp"
                                        android:layout_marginTop="2dp"
                                        app:tint="#ACACAC"
                                        app:srcCompat="@drawable/ic_thumb_down" />

                                    <TextView
                                        android:id="@+id/text_dislikes"
                                        android:layout_width="wrap_content"
                                        android:layout_height="18dp"
                                        android:gravity="center_vertical"
                                        android:layout_marginStart="4dp"
                                        tools:text="500K"
                                        android:textColor="#ACACAC"
                                        android:textSize="10dp" />
                                </LinearLayout>
                            </LinearLayout>
                        </LinearLayout>

                    </androidx.constraintlayout.widget.ConstraintLayout>
                </LinearLayout>

                <!--Channel/Subscribe Segment-->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="14dp"
                    android:layout_marginRight="14dp"
                    android:layout_marginTop="10dp">

                    <LinearLayout
                        android:id="@+id/videodetail_channel_button"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="7dp"
                        android:orientation="horizontal"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintLeft_toLeftOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintRight_toLeftOf="@id/button_subscribe">

                        <com.futo.platformplayer.views.others.CreatorThumbnail
                            android:id="@+id/creator_thumbnail"
                            android:layout_width="35dp"
                            android:layout_height="35dp"
                            android:contentDescription="@string/cd_creator_thumbnail" />
                        <LinearLayout
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:layout_marginStart="10dp"
                            android:layout_marginTop="5dp"
                            android:orientation="vertical">
                            <TextView
                                android:id="@+id/videodetail_channel_name"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:paddingEnd="10dp"
                                android:textColor="@color/white"
                                android:layout_gravity="center"
                                android:ellipsize="end"
                                android:maxLines="1"
                                tools:text="Channel Name" />
                            <TextView
                                android:id="@+id/videodetail_channel_meta"
                                android:layout_width="match_parent"
                                android:layout_weight="1"
                                android:layout_height="wrap_content"
                                android:textColor="#ACACAC"
                                android:textSize="9sp"
                                android:layout_gravity="center"
                                android:ellipsize="end"
                                android:maxLines="1"
                                tools:text="" />

                        </LinearLayout>
                    </LinearLayout>

                    <com.futo.platformplayer.views.subscriptions.SubscribeButton
                        android:id="@+id/button_subscribe"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="10dp"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintRight_toRightOf="parent" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:layout_marginBottom="10dp"
                    android:orientation="horizontal">
                    <com.futo.platformplayer.views.pills.PillRatingLikesDislikes
                        android:id="@+id/videodetail_rating"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        app:layout_constraintLeft_toLeftOf="parent"
                        app:layout_constraintTop_toTopOf="parent"
                        android:layout_marginTop="7dp"
                        android:layout_marginStart="15dp" />

                    <com.futo.platformplayer.views.pills.RoundButtonGroup
                        android:id="@+id/buttons_pins"
                        app:layout_constraintLeft_toRightOf="@id/videodetail_rating"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintRight_toRightOf="parent"
                        android:layout_marginLeft="10dp"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content" />
                </androidx.constraintlayout.widget.ConstraintLayout>


                <!--Description-->
                <LinearLayout
                    android:id="@+id/videodetail_description_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:animateLayoutChanges="true"
                    android:orientation="vertical"
                    android:background="@drawable/background_videodetail_description"
                    android:layout_marginLeft="14dp"
                    android:layout_marginRight="14dp"
                    android:paddingTop="3dp"
                    android:paddingBottom="5dp"
                    android:paddingLeft="12dp"
                    android:paddingRight="12dp">
                    <com.futo.platformplayer.views.behavior.NonScrollingTextView
                        android:id="@+id/videodetail_description"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="5dp"
                        android:textColor="@color/white"
                        android:fontFamily="@font/inter_light"
                        android:background="@color/transparent"
                        android:isScrollContainer="false"
                        android:textSize="11dp"
                        android:maxLines="3"
                        tools:text="@string/lorem_ipsum" />
                    <TextView
                        android:id="@+id/videodetail_description_view_more"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="10dp"
                        android:background="@color/transparent"
                        android:fontFamily="@font/inter_regular"
                        android:textSize="12dp"
                        android:textColor="#585656"
                        android:textAlignment="center"
                        android:text="@string/click_to_read_more"/>
                </LinearLayout>

                <com.futo.platformplayer.views.MonetizationView
                    android:id="@+id/monetization"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />

                <com.futo.platformplayer.views.videometa.UpNextView
                    android:id="@+id/up_next"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:visibility="gone">
                    <Button
                        android:layout_margin="15dp"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="@string/live_chat" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/layout_change_bottom_section"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:background="@drawable/background_videodetail_description"
                    android:layout_marginTop="10dp"
                    android:layout_marginBottom="10dp"
                    android:layout_marginLeft="14dp"
                    android:layout_marginRight="14dp">

                    <Button
                        android:id="@+id/button_polycentric"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:background="?android:attr/selectableItemBackground"
                        android:text="Polycentric"
                        android:textColor="#fff"
                        android:textSize="10dp"
                        android:lines="1"
                        android:ellipsize="marquee"
                        android:padding="10dp" />

                    <Button
                        android:id="@+id/button_platform"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:background="?android:attr/selectableItemBackground"
                        android:text="Platform"
                        android:textColor="#fff"
                        android:textSize="10dp"
                        android:lines="1"
                        android:ellipsize="marquee"
                        android:padding="10dp" />

                    <Button
                        android:id="@+id/button_recommended"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:background="?android:attr/selectableItemBackground"
                        android:text="Recommended"
                        android:textColor="#fff"
                        android:textSize="10dp"
                        android:lines="1"
                        android:ellipsize="marquee"
                        android:padding="10dp" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/layout_recommended"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:gravity="center_horizontal"
                    android:layout_marginLeft="12dp"
                    android:layout_marginRight="12dp">
                </LinearLayout>

                <com.futo.platformplayer.views.comments.AddCommentView
                    android:id="@+id/add_comment_view"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="12dp"
                    android:layout_marginBottom="12dp"
                    android:layout_marginStart="28dp"
                    android:layout_marginEnd="28dp" />
            </LinearLayout>

            <com.futo.platformplayer.views.segments.CommentsList
                android:id="@+id/comments_list"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_behavior="@string/appbar_scrolling_view_behavior" />

        </FrameLayout>

        <com.futo.platformplayer.views.overlays.DescriptionOverlay
            android:id="@+id/videodetail_container_description"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

        <com.futo.platformplayer.views.overlays.LiveChatOverlay
            android:id="@+id/videodetail_container_livechat"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

        <com.futo.platformplayer.views.overlays.WebviewOverlay
            android:id="@+id/videodetail_container_webview"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

        <com.futo.platformplayer.views.overlays.QueueEditorOverlay
            android:id="@+id/videodetail_container_queue"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

        <com.futo.platformplayer.views.overlays.RepliesOverlay
            android:id="@+id/videodetail_container_replies"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

        <com.futo.platformplayer.views.overlays.ChaptersOverlay
            android:id="@+id/videodetail_container_chapters"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

        <com.futo.platformplayer.views.overlays.SupportOverlay
            android:id="@+id/videodetail_container_support"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
    </FrameLayout>
    <FrameLayout
        android:id="@+id/videodetail_loading_overlay"
        android:visibility="gone"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#77000000"
        android:elevation="4dp">
        <ImageView
            android:id="@+id/videodetail_loader"
            android:layout_width="80dp"
            android:layout_height="80dp"
            app:srcCompat="@drawable/ic_loader_animated"
            android:layout_gravity="top|center_horizontal"
            android:alpha="0.7"
            android:layout_marginTop="80dp"
            android:contentDescription="@string/loading" />
    </FrameLayout>

    <FrameLayout
        android:id="@+id/videodetail_quality_overview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:elevation="100dp"
        android:visibility="gone" />

    <FrameLayout
        android:id="@+id/overlay_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:elevation="100dp"
        android:visibility="gone" />
</androidx.constraintlayout.widget.ConstraintLayout>