<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:theme="@style/Theme.Ecommerce_serang"
    tools:context=".ui.profile.ProfileFragment">

    <!-- Profile Header -->
    <ImageView
        android:id="@+id/profileImage"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        android:src="@drawable/outline_account_circle_24"
        android:scaleType="centerCrop"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:id="@+id/tvName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:text="Gracia Hotmauli"
        android:textSize="18sp"
        android:textStyle="bold"
        app:layout_constraintStart_toEndOf="@id/profileImage"
        app:layout_constraintTop_toTopOf="@id/profileImage" />

    <TextView
        android:id="@+id/tvUsername"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="\@gracia34"
        android:textColor="#757575"
        app:layout_constraintStart_toStartOf="@id/tvName"
        app:layout_constraintTop_toBottomOf="@id/tvName" />

    <Button
        android:id="@+id/btnDetailProfile"
        style="@style/Widget.MaterialComponents.Button.OutlinedButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="16dp"
        android:text="Detail Profil"
        android:clickable="true"
        android:focusable="true"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@id/profileImage" />

    <!-- Store Button -->
    <LinearLayout
        android:id="@+id/container_buka_toko"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintTop_toBottomOf="@id/profileImage">

        <androidx.cardview.widget.CardView
            android:id="@+id/cardBukaToko"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:clickable="true"
            android:focusable="true"
            android:paddingHorizontal="16dp"
            app:cardElevation="4dp"
            tools:layout_editor_absoluteX="0dp">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginHorizontal="14dp">

                <TextView
                    android:id="@+id/tvBukaToko"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:drawableStart="@drawable/outline_store_24"
                    android:drawablePadding="16dp"
                    android:fontFamily="@font/dmsans_semibold"
                    android:padding="16dp"
                    android:text="@string/open_store"
                    android:textSize="14sp"
                    app:layout_constraintEnd_toStartOf="@id/ivStoreArrow"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <ImageView
                    android:id="@+id/ivStoreArrow"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="16dp"
                    android:background="?attr/selectableItemBackgroundBorderless"
                    android:src="@drawable/ic_arrow_right"
                    app:layout_constraintBottom_toBottomOf="@id/tvBukaToko"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toTopOf="@id/tvBukaToko" />

            </androidx.constraintlayout.widget.ConstraintLayout>

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

    <androidx.cardview.widget.CardView
        android:id="@+id/cardPesanan"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:layout_marginTop="8dp"
        app:layout_constraintTop_toBottomOf="@id/container_buka_toko">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="4dp"
            android:layout_marginBottom="8dp">
            <TextView
                android:id="@+id/tvPesananSaya"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="16dp"
                android:layout_marginTop="8dp"
                android:paddingVertical="8dp"
                android:textSize="16sp"
                android:fontFamily="@font/dmsans_medium"
                android:text="Pesanan Saya"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <Button
                android:id="@+id/tvLihatRiwayat"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:layout_marginEnd="16dp"
                android:textSize="14sp"
                android:padding="0dp"
                android:fontFamily="@font/dmsans_light"
                android:text="Lihat Riwayat Pesanan"
                android:textColor="#2196F3"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toTopOf="@id/tvPesananSaya" />

            <LinearLayout
                android:id="@+id/layoutOrderStatus"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:orientation="horizontal"
                android:weightSum="3"
                app:layout_constraintTop_toBottomOf="@id/tvPesananSaya">

                <!-- Status items (keeping LinearLayout for simplicity of equal width distribution) -->
                <LinearLayout
                    android:id="@+id/ly_waiting"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:gravity="center"
                    android:orientation="vertical">

                    <ImageView
                        android:id="@+id/iv_waiting"
                        android:layout_width="32dp"
                        android:layout_height="32dp"
                        android:src="@drawable/ic_wallet" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textSize="12sp"
                        android:fontFamily="@font/dmsans_regular"
                        android:layout_marginTop="8dp"
                        android:text="@string/waiting_payment" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/ly_packages"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:gravity="center"
                    android:orientation="vertical">

                    <ImageView
                        android:id="@+id/iv_packages"
                        android:layout_width="32dp"
                        android:layout_height="32dp"
                        android:src="@drawable/ic_package" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:fontFamily="@font/dmsans_regular"
                        android:textSize="12sp"
                        android:layout_marginTop="8dp"
                        android:text="@string/packages" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/ly_delivery"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:gravity="center"
                    android:orientation="vertical">

                    <ImageView
                        android:id="@+id/iv_delivery"
                        android:layout_width="32dp"
                        android:layout_height="32dp"
                        android:src="@drawable/ic_delivery" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:fontFamily="@font/dmsans_regular"
                        android:textSize="12sp"
                        android:layout_marginTop="8dp"
                        android:text="@string/delivery" />
                </LinearLayout>
            </LinearLayout>

        </androidx.constraintlayout.widget.ConstraintLayout>

    </androidx.cardview.widget.CardView>
    <!-- Orders Section Header -->

    <!-- Account Settings Header -->
    <TextView
        android:id="@+id/tvPengaturanAkun"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:padding="16dp"
        android:textSize="16sp"
        android:text="Pengaturan Akun"
        android:fontFamily="@font/dmsans_medium"
        app:layout_constraintTop_toBottomOf="@id/cardPesanan" />

    <!-- Address -->
    <LinearLayout
        android:id="@+id/container_settings"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="16dp"
        app:layout_constraintTop_toBottomOf="@id/tvPengaturanAkun"
        app:layout_constraintStart_toStartOf="parent">

        <!-- Address Card -->
        <androidx.cardview.widget.CardView
            android:id="@+id/card_address"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:foreground="?attr/selectableItemBackground"
            android:clickable="true"
            android:focusable="true"
            app:cardCornerRadius="8dp"
            app:cardElevation="2dp">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="16dp">

                <ImageView
                    android:id="@+id/ivAddress"
                    android:layout_width="24dp"
                    android:layout_height="24dp"
                    android:src="@drawable/ic_address"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent" />

                <TextView
                    android:id="@+id/tvAddress"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="16dp"
                    android:text="Alamat"
                    android:textSize="14sp"
                    android:fontFamily="@font/dmsans_regular"
                    app:layout_constraintStart_toEndOf="@id/ivAddress"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toStartOf="@id/ivAddressArrow" />

                <ImageView
                    android:id="@+id/ivAddressArrow"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/ic_arrow_right"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent" />
            </androidx.constraintlayout.widget.ConstraintLayout>
        </androidx.cardview.widget.CardView>

        <!-- About Card -->
        <androidx.cardview.widget.CardView
            android:id="@+id/card_about"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:foreground="?attr/selectableItemBackground"
            android:clickable="true"
            android:focusable="true"
            app:cardCornerRadius="8dp"
            app:cardElevation="2dp">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="16dp">

                <ImageView
                    android:id="@+id/ivAbout"
                    android:layout_width="24dp"
                    android:layout_height="24dp"
                    android:src="@drawable/baseline_info_24"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent" />

                <TextView
                    android:id="@+id/tvAbout"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="16dp"
                    android:text="Tentang"
                    android:textSize="14sp"
                    app:layout_constraintStart_toEndOf="@id/ivAbout"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toStartOf="@id/ivAboutArrow" />

                <ImageView
                    android:id="@+id/ivAboutArrow"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/ic_arrow_right"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent" />
            </androidx.constraintlayout.widget.ConstraintLayout>
        </androidx.cardview.widget.CardView>

        <!-- Logout Card -->
        <androidx.cardview.widget.CardView
            android:id="@+id/card_logout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:foreground="?attr/selectableItemBackground"
            android:clickable="true"
            android:focusable="true"
            app:cardCornerRadius="8dp"
            app:cardElevation="2dp">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="16dp">

                <ImageView
                    android:id="@+id/ivLogout"
                    android:layout_width="24dp"
                    android:layout_height="24dp"
                    android:src="@drawable/baseline_logout_24"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent" />

                <TextView
                    android:id="@+id/tvLogout"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="16dp"
                    android:text="Keluar"
                    android:textSize="14sp"
                    app:layout_constraintStart_toEndOf="@id/ivLogout"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toStartOf="@id/ivLogoutArrow" />

                <ImageView
                    android:id="@+id/ivLogoutArrow"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/ic_arrow_right"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent" />
            </androidx.constraintlayout.widget.ConstraintLayout>
        </androidx.cardview.widget.CardView>

    </LinearLayout>


    <!-- About -->


    <!-- Logout -->



</androidx.constraintlayout.widget.ConstraintLayout>