<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="@color/colorBackground"
    tools:context=".kredit.CreditCardActivity">

    <!-- Toolbar -->
    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@color/primary_blue"
        android:theme="@style/CustomToolbarTheme"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:fillViewport="true">

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

            <!-- Success Header -->
            <androidx.cardview.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="16dp"
                app:cardCornerRadius="12dp"
                app:cardElevation="4dp"
                app:cardBackgroundColor="@color/accent_green">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:padding="20dp"
                    android:gravity="center">

                    <ImageView
                        android:layout_width="64dp"
                        android:layout_height="64dp"
                        android:layout_marginBottom="12dp"
                        android:src="@drawable/ic_check_circle"
                        app:tint="@android:color/white" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="TRANSAKSI BERHASIL"
                        style="@style/SuccessTextStyle" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="4dp"
                        android:text="Transaction Completed Successfully"
                        android:textSize="14sp"
                        android:textColor="@color/white"
                        android:fontFamily="@font/inter"
                        android:gravity="center" />

                </LinearLayout>
            </androidx.cardview.widget.CardView>

            <!-- Transaction Summary Card -->
            <androidx.cardview.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="16dp"
                app:cardCornerRadius="12dp"
                app:cardElevation="4dp">

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

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="RINGKASAN TRANSAKSI"
                        style="@style/CardTitleStyle" />

                    <ScrollView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:maxHeight="200dp">

                        <TextView
                            android:id="@+id/tv_transaction_summary"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="Loading transaction summary..."
                            style="@style/TransactionSummaryStyle" />

                    </ScrollView>

                </LinearLayout>
            </androidx.cardview.widget.CardView>

            <!-- Card Data Card -->
            <androidx.cardview.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:layout_marginBottom="16dp"
                app:cardCornerRadius="12dp"
                app:cardElevation="4dp">

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

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal"
                        android:layout_marginBottom="16dp">

                        <TextView
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:text="DATA KARTU DETAIL"
                            style="@style/CardTitleStyle"
                            android:layout_marginBottom="0dp" />

                        <ImageView
                            android:layout_width="24dp"
                            android:layout_height="24dp"
                            android:src="@drawable/ic_credit_card"
                            app:tint="#666666" />

                    </LinearLayout>

                    <ScrollView
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        android:layout_weight="1"
                        android:fillViewport="true">

                        <TextView
                            android:id="@+id/tv_card_data"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="Loading card data..."
                            style="@style/MonospaceTextStyle"
                            android:scrollbars="vertical" />

                    </ScrollView>

                </LinearLayout>
            </androidx.cardview.widget.CardView>

        </LinearLayout>
    </ScrollView>

    <!-- Action Buttons -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="16dp"
        android:background="@android:color/white"
        android:elevation="8dp">

        <!-- Primary Actions Row -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginBottom="12dp">

            <Button
                android:id="@+id/btn_copy_data"
                android:layout_width="0dp"
                android:layout_height="48dp"
                android:layout_weight="1"
                android:layout_marginEnd="8dp"
                android:text="COPY DATA"
                style="@style/OutlineButton"
                android:drawablePadding="8dp"
                android:gravity="center" />

            <Button
                android:id="@+id/btn_print_receipt"
                android:layout_width="0dp"
                android:layout_height="48dp"
                android:layout_weight="1"
                android:layout_marginStart="8dp"
                android:text="PRINT"
                style="@style/OutlineButton"
                android:drawablePadding="8dp"
                android:gravity="center" />

        </LinearLayout>

        <!-- New Transaction Button -->
        <Button
            android:id="@+id/btn_new_transaction"
            android:layout_width="match_parent"
            android:layout_height="56dp"
            android:text="TRANSAKSI BARU"
            style="@style/PrimaryButton"
            android:drawablePadding="8dp"
            android:gravity="center" />

    </LinearLayout>

</LinearLayout>