<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    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:fitsSystemWindows="true"
    tools:context=".ui.MainActivity">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/appBarLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:orientation="horizontal"
            android:gravity="center_vertical"
            android:paddingStart="16dp"
            android:paddingEnd="16dp">

            <ImageView
                android:id="@+id/logoButton"
                android:layout_width="36dp"
                android:layout_height="36dp"
                android:src="@drawable/ic_mistral_logo"
                android:contentDescription="@string/select_model"
                android:clickable="true"
                android:focusable="true" />

            <TextView
                android:id="@+id/toolbarTitle"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:layout_marginStart="12dp"
                android:text="Le Chat"
                android:textSize="20sp"
                android:textStyle="bold"
                android:textColor="?attr/colorOnSurface" />

            <ImageButton
                android:id="@+id/menuButton"
                android:layout_width="36dp"
                android:layout_height="36dp"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:src="@drawable/ic_menu_dots"
                android:contentDescription="@string/settings"
                android:clickable="true"
                android:focusable="true" />

        </LinearLayout>

    </com.google.android.material.appbar.AppBarLayout>

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/recyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/inputContainer"
        android:layout_below="@+id/appBarLayout"
        android:padding="16dp"
        android:clipToPadding="false" />

    <LinearLayout
        android:id="@+id/inputContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="vertical"
        android:background="?attr/colorSurface"
        android:padding="16dp">

        <com.google.android.material.progressindicator.LinearProgressIndicator
            android:id="@+id/progressIndicator"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:indeterminate="true"
            android:visibility="gone"
            android:layout_marginBottom="8dp" />

        <com.google.android.material.card.MaterialCardView
            android:id="@+id/inputCard"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardCornerRadius="28dp"
            app:cardElevation="4dp">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:paddingStart="8dp"
                android:paddingEnd="4dp">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/inputField"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:background="@android:color/transparent"
                    android:hint="@string/enter_message"
                    android:imeOptions="actionSend"
                    android:inputType="textMultiLine"
                    android:maxLines="5"
                    android:minHeight="56dp" />

                <ImageView
                    android:id="@+id/sendButton"
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:padding="8dp"
                    android:src="@drawable/ic_mistral_logo"
                    android:background="@drawable/bg_send_button"
                    android:contentDescription="@string/send"
                    android:clickable="true"
                    android:focusable="true" />

            </LinearLayout>

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

    </LinearLayout>

</RelativeLayout>