<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView 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:fillViewport="true">

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

        <!-- Header with modern styling -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:gravity="center_vertical"
            android:layout_marginBottom="24dp">

            <androidx.cardview.widget.CardView
                android:layout_width="48dp"
                android:layout_height="48dp"
                app:cardCornerRadius="12dp"
                app:cardElevation="0dp"
                android:background="?attr/colorPrimary">

                <ImageView
                    android:layout_width="24dp"
                    android:layout_height="24dp"
                    android:layout_gravity="center"
                    android:src="@drawable/ic_launcher"
                    android:scaleType="centerInside"
                    app:tint="@android:color/white" />

            </androidx.cardview.widget.CardView>

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

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/menu_legend"
                    android:textAppearance="?android:attr/textAppearanceLarge"
                    android:textColor="?android:attr/textColorPrimary" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Icon meanings and functions"
                    android:textAppearance="?android:attr/textAppearanceSmall"
                    android:textColor="?android:attr/textColorSecondary"
                    android:layout_marginTop="2dp" />

            </LinearLayout>
        </LinearLayout>

        <!-- Network Types Section -->
        <androidx.cardview.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardCornerRadius="16dp"
            app:cardElevation="2dp"
            android:layout_marginBottom="16dp">

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

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="Network Types"
                    android:textAppearance="?attr/textAppearanceSubtitle1"
                    android:textStyle="bold"
                    android:textColor="?attr/colorPrimary"
                    android:layout_marginBottom="16dp" />

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

                <!-- WiFi -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:gravity="center_vertical"
                    android:paddingVertical="12dp">

                    <androidx.cardview.widget.CardView
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        app:cardCornerRadius="20dp"
                        app:cardElevation="0dp"
                                                android:background="?attr/itemBackground">

                        <ImageView
                            android:layout_width="20dp"
                            android:layout_height="20dp"
                            android:layout_gravity="center"
                            android:src="@drawable/ic_wifi"
                            app:tint="?android:attr/textColorSecondary" />

                    </androidx.cardview.widget.CardView>

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Wi-Fi"
                            android:textAppearance="?android:attr/textAppearanceMedium"
                            android:textColor="?android:attr/textColorPrimary" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/legend_wifi"
                            android:textAppearance="?android:attr/textAppearanceSmall"
                            android:textColor="?android:attr/textColorSecondary"
                            android:layout_marginTop="2dp" />

                    </LinearLayout>
                </LinearLayout>

                <!-- Mobile Data -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:gravity="center_vertical"
                    android:paddingVertical="12dp">

                    <androidx.cardview.widget.CardView
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        app:cardCornerRadius="20dp"
                        app:cardElevation="0dp"
                                                android:background="?attr/itemBackground">

                        <ImageView
                            android:layout_width="20dp"
                            android:layout_height="20dp"
                            android:layout_gravity="center"
                            android:src="@drawable/ic_mobiledata"
                            app:tint="?android:attr/textColorSecondary" />

                    </androidx.cardview.widget.CardView>

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Mobile Data"
                            android:textAppearance="?android:attr/textAppearanceMedium"
                            android:textColor="?android:attr/textColorPrimary" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/legend_data"
                            android:textAppearance="?android:attr/textAppearanceSmall"
                            android:textColor="?android:attr/textColorSecondary"
                            android:layout_marginTop="2dp" />

                    </LinearLayout>
                </LinearLayout>

                <!-- LAN -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:gravity="center_vertical"
                    android:paddingVertical="12dp">

                    <androidx.cardview.widget.CardView
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        app:cardCornerRadius="20dp"
                        app:cardElevation="0dp"
                                                android:background="?attr/itemBackground">

                        <ImageView
                            android:id="@+id/ivWifiOn"
                            android:layout_width="20dp"
                            android:layout_height="20dp"
                            android:layout_gravity="center"
                            android:src="@drawable/ic_lan"
                            app:tint="?android:attr/textColorSecondary" />

                    </androidx.cardview.widget.CardView>

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="LAN"
                            android:textAppearance="?android:attr/textAppearanceMedium"
                            android:textColor="?android:attr/textColorPrimary" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/lan_summary"
                            android:textAppearance="?android:attr/textAppearanceSmall"
                            android:textColor="?android:attr/textColorSecondary"
                            android:layout_marginTop="2dp" />

                    </LinearLayout>
                </LinearLayout>

                <!-- Roaming -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:gravity="center_vertical"
                    android:paddingVertical="12dp">

                    <androidx.cardview.widget.CardView
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        app:cardCornerRadius="20dp"
                        app:cardElevation="0dp"
                                                android:background="?attr/itemBackground">

                        <ImageView
                            android:id="@+id/ivWifiOff"
                            android:layout_width="20dp"
                            android:layout_height="20dp"
                            android:layout_gravity="center"
                            android:src="@drawable/ic_roam"
                            app:tint="?android:attr/textColorSecondary" />

                    </androidx.cardview.widget.CardView>

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Roaming"
                            android:textAppearance="?android:attr/textAppearanceMedium"
                            android:textColor="?android:attr/textColorPrimary" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/legend_roam"
                            android:textAppearance="?android:attr/textAppearanceSmall"
                            android:textColor="?android:attr/textColorSecondary"
                            android:layout_marginTop="2dp" />

                    </LinearLayout>
                </LinearLayout>

                <!-- VPN -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:gravity="center_vertical"
                    android:paddingVertical="12dp">

                    <androidx.cardview.widget.CardView
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        app:cardCornerRadius="20dp"
                        app:cardElevation="0dp"
                                                android:background="?attr/itemBackground">

                        <ImageView
                            android:id="@+id/ivOtherOn"
                            android:layout_width="20dp"
                            android:layout_height="20dp"
                            android:layout_gravity="center"
                            android:src="@drawable/ic_vpn"
                            app:tint="?android:attr/textColorSecondary" />

                    </androidx.cardview.widget.CardView>

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="VPN"
                            android:textAppearance="?android:attr/textAppearanceMedium"
                            android:textColor="?android:attr/textColorPrimary" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/vpnSummary"
                            android:textAppearance="?android:attr/textAppearanceSmall"
                            android:textColor="?android:attr/textColorSecondary"
                            android:layout_marginTop="2dp" />

                    </LinearLayout>
                </LinearLayout>

                <!-- Tethering -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:gravity="center_vertical"
                    android:paddingVertical="12dp">

                    <androidx.cardview.widget.CardView
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        app:cardCornerRadius="20dp"
                        app:cardElevation="0dp"
                                                android:background="?attr/itemBackground">

                        <ImageView
                            android:id="@+id/ivTetherOn"
                            android:layout_width="20dp"
                            android:layout_height="20dp"
                            android:layout_gravity="center"
                            android:src="@drawable/ic_tether"
                            app:tint="?android:attr/textColorSecondary" />

                    </androidx.cardview.widget.CardView>

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Tethering"
                            android:textAppearance="?android:attr/textAppearanceMedium"
                            android:textColor="?android:attr/textColorPrimary" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/tetherSummary"
                            android:textAppearance="?android:attr/textAppearanceSmall"
                            android:textColor="?android:attr/textColorSecondary"
                            android:layout_marginTop="2dp" />

                    </LinearLayout>
                </LinearLayout>

                <!-- Tor -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:gravity="center_vertical"
                    android:paddingVertical="12dp">

                    <androidx.cardview.widget.CardView
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        app:cardCornerRadius="20dp"
                        app:cardElevation="0dp"
                                                android:background="?attr/itemBackground">

                        <ImageView
                            android:id="@+id/ivTorOn"
                            android:layout_width="20dp"
                            android:layout_height="20dp"
                            android:layout_gravity="center"
                            android:src="@drawable/ic_tor"
                            app:tint="?android:attr/textColorSecondary" />

                    </androidx.cardview.widget.CardView>

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Tor"
                            android:textAppearance="?android:attr/textAppearanceMedium"
                            android:textColor="?android:attr/textColorPrimary" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/torSummary"
                            android:textAppearance="?android:attr/textAppearanceSmall"
                            android:textColor="?android:attr/textColorSecondary"
                            android:layout_marginTop="2dp" />

                    </LinearLayout>
                </LinearLayout>

            </LinearLayout>
            </LinearLayout>
        </androidx.cardview.widget.CardView>

        <!-- Actions Section -->
        <androidx.cardview.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardCornerRadius="16dp"
            app:cardElevation="2dp"
            app:strokeWidth="0dp">

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

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="Actions"
                    android:textAppearance="?attr/textAppearanceSubtitle1"
                    android:textStyle="bold"
                    android:textColor="?attr/colorAccent"
                    android:layout_marginBottom="16dp" />

                <!-- Allow -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:gravity="center_vertical"
                    android:paddingVertical="12dp">

                    <androidx.cardview.widget.CardView
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        app:cardCornerRadius="20dp"
                        app:cardElevation="0dp"
                                                android:background="@android:color/holo_green_light">

                        <ImageView
                            android:id="@+id/ivOtherOff"
                            android:layout_width="20dp"
                            android:layout_height="20dp"
                            android:layout_gravity="center"
                            android:src="@drawable/ic_allow"
                            app:tint="@android:color/white" />

                    </androidx.cardview.widget.CardView>

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Allow"
                            android:textAppearance="?android:attr/textAppearanceMedium"
                            android:textColor="?android:attr/textColorPrimary" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/legend_whitelist"
                            android:textAppearance="?android:attr/textAppearanceSmall"
                            android:textColor="?android:attr/textColorSecondary"
                            android:layout_marginTop="2dp" />

                    </LinearLayout>
                </LinearLayout>

                <!-- Deny -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:gravity="center_vertical"
                    android:paddingVertical="12dp">

                    <androidx.cardview.widget.CardView
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        app:cardCornerRadius="20dp"
                        app:cardElevation="0dp"
                                                android:background="@android:color/holo_red_light">

                        <ImageView
                            android:id="@+id/ivScreenOn"
                            android:layout_width="20dp"
                            android:layout_height="20dp"
                            android:layout_gravity="center"
                            android:src="@drawable/ic_deny"
                            app:tint="@android:color/white" />

                    </androidx.cardview.widget.CardView>

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Deny"
                            android:textAppearance="?android:attr/textAppearanceMedium"
                            android:textColor="?android:attr/textColorPrimary" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/legend_blacklist"
                            android:textAppearance="?android:attr/textAppearanceSmall"
                            android:textColor="?android:attr/textColorSecondary"
                            android:layout_marginTop="2dp" />

                    </LinearLayout>
                </LinearLayout>

                <!-- Invert -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:gravity="center_vertical"
                    android:paddingVertical="12dp">

                    <androidx.cardview.widget.CardView
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        app:cardCornerRadius="20dp"
                        app:cardElevation="0dp"
                                                android:background="?attr/itemBackground">

                        <ImageView
                            android:id="@+id/flip"
                            android:layout_width="20dp"
                            android:layout_height="20dp"
                            android:layout_gravity="center"
                            android:src="@drawable/ic_invert"
                            app:tint="?android:attr/textColorSecondary" />

                    </androidx.cardview.widget.CardView>

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Invert"
                            android:textAppearance="?android:attr/textAppearanceMedium"
                            android:textColor="?android:attr/textColorPrimary" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/legend_invert"
                            android:textAppearance="?android:attr/textAppearanceSmall"
                            android:textColor="?android:attr/textColorSecondary"
                            android:layout_marginTop="2dp" />

                    </LinearLayout>
                </LinearLayout>

                <!-- Clear -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:gravity="center_vertical"
                    android:paddingVertical="12dp">

                    <androidx.cardview.widget.CardView
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        app:cardCornerRadius="20dp"
                        app:cardElevation="0dp"
                                                android:background="?attr/itemBackground">

                        <ImageView
                            android:id="@+id/ivHostAllowed"
                            android:layout_width="20dp"
                            android:layout_height="20dp"
                            android:layout_gravity="center"
                            android:src="@drawable/ic_clean"
                            app:tint="?android:attr/textColorSecondary" />

                    </androidx.cardview.widget.CardView>

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Clear"
                            android:textAppearance="?android:attr/textAppearanceMedium"
                            android:textColor="?android:attr/textColorPrimary" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/legend_clear"
                            android:textAppearance="?android:attr/textAppearanceSmall"
                            android:textColor="?android:attr/textColorSecondary"
                            android:layout_marginTop="2dp" />

                    </LinearLayout>
                </LinearLayout>

            </LinearLayout>
        </androidx.cardview.widget.CardView>

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