<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
    tools:context=".activities.SettingsActivity">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:padding="8dp"
        android:id="@+id/toolBar"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <androidx.appcompat.widget.AppCompatImageButton
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:src="@drawable/ic_back"
            android:scaleType="fitCenter"
            android:background="#00000000"
            android:padding="8dp"
            android:id="@+id/back"/>
        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:text="@string/settings"
            android:textSize="22sp"
            android:singleLine="true"
            android:padding="4dp"
            android:textStyle="bold"
            android:layout_weight="1"
            android:id="@+id/folderName"/>

    </LinearLayout>

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="?attr/actionBarSize"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

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

            <!-- App Details Section -->
            <com.google.android.material.card.MaterialCardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="16dp"
                app:cardElevation="1dp">

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

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/app_details"
                        android:textAppearance="?attr/textAppearanceTitleMedium"
                        android:textStyle="bold" />

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

                        <androidx.cardview.widget.CardView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            app:cardCornerRadius="10dp"
                            android:background="#00000000"
                            android:backgroundTint="#00000000"
                            app:cardElevation="0dp">
                            <ImageView
                                android:id="@+id/appLogo"
                                android:layout_width="48dp"
                                android:layout_height="48dp"
                                android:src="@mipmap/ic_launcher" />
                        </androidx.cardview.widget.CardView>


                        <LinearLayout
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="16dp"
                            android:layout_weight="1"
                            android:orientation="vertical">

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="@string/full_app_name"
                                android:textAppearance="?attr/textAppearanceBodyLarge" />

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="@string/version"
                                android:textAppearance="?attr/textAppearanceBodyMedium" />
                        </LinearLayout>

                        <com.google.android.material.button.MaterialButton
                            android:id="@+id/githubButton"
                            style="@style/Widget.Material3.Button.IconButton"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            app:icon="@drawable/ic_github" />
                    </LinearLayout>
                </LinearLayout>
            </com.google.android.material.card.MaterialCardView>

            <!-- Developer Details Section -->
            <com.google.android.material.card.MaterialCardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="16dp"
                app:cardElevation="1dp">

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

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/developer_details"
                        android:textAppearance="?attr/textAppearanceTitleMedium"
                        android:textStyle="bold" />

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

                        <TextView
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:text="@string/binondi_borthakur"
                            android:textAppearance="?attr/textAppearanceBodyLarge" />

                        <com.google.android.material.button.MaterialButton
                            android:id="@+id/devGithubButton"
                            style="@style/Widget.Material3.Button.IconButton"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            app:icon="@drawable/ic_github" />
                    </LinearLayout>
                </LinearLayout>
            </com.google.android.material.card.MaterialCardView>

            <!-- Theme Settings Section -->
            <com.google.android.material.card.MaterialCardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="16dp"
                app:cardElevation="1dp">

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

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/theme_settings"
                        android:textAppearance="?attr/textAppearanceTitleMedium"
                        android:textStyle="bold" />

                    <com.google.android.material.materialswitch.MaterialSwitch
                        android:id="@+id/dynamicThemeSwitch"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="16dp"
                        android:text="@string/dynamic_theme"
                        android:textAppearance="?attr/textAppearanceBodyLarge" />

                    <com.google.android.material.materialswitch.MaterialSwitch
                        android:id="@+id/themeModeSwitch"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="16dp"
                        android:text="@string/theme_mode"
                        android:textAppearance="?attr/textAppearanceBodyLarge" />

                    <RadioGroup
                        android:id="@+id/themeRadioGroup"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="32dp"
                        android:layout_marginTop="8dp">

                        <com.google.android.material.radiobutton.MaterialRadioButton
                            android:id="@+id/lightThemeRadio"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="@string/light" />

                        <com.google.android.material.radiobutton.MaterialRadioButton
                            android:id="@+id/darkThemeRadio"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="@string/dark" />

                        <com.google.android.material.radiobutton.MaterialRadioButton
                            android:id="@+id/systemThemeRadio"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="@string/system_default" />
                    </RadioGroup>
                </LinearLayout>
            </com.google.android.material.card.MaterialCardView>

            <!-- Security Settings Section -->
            <com.google.android.material.card.MaterialCardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:cardElevation="1dp">

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

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/security_settings"
                        android:textAppearance="?attr/textAppearanceTitleMedium"
                        android:textStyle="bold" />

                    <com.google.android.material.materialswitch.MaterialSwitch
                        android:id="@+id/screenshotRestrictionSwitch"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="16dp"
                        android:text="@string/restrict_screenshots_in_hidden_section"
                        android:textAppearance="?attr/textAppearanceBodyLarge" />

                    <com.google.android.material.materialswitch.MaterialSwitch
                        android:id="@+id/encryptionSwitch"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="16dp"
                        android:text="@string/encrypt_file_when_hiding"
                        android:textAppearance="?attr/textAppearanceBodyLarge" />

                    <com.google.android.material.materialswitch.MaterialSwitch
                        android:id="@+id/customKeyStatus"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="16dp"
                        android:text="@string/set_custom_encryption_key"
                        android:textAppearance="?attr/textAppearanceBodyLarge" />

                </LinearLayout>
            </com.google.android.material.card.MaterialCardView>

            <com.google.android.material.card.MaterialCardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginVertical="10dp"
                app:cardElevation="1dp">

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

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/app_settings"
                        android:textAppearance="?attr/textAppearanceTitleMedium"
                        android:textStyle="bold" />

                    <com.google.android.material.materialswitch.MaterialSwitch
                        android:id="@+id/showFileNames"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="16dp"
                        android:text="@string/show_file_names"
                        android:textAppearance="?attr/textAppearanceBodyLarge" />
                </LinearLayout>
            </com.google.android.material.card.MaterialCardView>

        </LinearLayout>
    </androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>