<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    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:background="@drawable/background_toolbar"
    android:padding="24dp">

    <!-- Header Icon -->
    <com.google.android.material.card.MaterialCardView
        android:id="@+id/iconCard"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_marginTop="40dp"
        app:cardCornerRadius="40dp"
        app:cardElevation="8dp"
        app:cardBackgroundColor="@color/primary"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent">

        <ImageView
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_gravity="center"
            android:src="@drawable/ic_fitness_center"
            app:tint="@android:color/white" />

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

    <!-- Pregunta Principal -->
    <TextView
        android:id="@+id/textPreguntaDias"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="¿Cuántos días a la semana\nquieres entrenar?"
        android:textSize="28sp"
        android:textStyle="bold"
        android:textColor="@android:color/white"
        android:gravity="center"
        android:lineSpacingExtra="4dp"
        android:layout_marginTop="24dp"
        app:layout_constraintTop_toBottomOf="@id/iconCard"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

    <!-- Subtítulo -->
    <TextView
        android:id="@+id/textSubtitulo"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="Selecciona la frecuencia ideal para tu rutina"
        android:textSize="16sp"
        android:textColor="@android:color/white"
        android:alpha="0.8"
        android:gravity="center"
        android:layout_marginTop="8dp"
        app:layout_constraintTop_toBottomOf="@id/textPreguntaDias"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

    <!-- Card Container para el Spinner -->
    <com.google.android.material.card.MaterialCardView
        android:id="@+id/spinnerCard"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="40dp"
        android:layout_marginHorizontal="16dp"
        app:cardCornerRadius="20dp"
        app:cardElevation="12dp"
        app:cardBackgroundColor="@android:color/white"
        app:layout_constraintTop_toBottomOf="@id/textSubtitulo"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent">

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

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

                <ImageView
                    android:layout_width="24dp"
                    android:layout_height="24dp"
                    android:src="@drawable/baseline_calendar_today_24"
                    app:tint="@color/primary"
                    android:layout_marginEnd="12dp" />

                <TextView
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="Días por semana"
                    android:textSize="18sp"
                    android:textStyle="bold"
                    android:textColor="@color/primary" />

            </LinearLayout>

            <!-- Spinner Personalizado -->
            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/rounded_rect_orange"
                android:padding="16dp">

                <Spinner
                    android:id="@+id/spinnerDias"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="12dp"
                    android:background="@android:color/transparent"
                    android:dropDownWidth="match_parent"
                    android:popupBackground="@color/white"
                    android:spinnerMode="dropdown"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toStartOf="@id/spinnerIcon"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent" />

                <ImageView
                    android:id="@+id/spinnerIcon"
                    android:layout_width="24dp"
                    android:layout_height="24dp"
                    android:src="@drawable/baseline_keyboard_arrow_down_24"
                    app:tint="@color/primary"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent" />

            </androidx.constraintlayout.widget.ConstraintLayout>

            <!-- Información Adicional -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_marginTop="16dp"
                android:padding="12dp"
                android:background="@color/white"
                android:gravity="center_vertical">

                <ImageView
                    android:layout_width="20dp"
                    android:layout_height="20dp"
                    android:src="@drawable/baseline_info_24"
                    app:tint="@color/info"
                    android:layout_marginEnd="8dp" />

                <TextView
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="Recomendamos 3-4 días para principiantes"
                    android:textSize="14sp"
                    android:textColor="@color/info" />

            </LinearLayout>

        </LinearLayout>

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

    <!-- Botón Continuar -->
    <com.google.android.material.button.MaterialButton
        android:id="@+id/btnContinuarDias"
        android:layout_width="0dp"
        android:layout_height="56dp"
        android:layout_marginHorizontal="24dp"
        android:layout_marginTop="24dp"
        android:layout_marginBottom="32dp"
        android:text="Continuar"
        android:enabled="false"
        android:textSize="18sp"
        android:textStyle="bold"
        android:textAllCaps="false"
        app:backgroundTint="@color/primary"
        app:cornerRadius="28dp"
        app:elevation="8dp"
        app:icon="@drawable/ic_arrow_forward"
        app:iconGravity="end"
        app:iconTint="@android:color/white"
        app:rippleColor="@color/primary_light"
        android:textColor="@android:color/white"
        app:layout_constraintTop_toBottomOf="@id/infoCard"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintBottom_toBottomOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>