<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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/managementRoot"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingStart="20dp"
    android:paddingTop="12dp"
    android:paddingEnd="20dp"
    android:paddingBottom="16dp">

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

        <TextView
            android:id="@+id/btnBack"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:background="@drawable/bg_chip"
            android:clickable="true"
            android:focusable="true"
            android:gravity="center"
            android:text="@string/back"
            android:textColor="@color/white"
            android:textSize="18sp" />

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="8dp"
            android:layout_weight="1"
            android:gravity="center"
            android:maxLines="1"
            android:text="@string/face_management_title"
            android:textColor="@color/white"
            android:textSize="17sp"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/currentModel"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/bg_chip"
            android:gravity="center"
            android:maxLines="1"
            android:paddingStart="10dp"
            android:paddingTop="5dp"
            android:paddingEnd="10dp"
            android:paddingBottom="5dp"
            android:textColor="@color/liveness_accent"
            android:textSize="11sp"
            tools:text="Model · Megatron" />
    </LinearLayout>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        android:text="@string/face_library_heading"
        android:textColor="@color/white"
        android:textSize="28sp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/storageScope"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="6dp"
        android:textColor="@color/home_text_secondary"
        android:textSize="13sp"
        tools:text="Megatron uses an isolated feature DB and crop directory." />

    <TextView
        android:id="@+id/faceCount"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:textColor="@color/liveness_accent"
        android:textSize="12sp"
        tools:text="12 stored identities" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:gravity="center_vertical"
        android:orientation="horizontal">

        <com.google.android.material.textfield.TextInputLayout
            style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:hint="@string/search_faces">

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/searchInput"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:imeOptions="actionDone"
                android:inputType="text"
                android:maxLines="1"
                android:textColor="@color/white" />
        </com.google.android.material.textfield.TextInputLayout>

        <com.google.android.material.button.MaterialButton
            android:id="@+id/btnAddFace"
            android:layout_width="wrap_content"
            android:layout_height="56dp"
            android:layout_marginStart="10dp"
            android:enabled="false"
            android:text="@string/add_face"
            android:textColor="@color/home_tile_text_dark"
            app:backgroundTint="@color/liveness_accent" />
    </LinearLayout>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginTop="12dp"
        android:layout_weight="1">

        <ListView
            android:id="@+id/faceList"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:clipToPadding="false"
            android:divider="@android:color/transparent"
            android:dividerHeight="0dp"
            android:paddingBottom="8dp" />

        <LinearLayout
            android:id="@+id/emptyState"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center"
            android:orientation="vertical"
            android:padding="28dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/no_faces_title"
                android:textColor="@color/white"
                android:textSize="18sp"
                android:textStyle="bold" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="6dp"
                android:gravity="center"
                android:text="@string/no_faces_hint"
                android:textColor="@color/home_text_secondary"
                android:textSize="13sp" />
        </LinearLayout>

        <com.google.android.material.progressindicator.CircularProgressIndicator
            android:id="@+id/loadingIndicator"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_gravity="center"
            app:indicatorColor="@color/liveness_accent" />
    </FrameLayout>
</LinearLayout>
