<?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:background="#F5F5F5"
    tools:context=".QrisResultActivity">

    <!-- Header Background -->
    <View
        android:id="@+id/header_background"
        android:layout_width="match_parent"
        android:layout_height="100dp"
        android:background="#E31937"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

    <!-- Back Navigation -->
    <LinearLayout
        android:id="@+id/back_navigation"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="center_vertical"
        android:padding="16dp"
        android:layout_marginTop="24dp"
        android:background="?android:attr/selectableItemBackground"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent">

        <ImageView
            android:id="@+id/backArrow"
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:src="@drawable/ic_arrow_back"
            android:layout_marginEnd="8dp" />

        <TextView
            android:id="@+id/toolbarTitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Generate QR"
            android:textColor="@android:color/white"
            android:textSize="18sp"
            android:textStyle="bold"
            android:fontFamily="@font/inter" />

    </LinearLayout>

    <!-- Main Content Card -->
    <androidx.cardview.widget.CardView
        android:id="@+id/main_card"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        android:layout_marginTop="16dp"
        app:cardCornerRadius="16dp"
        app:cardElevation="8dp"
        app:layout_constraintTop_toBottomOf="@id/header_background"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintBottom_toTopOf="@id/cancel_button"
        app:layout_constraintVertical_bias="0.3">

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

            <!-- QRIS Logo -->
            <TextView
                android:id="@+id/qris_logo"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="QRIS"
                android:textSize="32sp"
                android:textStyle="bold"
                android:textColor="#000000"
                android:letterSpacing="0.1"
                android:layout_marginBottom="24dp"
                android:fontFamily="@font/inter" />

            <!-- QR Code -->
            <ImageView
                android:id="@+id/qrImageView"
                android:layout_width="240dp"
                android:layout_height="240dp"
                android:layout_marginBottom="24dp"
                android:scaleType="centerInside"
                android:background="#FFFFFF"
                android:padding="8dp" />

            <!-- Amount -->
            <TextView
                android:id="@+id/amountTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="RP.200.000"
                android:textSize="24sp"
                android:textStyle="bold"
                android:textColor="#333333"
                android:layout_marginBottom="16dp"
                android:fontFamily="@font/inter" />

            <!-- Timer -->
            <TextView
                android:id="@+id/timerTextView"
                android:layout_width="48dp"
                android:layout_height="48dp"
                android:text="60"
                android:textSize="18sp"
                android:textStyle="bold"
                android:textColor="#666666"
                android:gravity="center"
                android:background="@drawable/timer_circle_background"
                android:fontFamily="@font/inter" />

        </LinearLayout>

    </androidx.cardview.widget.CardView>

    <!-- Cancel Button -->
    <Button
        android:id="@+id/cancel_button"
        android:layout_width="0dp"
        android:layout_height="52dp"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        android:layout_marginBottom="32dp"
        android:text="Batalkan"
        android:textColor="#E31937"
        android:textSize="16sp"
        android:textStyle="bold"
        android:background="@drawable/button_cancel_background"
        android:fontFamily="@font/inter"
        android:textAllCaps="false"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

    <!-- Hidden Elements for Functionality -->
    <TextView
        android:id="@+id/referenceTextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="gone"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <TextView
        android:id="@+id/statusTextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="gone"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <TextView
        android:id="@+id/qrStatusTextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="gone"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <ProgressBar
        android:id="@+id/progressBar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="gone"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <Button
        android:id="@+id/downloadQrisButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="gone"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <Button
        android:id="@+id/checkStatusButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="gone"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <Button
        android:id="@+id/returnMainButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="gone"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <!-- Success Screen (Full Screen Overlay) -->
    <LinearLayout
        android:id="@+id/success_screen"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:gravity="center"
        android:background="#E31937"
        android:visibility="gone"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent">

        <!-- Success Icon -->
        <ImageView
            android:id="@+id/success_icon"
            android:layout_width="120dp"
            android:layout_height="120dp"
            android:src="@drawable/ic_success_payment"
            android:layout_marginBottom="32dp"
            android:scaleType="centerInside"/>

        <!-- Success Message -->
        <TextView
            android:id="@+id/success_message"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Pembayaran Berhasil"
            android:textColor="@android:color/white"
            android:textSize="24sp"
            android:textStyle="bold"
            android:fontFamily="@font/inter"
            android:gravity="center"
            android:letterSpacing="0.02"/>

    </LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>