<?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:id="@+id/rootLayout"
    android:fitsSystemWindows="true"
    tools:context=".Jeux">

    <!-- Progress Bar -->
    <ProgressBar
        android:id="@+id/progressBar"
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="0dp"
        android:layout_height="8dp"
        android:layout_marginStart="16dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="16dp"
        android:max="100"
        android:progress="0"
        android:progressTint="@color/accent"
        android:progressBackgroundTint="@color/surface_variant"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <!-- Progress Text -->
    <TextView
        android:id="@+id/progressText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="4dp"
        android:text="Question 1 / 50"
        android:textColor="@color/text_secondary"
        android:textSize="12sp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/progressBar" />

    <!-- Question Type Indicator -->
    <LinearLayout
        android:id="@+id/questionIndicator"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:gravity="center"
        android:orientation="vertical"
        android:visibility="gone"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/progressText">

        <ImageView
            android:id="@+id/indicatorIcon"
            android:layout_width="32dp"
            android:layout_height="32dp"
            android:src="@drawable/ic_player_one"
            app:tint="@color/text_secondary" />

        <TextView
            android:id="@+id/indicatorText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:text="1 joueur"
            android:textColor="@color/text_secondary"
            android:textSize="12sp"
            android:textStyle="bold" />

    </LinearLayout>

    <!-- Main Question Container -->
    <com.google.android.material.card.MaterialCardView
        android:id="@+id/questionCard"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginStart="24dp"
        android:layout_marginTop="24dp"
        android:layout_marginEnd="24dp"
        android:layout_marginBottom="24dp"
        app:cardBackgroundColor="@color/card_background"
        app:cardCornerRadius="20dp"
        app:cardElevation="8dp"
        app:layout_constraintBottom_toTopOf="@id/buttonContainer"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/questionIndicator">

        <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="536dp"
                android:gravity="center"
                android:orientation="vertical"
                android:padding="24dp">

            <!-- Manche Question Text (petit) -->
            <TextView
                    android:id="@+id/mancheCounter"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="16dp"
                    android:background="@drawable/bg_card"
                    android:paddingStart="16dp"
                    android:paddingTop="8dp"
                    android:paddingEnd="16dp"
                    android:paddingBottom="8dp"
                    android:text="Manches: 5"
                    android:textColor="@color/primary"
                    android:textSize="14sp"
                    android:textStyle="bold"
                    android:visibility="gone"
                    tools:visibility="visible"/>
            <TextView
                    android:id="@+id/mancheQuestionText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="24dp"
                    android:gravity="center"
                    android:text="Défi en cours"
                    android:textColor="@color/text_secondary"
                    android:textSize="14sp"
                    android:textStyle="italic"
                    android:visibility="gone"/>

            <!-- Question Text -->
            <TextView
                    android:id="@+id/textView1"
                    style="@style/BoideloQuestionText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="16dp"
                    android:text="Question"
                    android:textSize="26sp"/>

            <!-- Manche Counter (if applicable) -->

        </LinearLayout>

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

    <!-- Button Container -->
    <LinearLayout
        android:id="@+id/buttonContainer"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="24dp"
        android:layout_marginEnd="24dp"
        android:layout_marginBottom="32dp"
        android:orientation="horizontal"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent">

        <!-- Skip Button -->

        <!-- Next Button -->
        <com.google.android.material.button.MaterialButton
                android:id="@+id/skipButton"
                style="@style/BoideloButton"
                android:layout_width="229dp"
                android:layout_height="match_parent"
                android:layout_marginEnd="8dp"
                android:layout_weight="1"
                android:onClick="onSkipClick"
                android:text="Abandonner le défi"
                android:textSize="12sp"
                android:textColor="@color/error"
                app:backgroundTint="@color/surface_variant"
                app:cornerRadius="28dp"/>
        <com.google.android.material.button.MaterialButton
                android:id="@+id/button"
                style="@style/BoideloButton.Primary"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginStart="8dp"
                android:layout_weight="2"
                android:onClick="OnClickButton1"
                android:text="Suivant"
                android:textSize="18sp"
                app:cornerRadius="28dp"
                app:icon="@android:drawable/ic_media_play"
                app:iconGravity="textEnd"/>

    </LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
