<?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/novaReservaRoot"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorBackground"
    tools:context=".NovaReservaActivity">

    <!-- Header Section -->
    <com.google.android.material.button.MaterialButton
        android:id="@+id/btnVoltar"
        style="@style/Widget.Material3.Button.IconButton"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        app:icon="@android:drawable/ic_menu_revert"
        app:iconTint="@color/colorTextPrimary"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:id="@+id/txtTituloNovaReserva"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        android:text="Nova reserva"
        android:textColor="@color/colorTextPrimary"
        android:textSize="28sp"
        android:textStyle="bold"
        android:fontFamily="sans-serif"
        app:layout_constraintTop_toTopOf="@id/btnVoltar"
        app:layout_constraintBottom_toBottomOf="@id/btnVoltar"
        app:layout_constraintStart_toEndOf="@id/btnVoltar"
        app:layout_constraintEnd_toEndOf="parent" />

    <!-- Loading Spinner -->
    <ProgressBar
        android:id="@+id/progressBar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="gone"
        android:indeterminateTint="@color/colorPrimary"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/rvCategories"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginTop="16dp"
        android:visibility="visible"
        android:clipToPadding="false"
        android:paddingBottom="16dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/btnVoltar"
        tools:listitem="@layout/item_food_category" />

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/rvRestaurants"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginTop="16dp"
        android:visibility="gone"
        android:clipToPadding="false"
        android:paddingBottom="16dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/btnVoltar"
        tools:listitem="@layout/item_restaurant" />

    <ScrollView
        android:id="@+id/scrollNovaReserva"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginTop="16dp"
        android:fillViewport="true"
        android:visibility="gone"
        android:scrollbars="none"
        android:background="@color/colorBackground"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/btnVoltar">

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

            <com.google.android.material.card.MaterialCardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="24dp"
                android:layout_marginTop="8dp"
                app:cardCornerRadius="24dp"
                app:cardElevation="4dp"
                app:strokeWidth="0dp"
                app:cardBackgroundColor="@color/colorSurface">
                
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:padding="24dp">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Detalhes da Reserva"
                        android:textColor="@color/colorTextPrimary"
                        android:textSize="20sp"
                        android:textStyle="bold"
                        android:layout_marginBottom="24dp" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Data da reserva"
                        android:textColor="@color/colorTextSecondary"
                        android:textSize="14sp" />

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/btnSelectDate"
                        style="@style/Widget.Material3.Button.OutlinedButton"
                        android:layout_width="match_parent"
                        android:layout_height="56dp"
                        android:layout_marginTop="8dp"
                        app:cornerRadius="12dp"
                        android:text="Selecionar Data"
                        android:textAllCaps="false"
                        android:textColor="@color/colorTextPrimary"
                        app:strokeColor="@color/colorDivider" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="20dp"
                        android:text="Hora da reserva"
                        android:textColor="@color/colorTextSecondary"
                        android:textSize="14sp" />

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/btnSelectTime"
                        style="@style/Widget.Material3.Button.OutlinedButton"
                        android:layout_width="match_parent"
                        android:layout_height="56dp"
                        android:layout_marginTop="8dp"
                        app:cornerRadius="12dp"
                        android:text="Selecionar Hora"
                        android:textAllCaps="false"
                        android:textColor="@color/colorTextPrimary"
                        app:strokeColor="@color/colorDivider" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="20dp"
                        android:text="Número de pessoas"
                        android:textColor="@color/colorTextSecondary"
                        android:textSize="14sp" />

                    <EditText
                        android:id="@+id/etPartySize"
                        android:layout_width="match_parent"
                        android:layout_height="56dp"
                        android:layout_marginTop="8dp"
                        android:background="@drawable/bg_input_modern"
                        android:inputType="number"
                        android:paddingHorizontal="16dp"
                        android:hint="Ex: 2"
                        android:textColorHint="@color/colorTextHint"
                        android:textColor="@color/colorTextPrimary" />
                </LinearLayout>

            </com.google.android.material.card.MaterialCardView>

            <com.google.android.material.button.MaterialButton
                android:id="@+id/btnConfirmarReserva"
                android:layout_width="match_parent"
                android:layout_height="60dp"
                android:layout_marginHorizontal="24dp"
                android:layout_marginTop="32dp"
                app:cornerRadius="16dp"
                app:backgroundTint="@color/colorPrimary"
                android:text="Confirmar Reserva"
                android:textAllCaps="false"
                android:textColor="@color/white"
                android:textStyle="bold"
                android:textSize="18sp" />

        </LinearLayout>
    </ScrollView>

</androidx.constraintlayout.widget.ConstraintLayout>
