<?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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@color/surface_background">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@color/surface_background"
        app:navigationIcon="@drawable/ic_round_back_button">

        <TextView
            android:id="@+id/tvToolbarTitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Rate Cow"
            android:textSize="20sp"
            android:textStyle="bold"
            android:textColor="@color/text_primary"/>

    </androidx.appcompat.widget.Toolbar>

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="24dp">

            <TextView
                android:id="@+id/tvHeaderPhotos"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Photos"
                android:textSize="18sp"
                android:textStyle="bold"
                android:textColor="@color/text_primary"
                android:layout_marginBottom="8dp"/>

            <LinearLayout
                android:id="@+id/ratingImagesContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:layout_marginBottom="24dp"
                android:minHeight="100dp"/>

            <androidx.cardview.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:cardCornerRadius="12dp"
                app:cardElevation="2dp"
                android:layout_marginBottom="24dp">
                
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:padding="16dp"
                    android:background="@color/input_background">
                    
                    <TextView
                        android:id="@+id/tvHeaderCowDetails"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Cow Details"
                        android:textSize="18sp"
                        android:textStyle="bold"
                        android:textColor="@color/text_secondary"
                        android:layout_marginBottom="8dp"/>
                        
                    <TextView
                        android:id="@+id/tvCowDetails"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textSize="14sp"
                        android:textColor="@color/text_primary"
                        android:lineSpacingExtra="4dp"/>
                </LinearLayout>
            </androidx.cardview.widget.CardView>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/tilComments"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="24dp"
                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                app:boxCornerRadiusTopStart="12dp"
                app:boxCornerRadiusTopEnd="12dp"
                app:boxCornerRadiusBottomStart="12dp"
                app:boxCornerRadiusBottomEnd="12dp"
                app:boxStrokeColor="@color/text_tertiary"
                android:hint="Comments"
                android:textColorHint="@color/text_secondary">

                <com.google.android.material.textfield.TextInputEditText
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textMultiLine"
                    android:minLines="3"
                    android:gravity="top"
                    android:textColor="@color/text_primary"/>
            </com.google.android.material.textfield.TextInputLayout>

            <TextView
                android:id="@+id/tvHeaderFeatureRatings"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Feature Ratings"
                android:textSize="18sp"
                android:textStyle="bold"
                android:textColor="@color/text_primary"
                android:layout_marginBottom="16dp"/>

            <LinearLayout
                android:id="@+id/ratingsContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:layout_marginBottom="24dp"/>

            <com.google.android.material.button.MaterialButton
                android:id="@+id/btnSaveRating"
                android:layout_width="match_parent"
                android:layout_height="56dp"
                android:text="Save Rating"
                android:textSize="16sp"
                android:textStyle="bold"
                android:textColor="@color/white"
                app:cornerRadius="12dp"
                app:backgroundTint="@color/earthy"
                android:layout_marginBottom="16dp"/>

            <com.google.android.material.button.MaterialButton
                android:id="@+id/btnCancelRating"
                android:layout_width="match_parent"
                android:layout_height="56dp"
                android:text="Cancel"
                android:textSize="16sp"
                android:textStyle="bold"
                android:textColor="@color/icon_tint_primary"
                app:cornerRadius="12dp"
                app:backgroundTint="@color/input_background"
                app:strokeColor="@color/icon_tint_primary"
                app:strokeWidth="1dp"/>

        </LinearLayout>
    </ScrollView>
</LinearLayout>