<?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="#F3F6FB">

    <!-- Header -->
    <FrameLayout
        android:id="@+id/chatHeader"
        android:layout_width="match_parent"
        android:layout_height="90dp"
        app:layout_constraintTop_toTopOf="parent">

        <View
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/bg_header_top" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginTop="16dp"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:paddingStart="16dp"
            android:paddingEnd="16dp">

            <ImageButton
                android:id="@+id/btnBack"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:src="@drawable/ic_navigation_plane"
                android:rotation="180"
                app:tint="#FFFFFF" />

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="16dp"
                android:orientation="vertical">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Chat de Família"
                    android:textColor="#FFFFFF"
                    android:textSize="20sp"
                    android:textStyle="bold" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="3 membros online"
                    android:textColor="#E1EAFF"
                    android:textSize="12sp" />
            </LinearLayout>
        </LinearLayout>
    </FrameLayout>

    <!-- Message List -->
    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/recycler_chat"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:paddingBottom="16dp"
        android:clipToPadding="false"
        app:layout_constraintBottom_toTopOf="@+id/footerInput"
        app:layout_constraintTop_toBottomOf="@+id/chatHeader" />

    <!-- Input Footer -->
    <LinearLayout
        android:id="@+id/footerInput"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#FFFFFF"
        android:elevation="8dp"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:padding="12dp"
        app:layout_constraintBottom_toBottomOf="parent">

        <EditText
            android:id="@+id/edit_chat_message"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@drawable/edit_text_background_light_gray"
            android:hint="Escreve uma mensagem..."
            android:padding="12dp"
            android:textSize="14sp" />

        <ImageButton
            android:id="@+id/btnSend"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_marginStart="8dp"
            android:background="?attr/selectableItemBackgroundBorderless"
            android:src="@drawable/ic_navigation_plane"
            app:tint="#1F6AEF" />
    </LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
