<?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"
    android:id="@+id/weightLogRoot"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!-- Title -->
    <TextView
        android:id="@+id/weightLogTitle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="Weight Log"
        android:textSize="22sp"
        android:textStyle="bold"
        android:padding="16dp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

    <!-- Goal Section -->
    <LinearLayout
        android:id="@+id/goalSection"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:paddingStart="16dp"
        android:paddingEnd="16dp"
        android:paddingTop="8dp"
        app:layout_constraintTop_toBottomOf="@id/weightLogTitle"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent">

        <com.google.android.material.textfield.TextInputLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:hint="Goal Weight">

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/goalInput"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="numberDecimal" />

        </com.google.android.material.textfield.TextInputLayout>

        <Button
            android:id="@+id/setGoalButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Set"
            android:layout_marginStart="8dp" />
    </LinearLayout>

    <!-- Progress Summary -->
    <TextView
        android:id="@+id/progressSummaryText"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="Progress Summary&#10;No weight entries yet."
        android:textSize="14sp"
        android:paddingStart="16dp"
        android:paddingEnd="16dp"
        android:paddingTop="8dp"
        android:paddingBottom="8dp"
        app:layout_constraintTop_toBottomOf="@id/goalSection"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

    <!-- Headers -->
    <LinearLayout
        android:id="@+id/headerRow"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:paddingStart="16dp"
        android:paddingEnd="16dp"
        android:paddingTop="8dp"
        android:paddingBottom="8dp"
        app:layout_constraintTop_toBottomOf="@id/progressSummaryText"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent">

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Date"
            android:textStyle="bold" />

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Weight"
            android:textStyle="bold" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Delete"
            android:textStyle="bold" />
    </LinearLayout>

    <!-- Recycler -->
    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/weightRecyclerView"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:paddingStart="16dp"
        android:paddingEnd="16dp"
        android:paddingTop="8dp"
        android:paddingBottom="8dp"
        app:layout_constraintTop_toBottomOf="@id/headerRow"
        app:layout_constraintBottom_toTopOf="@id/addEntryFields"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

    <!-- Add Section -->
    <LinearLayout
        android:id="@+id/addEntryFields"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="16dp"
        app:layout_constraintBottom_toTopOf="@id/addEntryButton"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent">

        <com.google.android.material.textfield.TextInputLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:hint="Date">

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/dateInput"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="text" />

        </com.google.android.material.textfield.TextInputLayout>

        <com.google.android.material.textfield.TextInputLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:layout_marginStart="8dp"
            android:hint="Weight">

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/weightInput"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="numberDecimal" />

        </com.google.android.material.textfield.TextInputLayout>
    </LinearLayout>

    <Button
        android:id="@+id/addEntryButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Add Entry"
        android:layout_margin="16dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>