<?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:id="@+id/clientRoot"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFFFFF"
    tools:context=".ClientDashboardActivity">

    <!-- Top Bar with Profile Icon -->
    <androidx.cardview.widget.CardView
        android:id="@+id/cardProfile"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_marginStart="24dp"
        android:layout_marginTop="24dp"
        app:cardCornerRadius="22.5dp"
        app:cardElevation="2dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <ImageView
            android:id="@+id/imgProfile"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="centerCrop"
            android:src="@drawable/circle_bg" />
    </androidx.cardview.widget.CardView>

    <TextView
        android:id="@+id/txtClientGreeting"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:text="Olá, convidado"
        android:textColor="#000"
        android:textSize="20sp"
        android:textStyle="bold"
        app:layout_constraintBottom_toBottomOf="@id/cardProfile"
        app:layout_constraintStart_toEndOf="@id/cardProfile"
        app:layout_constraintTop_toTopOf="@id/cardProfile" />

    <Button
        android:id="@+id/btnVoltar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="16dp"
        android:text="Sair"
        android:textAllCaps="false"
        android:background="@android:color/transparent"
        android:textColor="#FF5252"
        app:layout_constraintBottom_toBottomOf="@id/cardProfile"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@id/cardProfile" />

    <ScrollView
        android:id="@+id/clientScroll"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginTop="16dp"
        android:fillViewport="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/cardProfile">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:paddingBottom="24dp">

            <!-- Categories Section -->
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="24dp"
                android:layout_marginTop="16dp"
                android:text="Categorias"
                android:textColor="#000"
                android:textSize="18sp"
                android:textStyle="bold" />

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/rvCategories"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="12dp"
                android:clipToPadding="false"
                android:orientation="horizontal"
                android:paddingStart="16dp"
                android:paddingEnd="16dp"
                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                tools:listitem="@layout/item_food_category" />

            <!-- Integrated Next Reservation Card -->
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="24dp"
                android:layout_marginTop="24dp"
                android:text="A sua próxima reserva"
                android:textColor="#000"
                android:textSize="18sp"
                android:textStyle="bold" />

            <androidx.cardview.widget.CardView
                android:id="@+id/cardNextReservation"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="24dp"
                android:layout_marginTop="12dp"
                app:cardBackgroundColor="#F8F9FA"
                app:cardCornerRadius="20dp"
                app:cardElevation="0dp">

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

                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content">

                        <TextView
                            android:id="@+id/txtResTitle"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Sabor &amp; Arte"
                            android:textColor="#000"
                            android:textSize="18sp"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/txtResTime"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_below="@id/txtResTitle"
                            android:layout_marginTop="4dp"
                            android:text="Amanhã às 20h00 • 2 pessoas"
                            android:textColor="#616161"
                            android:textSize="14sp" />

                        <ImageView
                            android:id="@+id/imgResIcon"
                            android:layout_width="50dp"
                            android:layout_height="50dp"
                            android:layout_alignParentEnd="true"
                            android:src="@drawable/circle_bg"
                            app:tint="#0066CC" />
                    </RelativeLayout>

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:layout_marginVertical="16dp"
                        android:background="#E0E0E0" />

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

                        <Button
                            android:id="@+id/btnCheckIn"
                            android:layout_width="0dp"
                            android:layout_height="45dp"
                            android:layout_marginEnd="6dp"
                            android:layout_weight="1"
                            android:background="@drawable/btn_primary"
                            android:text="Check-in"
                            android:textAllCaps="false"
                            android:textColor="#FFF"
                            android:textSize="14sp" />

                        <Button
                            android:id="@+id/btnPartilhar"
                            android:layout_width="0dp"
                            android:layout_height="45dp"
                            android:layout_marginStart="6dp"
                            android:layout_weight="1"
                            android:background="@drawable/btn_light_border"
                            android:text="Partilhar"
                            android:textAllCaps="false"
                            android:textColor="#000"
                            android:textSize="14sp" />
                    </LinearLayout>
                </LinearLayout>
            </androidx.cardview.widget.CardView>

            <!-- Actions Section -->
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="24dp"
                android:layout_marginTop="32dp"
                android:text="Mais opções"
                android:textColor="#000"
                android:textSize="18sp"
                android:textStyle="bold" />

            <GridLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="16dp"
                android:layout_marginTop="12dp"
                android:columnCount="1">

                <androidx.cardview.widget.CardView
                    android:id="@+id/cardNewRes"
                    android:layout_width="match_parent"
                    android:layout_height="100dp"
                    android:layout_margin="8dp"
                    app:cardCornerRadius="16dp"
                    app:cardElevation="2dp">
                    <LinearLayout
                        android:id="@+id/btnNovaReserva"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:gravity="center"
                        android:orientation="vertical"
                        android:background="?attr/selectableItemBackground">
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Reservar"
                            android:textColor="#000"
                            android:textSize="18sp"
                            android:textStyle="bold" />
                    </LinearLayout>
                </androidx.cardview.widget.CardView>

                <androidx.cardview.widget.CardView
                    android:id="@+id/cardMinhasReservas"
                    android:layout_width="match_parent"
                    android:layout_height="100dp"
                    android:layout_margin="8dp"
                    app:cardCornerRadius="16dp"
                    app:cardElevation="2dp">
                    <LinearLayout
                        android:id="@+id/btnMinhasReservas"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:gravity="center"
                        android:orientation="vertical"
                        android:background="?attr/selectableItemBackground">
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Minhas Reservas"
                            android:textColor="#000"
                            android:textSize="18sp"
                            android:textStyle="bold" />
                    </LinearLayout>
                </androidx.cardview.widget.CardView>

            </GridLayout>

            <!-- Status Section -->
            <TextView
                android:id="@+id/txtClientStatus"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="24dp"
                android:layout_marginTop="24dp"
                android:text="Tudo pronto para a sua próxima refeição!"
                android:textAlignment="center"
                android:textColor="#757575"
                android:textSize="14sp" />

            <TextView
                android:id="@+id/txtClientRole"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginTop="8dp"
                android:text="Modo Cliente"
                android:textColor="#BDBDBD"
                android:textSize="12sp" />

        </LinearLayout>
    </ScrollView>

</androidx.constraintlayout.widget.ConstraintLayout>


