<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView 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:id="@+id/itemEpisodeCont"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="8dp"
    android:background="@drawable/card_outline"
    android:backgroundTint="?attr/colorSurfaceVariant"
    android:backgroundTintMode="src_atop"
    android:longClickable="true"
    app:cardCornerRadius="16dp">

    <View
        android:id="@+id/itemEpisodeFillerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/filler"
        android:visibility="gone" />

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

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="-4dp"
            android:clipToPadding="false"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:paddingBottom="4dp">

            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                app:cardBackgroundColor="#000000"
                app:cardCornerRadius="16dp">

                <ProgressBar
                    style="?android:attr/progressBarStyle"
                    android:layout_width="32dp"
                    android:layout_height="32dp"
                    android:layout_gravity="center"
                    android:indeterminate="true" />

                <ImageView
                    android:id="@+id/itemMediaImage"
                    android:layout_width="164dp"
                    android:layout_height="109dp"
                    android:layout_gravity="center"
                    android:scaleType="centerCrop"
                    tools:ignore="ContentDescription" />

                <androidx.cardview.widget.CardView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="-10dp"
                    android:layout_marginTop="-18dp"
                    app:cardBackgroundColor="?attr/colorOnBackground"
                    app:cardCornerRadius="16dp">

                    <TextView
                        android:id="@+id/itemEpisodeNumber"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="bottom"
                        android:layout_marginStart="16dp"
                        android:layout_marginTop="19dp"
                        android:layout_marginEnd="8dp"
                        android:fontFamily="@font/poppins_bold"
                        android:textColor="?android:colorBackground"
                        android:textSize="20sp"
                        tools:text="12" />
                </androidx.cardview.widget.CardView>

                <LinearLayout
                    android:id="@+id/itemMediaProgress_cont"
                    android:layout_width="164dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom"
                    android:orientation="horizontal"
                    android:visibility="gone">

                    <View
                        android:id="@+id/itemMediaProgress"
                        android:layout_width="0dp"
                        android:layout_height="2dp"
                        android:layout_weight="0"
                        android:background="?attr/colorPrimary" />

                    <View
                        android:id="@+id/itemMediaProgressEmpty"
                        android:layout_width="0dp"
                        android:layout_height="2dp"
                        android:layout_weight="1"
                        android:background="#80FFFFFF" />

                </LinearLayout>

                <ImageButton
                    android:id="@+id/itemEpisodeViewed"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom"
                    android:layout_marginStart="8dp"
                    android:layout_marginBottom="8dp"
                    android:background="?android:attr/selectableItemBackground"
                    app:srcCompat="@drawable/ic_round_remove_red_eye_24"
                    tools:ignore="ContentDescription" />
            </androidx.cardview.widget.CardView>

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginVertical="8dp"
                android:layout_weight="1"
                android:gravity="center"
                android:minHeight="92dp"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/itemEpisodeFiller"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:ellipsize="marquee"
                    android:fontFamily="@font/poppins_bold"
                    android:text="@string/filler"
                    android:textAlignment="center"
                    android:textStyle="italic"
                    android:visibility="gone"
                    app:lineHeight="15sp" />

                <TextView
                    android:id="@+id/itemEpisodeTitle"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:ellipsize="marquee"
                    android:fontFamily="@font/poppins_bold"
                    android:layout_marginStart="4dp"
                    android:maxLines="5"
                    android:text="@string/empty"
                    app:lineHeight="15sp" />

            </LinearLayout>

            <ImageButton
                android:id="@+id/itemDownload"
                android:layout_width="48dp"
                android:layout_height="48dp"
                android:background="@android:color/transparent"
                app:srcCompat="@drawable/ic_download_24"
                app:tint="?attr/colorOnBackground"
                tools:ignore="ContentDescription" />

        </LinearLayout>

        <TextView
            android:id="@+id/itemDownloadStatus"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ellipsize="marquee"
            android:fontFamily="@font/poppins_bold"
            android:maxLines="5"
            android:padding="16dp"
            android:text=""
            android:visibility="gone"
            app:lineHeight="15sp" />

        <TextView
            android:id="@+id/itemEpisodeDesc"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:alpha="0.58"
            android:ellipsize="end"
            android:maxLines="3"
            android:padding="16dp"
            app:lineHeight="16sp"
            tools:ignore="TextContrastCheck"
            tools:text="@tools:sample/lorem/random" />

    </LinearLayout>

    <View
        android:id="@+id/itemEpisodeViewedCover"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:alpha="0.33"
        android:background="?android:colorBackground"
        android:visibility="gone" />


</androidx.cardview.widget.CardView>