<?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="@drawable/background_toolbar"
    android:padding="16dp">

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

        <!-- Card de Perfil Personal -->
        <androidx.cardview.widget.CardView
            android:id="@+id/card_perfil"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="16dp"
            app:cardCornerRadius="12dp"
            app:cardElevation="4dp"
            app:cardUseCompatPadding="true">

            <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="👤 Información Personal"
                    android:textColor="@color/primary"
                    android:textSize="18sp"
                    android:textStyle="bold"
                    android:layout_marginBottom="16dp" />

                <com.google.android.material.textfield.TextInputLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="12dp"
                    android:hint="Nombre completo">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/edit_nombre"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textPersonName" />

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

                <com.google.android.material.textfield.TextInputLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="12dp"
                    android:hint="Email">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/edit_email"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textEmailAddress" />

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

                <com.google.android.material.textfield.TextInputLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="16dp"
                    android:hint="Nueva contraseña (opcional)"
                    app:endIconMode="password_toggle">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/edit_password"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textPassword" />

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

                <Button
                    android:id="@+id/btn_guardar_perfil"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="💾 Guardar Perfil"
                    android:textColor="@android:color/white"
                    android:textStyle="bold"
                    android:backgroundTint="#0D47A1"/>

            </LinearLayout>

        </androidx.cardview.widget.CardView>

        <!-- Card de Plan de Entrenamiento -->
        <androidx.cardview.widget.CardView
            android:id="@+id/card_plan"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardCornerRadius="12dp"
            app:cardElevation="4dp"
            app:cardUseCompatPadding="true">

            <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="🏋️ Plan de Entrenamiento"
                    android:textColor="@color/primary"
                    android:textSize="18sp"
                    android:textStyle="bold"
                    android:layout_marginBottom="16dp" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:layout_marginBottom="12dp">

                    <com.google.android.material.textfield.TextInputLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:layout_marginEnd="8dp"
                        android:hint="Edad"
                        app:startIconDrawable="@drawable/baseline_calendar_today_24">

                        <com.google.android.material.textfield.TextInputEditText
                            android:id="@+id/edit_edad"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:inputType="number" />

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

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

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="Sexo"
                            android:textColor="@color/text_secondary"
                            android:textSize="12sp"
                            android:layout_marginBottom="4dp" />

                        <Spinner
                            android:id="@+id/spinner_sexo"
                            android:layout_width="match_parent"
                            android:layout_height="48dp" />

                    </LinearLayout>

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:layout_marginBottom="12dp">

                    <com.google.android.material.textfield.TextInputLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:layout_marginEnd="8dp"
                        android:hint="Peso (kg)"
                        app:startIconDrawable="@drawable/ic_weight">

                        <com.google.android.material.textfield.TextInputEditText
                            android:id="@+id/edit_peso"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:inputType="numberDecimal" />

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

                    <com.google.android.material.textfield.TextInputLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:layout_marginStart="8dp"
                        android:hint="Altura (cm)"
                        app:startIconDrawable="@drawable/ic_height">

                        <com.google.android.material.textfield.TextInputEditText
                            android:id="@+id/edit_altura"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:inputType="numberDecimal" />

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

                </LinearLayout>

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

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="Objetivo"
                        android:textColor="@color/text_secondary"
                        android:textSize="12sp"
                        android:layout_marginBottom="4dp" />

                    <Spinner
                        android:id="@+id/spinner_objetivo"
                        android:layout_width="match_parent"
                        android:layout_height="48dp"
                        android:layout_marginBottom="12dp" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:layout_marginBottom="16dp">

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

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="Intensidad"
                            android:textColor="@color/text_secondary"
                            android:textSize="12sp"
                            android:layout_marginBottom="4dp" />

                        <Spinner
                            android:id="@+id/spinner_intensidad"
                            android:layout_width="match_parent"
                            android:layout_height="48dp" />

                    </LinearLayout>

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

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="Días/semana"
                            android:textColor="@color/text_secondary"
                            android:textSize="12sp"
                            android:layout_marginBottom="4dp" />

                        <Spinner
                            android:id="@+id/spinner_dias"
                            android:layout_width="match_parent"
                            android:layout_height="48dp" />

                    </LinearLayout>

                </LinearLayout>

                <Button
                    android:id="@+id/btn_actualizar_plan"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:backgroundTint="#0D47A1"
                    android:text="🔄 Actualizar Plan"
                    android:textColor="@android:color/white"
                    android:textStyle="bold" />

            </LinearLayout>

        </androidx.cardview.widget.CardView>

    </LinearLayout>

</ScrollView>