<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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="wrap_content">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="16dp"
        android:minWidth="300dp">

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/tilTitle"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/title">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/etTitle"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="text"
            android:maxLines="1"
            android:imeOptions="actionNext" />

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

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/tilContent"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:hint="@string/content">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/etContent"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:minHeight="120dp"
            android:inputType="textMultiLine"
            android:gravity="top" />

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

    <LinearLayout
        android:id="@+id/voiceNoteRow"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:orientation="horizontal"
        android:gravity="center_vertical"
        android:visibility="visible">

        <ImageButton
            android:id="@+id/btnVoiceRecord"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:background="?attr/selectableItemBackgroundBorderless"
            android:contentDescription="@string/voice_note"
            android:src="@drawable/ic_mic"
            android:scaleType="center"
            android:focusable="false"
            android:focusableInTouchMode="false" />

        <TextView
            android:id="@+id/textVoiceStatus"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:layout_marginStart="8dp"
            android:text="@string/voice_note"
            android:textSize="14sp"
            android:textColor="?attr/colorOnSurfaceVariant" />

    </LinearLayout>

    <LinearLayout
        android:id="@+id/photoRow"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:orientation="horizontal"
        android:gravity="center_vertical"
        android:visibility="visible">

        <ImageButton
            android:id="@+id/btnAddPhoto"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:background="?attr/selectableItemBackgroundBorderless"
            android:contentDescription="@string/photo_add"
            android:src="@android:drawable/ic_menu_gallery"
            android:scaleType="center"
            android:focusable="false"
            android:focusableInTouchMode="false" />

        <TextView
            android:id="@+id/textPhotoStatus"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:layout_marginStart="8dp"
            android:text="@string/photo_add"
            android:textSize="14sp"
            android:textColor="?attr/colorOnSurfaceVariant" />

        <ImageView
            android:id="@+id/imgPhotoPreview"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:scaleType="centerCrop"
            android:visibility="gone" />

        <ImageButton
            android:id="@+id/btnRemovePhoto"
            android:layout_width="32dp"
            android:layout_height="32dp"
            android:background="?attr/selectableItemBackgroundBorderless"
            android:contentDescription="@string/photo_remove"
            android:src="@android:drawable/ic_menu_close_clear_cancel"
            android:scaleType="center"
            android:visibility="gone"
            android:focusable="false"
            android:focusableInTouchMode="false" />

    </LinearLayout>

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

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/category"
            android:textSize="14sp"
            android:textStyle="bold"
            android:textColor="?attr/colorPrimary" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/btnManageCategories"
            style="@style/Widget.Material3.Button.TextButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/manage_categories"
            android:textSize="12sp" />

    </LinearLayout>

    <com.google.android.material.chip.ChipGroup
        android:id="@+id/chipGroupCategory"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="4dp"
        app:singleSelection="true"
        app:selectionRequired="false"
        app:chipSpacing="4dp" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:text="@string/set_reminder"
        android:textSize="14sp"
        android:textStyle="bold"
        android:textColor="?attr/colorPrimary" />

    <com.google.android.material.materialswitch.MaterialSwitch
        android:id="@+id/switchReminder"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="4dp"
        android:text="@string/set_reminder" />

    <LinearLayout
        android:id="@+id/reminderFields"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:orientation="horizontal"
        android:visibility="gone">

        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/tilDate"
            style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:layout_marginEnd="4dp"
            android:hint="@string/reminder_date"
            android:focusable="false"
            android:clickable="true">

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/etDate"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="none"
                android:focusable="false"
                android:clickable="true"
                android:cursorVisible="false" />

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

        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/tilTime"
            style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:layout_marginStart="4dp"
            android:hint="@string/reminder_time"
            android:focusable="false"
            android:clickable="true">

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/etTime"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="none"
                android:focusable="false"
                android:clickable="true"
                android:cursorVisible="false" />

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

    </LinearLayout>

    <TextView
        android:id="@+id/labelRecurrence"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="12dp"
        android:text="@string/recurrence"
        android:textSize="14sp"
        android:textStyle="bold"
        android:textColor="?attr/colorPrimary"
        android:visibility="gone" />

    <RadioGroup
        android:id="@+id/radioRecurrence"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="4dp"
        android:orientation="vertical"
        android:visibility="gone">

        <RadioButton
            android:id="@+id/radioNone"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/recurrence_none"
            android:checked="true" />

        <RadioButton
            android:id="@+id/radioDaily"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/recurrence_daily" />

        <RadioButton
            android:id="@+id/radioWeekly"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/recurrence_weekly" />

        <RadioButton
            android:id="@+id/radioMonthly"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/recurrence_monthly" />

        <RadioButton
            android:id="@+id/radioYearly"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/recurrence_yearly" />

    </RadioGroup>

    </LinearLayout>

</ScrollView>
