<?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="match_parent"
    android:background="@color/bg_base">

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

        <!-- Section Header -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_marginBottom="16dp">

            <TextView
                android:id="@+id/textTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:fontFamily="@font/font_bebas_neue"
                android:text="DEFINIÇÕES"
                android:textSize="28sp"
                android:textColor="@color/text_1"
                android:letterSpacing="0.04" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:fontFamily="@font/font_ibm_plex_sans"
                android:text="Personaliza a aplicação de acordo com o teu gosto."
                android:textColor="@color/text_2"
                android:textSize="12sp"
                android:layout_marginTop="4dp" />
        </LinearLayout>

        <!-- Card: Conta -->
        <com.google.android.material.card.MaterialCardView
            android:id="@+id/cardConta"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="12dp"
            android:clickable="true"
            android:focusable="true"
            android:foreground="?attr/selectableItemBackground"
            app:cardCornerRadius="12dp"
            app:cardElevation="0dp"
            app:strokeColor="@color/border"
            app:strokeWidth="1dp"
            app:cardBackgroundColor="@color/bg_surface">

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

                <ImageView
                    android:layout_width="36dp"
                    android:layout_height="36dp"
                    android:contentDescription="@string/menu_definicoes"
                    android:padding="4dp"
                    android:src="@android:drawable/ic_menu_manage"
                    app:tint="@color/brand"/>

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

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:fontFamily="@font/font_ibm_plex_sans"
                        android:text="Conta"
                        android:textColor="@color/text_1"
                        android:textSize="15sp"
                        android:textStyle="bold" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:fontFamily="@font/font_ibm_plex_sans"
                        android:text="Atualiza os teus dados pessoais"
                        android:textColor="@color/text_2"
                        android:textSize="12sp"
                        android:layout_marginTop="2dp" />
                </LinearLayout>

                <ImageView
                    android:layout_width="16dp"
                    android:layout_height="16dp"
                    android:contentDescription="@string/menu_definicoes"
                    android:src="@android:drawable/ic_media_next"
                    app:tint="@color/text_3"/>
            </LinearLayout>
        </com.google.android.material.card.MaterialCardView>

        <!-- Card: Preferências -->
        <com.google.android.material.card.MaterialCardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="12dp"
            app:cardCornerRadius="12dp"
            app:cardElevation="0dp"
            app:strokeColor="@color/border"
            app:strokeWidth="1dp"
            app:cardBackgroundColor="@color/bg_surface">

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

                <!-- Notifications Row -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center_vertical"
                    android:orientation="horizontal">

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:fontFamily="@font/font_ibm_plex_sans"
                            android:text="Notificações"
                            android:textColor="@color/text_1"
                            android:textSize="15sp"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/textNotificationsStatus"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:fontFamily="@font/font_ibm_plex_sans"
                            android:text="Ativadas"
                            android:textColor="@color/text_2"
                            android:textSize="12sp"
                            android:layout_marginTop="2dp" />
                    </LinearLayout>

                    <com.google.android.material.switchmaterial.SwitchMaterial
                        android:id="@+id/switchNotifications"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:checked="true"
                        app:thumbTint="@color/brand"
                        app:trackTint="@color/brand_dim" />
                </LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:layout_marginVertical="14dp"
                    android:background="@color/border" />

                <!-- Dark Mode Row -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center_vertical"
                    android:orientation="horizontal">

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:fontFamily="@font/font_ibm_plex_sans"
                            android:text="Modo escuro"
                            android:textColor="@color/text_1"
                            android:textSize="15sp"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/textDarkModeStatus"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:fontFamily="@font/font_ibm_plex_sans"
                            android:text="Ativo"
                            android:textColor="@color/text_2"
                            android:textSize="12sp"
                            android:layout_marginTop="2dp" />
                    </LinearLayout>

                    <com.google.android.material.switchmaterial.SwitchMaterial
                        android:id="@+id/switchDarkMode"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:checked="true"
                        app:thumbTint="@color/brand"
                        app:trackTint="@color/brand_dim" />
                </LinearLayout>
            </LinearLayout>
        </com.google.android.material.card.MaterialCardView>

        <!-- Card: Suporte -->
        <com.google.android.material.card.MaterialCardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardCornerRadius="12dp"
            app:cardElevation="0dp"
            app:strokeColor="@color/border"
            app:strokeWidth="1dp"
            app:cardBackgroundColor="@color/bg_surface">

            <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:fontFamily="@font/font_ibm_plex_sans"
                    android:text="Ajuda e suporte"
                    android:textColor="@color/text_1"
                    android:textSize="15sp"
                    android:textStyle="bold" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:fontFamily="@font/font_ibm_plex_sans"
                    android:text="Consulta a nossa base de conhecimento ou fala connosco."
                    android:textColor="@color/text_2"
                    android:textSize="12sp" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/btnOpenSystemSettings"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="16dp"
                    app:backgroundTint="@color/brand"
                    android:text="Abrir definições do sistema"
                    android:fontFamily="@font/font_ibm_plex_sans"
                    android:textAllCaps="false"
                    android:textColor="@color/bg_base"
                    android:textStyle="bold"
                    app:cornerRadius="8dp" />
            </LinearLayout>
        </com.google.android.material.card.MaterialCardView>
    </LinearLayout>
</ScrollView>
