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

    <!-- 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/txtTituloFavoritos"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        android:text="Os Meus Favoritos"
        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="visible"
        android:indeterminateTint="@color/colorPrimary"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />
        
    <!-- Empty State -->
    <LinearLayout
        android:id="@+id/emptyState"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:gravity="center"
        android:visibility="gone"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent">
        
        <ImageView
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:src="@android:drawable/btn_star_big_off"
            app:tint="@color/colorDivider" />
            
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:text="Ainda não tens favoritos guardados."
            android:textColor="@color/colorTextSecondary"
            android:textSize="16sp" />
    </LinearLayout>

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/rvFavoritos"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginTop="16dp"
        android:clipToPadding="false"
        android:paddingBottom="24dp"
        app:layout_constraintTop_toBottomOf="@id/btnVoltar"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
        tools:listitem="@layout/item_restaurant" />

</androidx.constraintlayout.widget.ConstraintLayout>
