<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView 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="wrap_content"
    android:layout_marginBottom="8dp"
    android:foreground="?attr/selectableItemBackground"
    app:cardCornerRadius="8dp"
    app:cardElevation="2dp">

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

        <!-- Device Icon -->
        <FrameLayout
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_marginEnd="16dp"
            android:background="@drawable/circle_background_blue">

            <ImageView
                android:layout_width="28dp"
                android:layout_height="28dp"
                android:layout_gravity="center"
                android:contentDescription="@string/reflector_scan_device_icon"
                android:src="@drawable/door_lock"
                app:tint="@color/silabs_blue" />
        </FrameLayout>

        <!-- Device Info -->
        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_weight="1"
            android:orientation="vertical">

            <TextView
                android:id="@+id/device_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:maxLines="1"
                android:textColor="@color/silabs_primary_text"
                android:textSize="16sp"
                android:textStyle="bold"
                tools:text="Silabs Example" />

            <TextView
                android:id="@+id/device_address"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="2dp"
                android:fontFamily="monospace"
                android:textColor="@color/silabs_subtle_text"
                android:textSize="12sp"
                tools:text="00:0B:57:8A:3C:F2" />

            <TextView
                android:id="@+id/device_type"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:background="@drawable/badge_background_blue"
                android:paddingHorizontal="8dp"
                android:paddingVertical="2dp"
                android:text="@string/reflector_scan_device_type"
                android:textColor="@color/silabs_blue"
                android:textSize="11sp" />
        </LinearLayout>

        <!-- RSSI -->
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:gravity="end"
            android:orientation="vertical">

            <TextView
                android:id="@+id/device_rssi"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="@color/silabs_green"
                android:textSize="14sp"
                android:textStyle="bold"
                tools:text="-42 dBm" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/reflector_scan_rssi_label"
                android:textColor="@color/silabs_subtle_text"
                android:textSize="10sp" />
        </LinearLayout>
    </LinearLayout>
</androidx.cardview.widget.CardView>
