<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!-- Include the component appbar -->
    <include layout="@layout/component_appbar" />
    
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:background="@android:color/white"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        android:layout_marginTop="50dp">

        <!-- Title Section -->
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Cetak Ulang Struk"
            android:textSize="20sp"
            android:textColor="#333333"
            android:textStyle="bold"
            android:layout_marginTop="8dp"
            android:layout_marginBottom="16dp"
            android:layout_marginStart="16dp" />

        <!-- Search and Filter Container -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginStart="16dp"
            android:layout_marginEnd="16dp"
            android:layout_marginBottom="16dp"
            android:weightSum="10">

            <!-- Search Container (Ratio 8) -->
            <LinearLayout
                android:id="@+id/searchContainer"
                android:layout_width="0dp"
                android:layout_height="44dp"
                android:layout_weight="8"
                android:background="@android:drawable/edit_text"
                android:backgroundTint="@android:color/white"
                android:orientation="horizontal"
                android:gravity="center_vertical"
                android:paddingStart="12dp"
                android:paddingEnd="12dp"
                android:layout_marginEnd="8dp">

                <EditText
                    android:id="@+id/searchEditText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Cari dengan nomor struk..."
                    android:textColorHint="#999999"
                    android:textColor="#333333"
                    android:textSize="14sp"
                    android:background="@android:color/transparent"
                    android:inputType="text"
                    android:maxLines="1"
                    android:imeOptions="actionSearch" />

            </LinearLayout>

            <!-- Filter Button (Ratio 2) -->
            <LinearLayout
                android:id="@+id/filterButton"
                android:layout_width="0dp"
                android:layout_height="44dp"
                android:layout_weight="2"
                android:background="@android:drawable/btn_default"
                android:backgroundTint="@android:color/white"
                android:orientation="horizontal"
                android:gravity="center"
                android:clickable="true"
                android:focusable="true">

                <ImageView
                    android:layout_width="18dp"
                    android:layout_height="18dp"
                    android:src="@android:drawable/ic_menu_sort_by_size"
                    android:tint="#666666" />

                <TextView
                    android:id="@+id/filterButtonText"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text=""
                    android:textColor="#666666"
                    android:textSize="12sp"
                    android:gravity="center"
                    android:layout_marginStart="4dp"
                    android:visibility="gone" />

            </LinearLayout>

        </LinearLayout>

        <!-- RecyclerView for transactions -->
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recyclerView"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:paddingStart="16dp"
            android:paddingEnd="16dp"
            android:background="@android:color/white"
            android:clipToPadding="false"
            android:scrollbars="vertical" />

        <!-- Progress Bar -->
        <ProgressBar
            android:id="@+id/progressBar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginTop="20dp"
            android:visibility="gone" />

        <!-- Pagination Controls -->
        <LinearLayout
            android:id="@+id/paginationControls"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_marginTop="16dp"
            android:layout_marginBottom="16dp"
            android:layout_marginStart="16dp"
            android:layout_marginEnd="16dp"
            android:background="@android:color/white"
            android:visibility="gone">

            <!-- Navigation Controls -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:gravity="center">

                <!-- First Page Button -->
                <ImageButton
                    android:id="@+id/btnFirstPage"
                    android:layout_width="44dp"
                    android:layout_height="44dp"
                    android:layout_marginEnd="8dp"
                    android:background="@android:drawable/btn_default"
                    android:src="@android:drawable/ic_media_previous"
                    android:contentDescription="First Page"
                    android:scaleType="fitCenter" />

                <!-- Previous Page Button -->
                <ImageButton
                    android:id="@+id/btnPrevPage"
                    android:layout_width="44dp"
                    android:layout_height="44dp"
                    android:layout_marginEnd="8dp"
                    android:background="@android:drawable/btn_default"
                    android:src="@android:drawable/ic_media_rew"
                    android:contentDescription="Previous Page"
                    android:scaleType="fitCenter" />

                <!-- Page Numbers Container -->
                <LinearLayout
                    android:id="@+id/pageNumbersContainer"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:layout_marginStart="8dp"
                    android:layout_marginEnd="8dp" />

                <!-- Next Page Button -->
                <ImageButton
                    android:id="@+id/btnNextPage"
                    android:layout_width="44dp"
                    android:layout_height="44dp"
                    android:layout_marginStart="8dp"
                    android:background="@android:drawable/btn_default"
                    android:src="@android:drawable/ic_media_ff"
                    android:contentDescription="Next Page"
                    android:scaleType="fitCenter" />

                <!-- Last Page Button -->
                <ImageButton
                    android:id="@+id/btnLastPage"
                    android:layout_width="44dp"
                    android:layout_height="44dp"
                    android:layout_marginStart="8dp"
                    android:background="@android:drawable/btn_default"
                    android:src="@android:drawable/ic_media_next"
                    android:contentDescription="Last Page"
                    android:scaleType="fitCenter" />

            </LinearLayout>

        </LinearLayout>

    </LinearLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>