<?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:paddingBottom="20dp"
    android:layout_height="wrap_content">

    <com.google.android.material.card.MaterialCardView
        android:id="@+id/frame_layout"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintWidth_percent=".5"
        app:layout_constraintHorizontal_bias="0.0"
        app:cardCornerRadius="0dp"
        app:layout_constraintDimensionRatio="H,16:9"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@id/info"
        app:layout_constraintTop_toTopOf="parent">


        <androidx.media3.ui.PlayerView
            android:id="@+id/video_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_constraintTop_toTopOf="parent"
            app:resize_mode="fixed_height"
            app:useDefaultControls="true"
            app:use_controller="true" />

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

    <com.google.android.material.button.MaterialButton
        android:id="@+id/download_thumb"
        style="@style/Widget.Material3.Button.IconButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:icon="@drawable/ic_image"
        app:iconSize="30dp"
        app:iconTint="?android:colorAccent"
        app:layout_constraintTop_toTopOf="@+id/frame_layout"
        app:layout_constraintEnd_toEndOf="@+id/frame_layout" />

    <TextView
        android:id="@+id/title"
        android:layout_width="0dp"
        android:layout_marginTop="10dp"
        android:textStyle="bold"
        android:layout_marginHorizontal="10dp"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:maxLines="2"
        android:singleLine="false"
        android:text="@string/app_name"
        android:textSize="17sp"
        app:layout_constraintEnd_toStartOf="@+id/download_music"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/frame_layout" />

    <TextView
        android:id="@+id/bottom_info"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="10dp"
        android:ellipsize="end"
        app:layout_constraintVertical_bias="0.0"
        android:singleLine="false"
        android:text="@string/app_name"
        android:textSize="12sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/download_music"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/title" />


    <com.google.android.material.button.MaterialButton
        android:id="@+id/download_music"
        style="@style/Widget.Material3.ExtendedFloatingActionButton.Icon.Secondary"
        android:layout_width="55dp"
        android:layout_marginTop="10dp"
        android:layout_height="55dp"
        android:layout_marginHorizontal="10dp"
        app:icon="@drawable/ic_music"
        app:layout_constraintEnd_toStartOf="@+id/download_video"
        app:layout_constraintTop_toBottomOf="@id/frame_layout" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/download_video"
        style="@style/Widget.Material3.ExtendedFloatingActionButton.Icon.Secondary"
        android:layout_width="55dp"
        android:layout_marginTop="10dp"
        android:layout_height="55dp"
        android:layout_marginHorizontal="10dp"
        app:icon="@drawable/ic_video"
        app:layout_constraintEnd_toEndOf="@id/frame_layout"
        app:layout_constraintTop_toBottomOf="@id/frame_layout" />


    <Button
        android:id="@+id/bottom_sheet_link"
        style="@style/Widget.Material3.Button.TextButton.Icon"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:singleLine="true"
        android:text="@string/app_name"
        android:textAlignment="textStart"
        android:textSize="15sp"
        app:icon="@drawable/ic_link"
        app:layout_constraintEnd_toStartOf="@+id/info"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/download_music" />


    <androidx.core.widget.NestedScrollView
        android:id="@+id/info"
        android:orientation="vertical"
        android:layout_width="0dp"
        android:layout_marginHorizontal="10dp"
        android:scrollbars="none"
        app:layout_constraintWidth_percent=".5"
        app:layout_constraintVertical_bias="0.5"
        app:layout_constraintStart_toEndOf="@id/frame_layout"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:layout_height="wrap_content">


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

            <include layout="@layout/no_results"
                android:visibility="gone" />

            <TextView
                android:id="@+id/running"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginVertical="10dp"
                android:text="@string/running"
                android:textStyle="bold"/>


            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/running_recycler"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />


            <TextView
                android:id="@+id/queued"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginVertical="10dp"
                android:text="@string/download_queue"
                android:textStyle="bold" />


            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/queued_recycler"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />


        </LinearLayout>

    </androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>