<?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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="?attr/colorSurface"
    android:fitsSystemWindows="true">

    <!-- Material 3 Toolbar -->
    <com.google.android.material.appbar.MaterialToolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:elevation="0dp"
        app:navigationIcon="?attr/homeAsUpIndicator"
        app:title="@string/edit_note"
        app:titleTextAppearance="@style/TextAppearance.Material3.TitleLarge" />

    <!-- Title Input (für beide Typen) -->
    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/tilTitle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="16dp"
        android:hint="@string/title"
        style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
        app:boxCornerRadiusTopStart="16dp"
        app:boxCornerRadiusTopEnd="16dp"
        app:boxCornerRadiusBottomStart="16dp"
        app:boxCornerRadiusBottomEnd="16dp"
        app:endIconMode="clear_text"
        app:counterEnabled="true"
        app:counterMaxLength="100">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/editTextTitle"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="text"
            android:maxLines="2"
            android:maxLength="100"
            android:textAppearance="@style/TextAppearance.Material3.BodyLarge" />

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

    <!-- Content Input (nur für TEXT sichtbar) -->
    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/tilContent"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        android:layout_marginBottom="16dp"
        android:hint="@string/content"
        style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
        app:boxCornerRadiusTopStart="16dp"
        app:boxCornerRadiusTopEnd="16dp"
        app:boxCornerRadiusBottomStart="16dp"
        app:boxCornerRadiusBottomEnd="16dp"
        app:endIconMode="clear_text"
        app:counterEnabled="true"
        app:counterMaxLength="10000">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/editTextContent"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="top|start"
            android:inputType="textMultiLine"
            android:scrollbars="vertical"
            android:maxLength="10000"
            android:textAppearance="@style/TextAppearance.Material3.BodyMedium" />

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

    <!-- v1.4.0: Checklist Container (nur für CHECKLIST sichtbar) -->
    <LinearLayout
        android:id="@+id/checklistContainer"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:orientation="vertical"
        android:visibility="gone"
        tools:visibility="visible">

        <!-- Checklist Items RecyclerView -->
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rvChecklistItems"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:layout_marginHorizontal="8dp"
            android:clipToPadding="false"
            android:paddingBottom="8dp"
            app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
            tools:listitem="@layout/item_checklist_editor" />

        <!-- Add Item Button -->
        <com.google.android.material.button.MaterialButton
            android:id="@+id/btnAddItem"
            style="@style/Widget.Material3.Button.TextButton.Icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:layout_marginBottom="16dp"
            android:text="@string/add_item"
            app:icon="@android:drawable/ic_input_add" />

    </LinearLayout>

</LinearLayout>
