<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView 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"
    style="?attr/materialCardViewFilledStyle"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="24dp"
    android:layout_marginHorizontal="12dp"
    android:background="?attr/selectableItemBackground"
    app:cardBackgroundColor="?attr/colorSurfaceVariant"
    android:clickable="true"
    android:focusable="true">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="12dp">

        <ImageView
            android:id="@+id/lock_icon"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:contentDescription="@string/multiplayer_password_protected"
            android:src="@drawable/ic_lock"
            android:visibility="gone"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:tint="?attr/colorOnSurface" />

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_marginEnd="8dp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintEnd_toStartOf="@id/lock_icon"
            app:layout_constraintBottom_toBottomOf="parent">

            <com.google.android.material.textview.MaterialTextView
                android:id="@+id/room_name"
                style="@style/TextAppearance.Material3.BodyMedium"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textAlignment="viewStart"
                android:textSize="16sp"
                android:textStyle="bold"
                android:textColor="?attr/colorOnSurface"
                tools:text="Room Name" />

            <com.google.android.material.textview.MaterialTextView
                android:id="@+id/room_owner"
                style="@style/TextAppearance.Material3.BodySmall"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="5dp"
                android:textAlignment="viewStart"
                android:textSize="14sp"
                android:textColor="?attr/colorOnSurfaceVariant"
                tools:text="Hosted by: Owner" />

            <LinearLayout
                android:id="@+id/game_info"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="5dp"
                android:orientation="horizontal">

                <ImageView
                    android:layout_width="16dp"
                    android:layout_height="16dp"
                    android:layout_gravity="center_vertical"
                    android:contentDescription="@string/multiplayer_game"
                    android:src="@drawable/ic_controller"
                    app:tint="?attr/colorOnSurfaceVariant" />

                <com.google.android.material.textview.MaterialTextView
                    android:id="@+id/game_name"
                    style="@style/TextAppearance.Material3.LabelMedium"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:ellipsize="end"
                    android:singleLine="true"
                    android:textStyle="bold"
                    android:textColor="?attr/colorOnSurface"
                    tools:text="Game Name" />
            </LinearLayout>
        </LinearLayout>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:gravity="center_vertical"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent">

            <ImageView
                android:layout_width="16dp"
                android:layout_height="16dp"
                android:src="@drawable/ic_user"
                android:contentDescription="@string/multiplayer_player_count"
                app:tint="?attr/colorPrimary" />

            <com.google.android.material.textview.MaterialTextView
                android:id="@+id/player_count"
                style="@style/TextAppearance.Material3.BodyMedium"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="4dp"
                android:textColor="?attr/colorPrimary"
                tools:text="2/4" />
        </LinearLayout>
    </androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>