<?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="@color/bg_dark"
    android:fillViewport="true">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingStart="16dp"
        android:paddingEnd="16dp"
        android:paddingTop="20dp"
        android:paddingBottom="24dp">

        <!-- NFC Scan Area -->
        <FrameLayout
            android:id="@+id/scanArea"
            android:layout_width="180dp"
            android:layout_height="180dp"
            android:layout_gravity="center_horizontal"
            android:layout_marginBottom="16dp">

            <!-- Pulse rings (animated in code) -->
            <View
                android:id="@+id/ring3"
                android:layout_width="180dp"
                android:layout_height="180dp"
                android:layout_gravity="center"
                android:background="@drawable/ring_pulse"
                android:alpha="0" />

            <View
                android:id="@+id/ring2"
                android:layout_width="140dp"
                android:layout_height="140dp"
                android:layout_gravity="center"
                android:background="@drawable/ring_pulse"
                android:alpha="0" />

            <View
                android:id="@+id/ring1"
                android:layout_width="100dp"
                android:layout_height="100dp"
                android:layout_gravity="center"
                android:background="@drawable/ring_pulse"
                android:alpha="0" />

            <!-- Center circle -->
            <FrameLayout
                android:layout_width="72dp"
                android:layout_height="72dp"
                android:layout_gravity="center"
                android:background="@drawable/bg_nfc_circle">

                <ImageView
                    android:id="@+id/ivNfcIcon"
                    android:layout_width="44dp"
                    android:layout_height="44dp"
                    android:layout_gravity="center"
                    android:src="@drawable/ic_nfc"
                    android:contentDescription="NFC" />

            </FrameLayout>

        </FrameLayout>

        <!-- Status Text -->
        <TextView
            android:id="@+id/tvStatus"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="20dp"
            android:text="@string/read_instruction"
            android:textAlignment="center"
            android:textColor="@color/text_secondary"
            android:textSize="14sp"
            android:letterSpacing="0.04" />

        <!-- UID Card -->
        <com.google.android.material.card.MaterialCardView
            android:id="@+id/cardUid"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:visibility="gone"
            app:cardBackgroundColor="@color/card_dark"
            app:cardCornerRadius="12dp"
            app:strokeColor="@color/accent_cyan_alpha20"
            app:strokeWidth="1dp">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:paddingStart="16dp"
                android:paddingEnd="8dp"
                android:paddingTop="12dp"
                android:paddingBottom="12dp">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="UID"
                    style="@style/JrzSectionLabel" />

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

                    <TextView
                        android:id="@+id/tvUid"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:fontFamily="monospace"
                        android:textColor="@color/accent_cyan"
                        android:textSize="17sp"
                        android:textStyle="bold"
                        android:letterSpacing="0.05" />

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/btnCopyUid"
                        style="@style/Widget.Material3.Button.IconButton"
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        android:contentDescription="@string/read_copy_uid"
                        app:icon="@android:drawable/ic_menu_share"
                        app:iconTint="@color/text_secondary" />

                </LinearLayout>

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

        <!-- Tag Type Card -->
        <com.google.android.material.card.MaterialCardView
            android:id="@+id/cardTagType"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:visibility="gone"
            app:cardBackgroundColor="@color/card_dark"
            app:cardCornerRadius="12dp"
            app:strokeColor="@color/divider"
            app:strokeWidth="1dp">

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

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="TAG-TYP"
                    style="@style/JrzSectionLabel" />

                <TextView
                    android:id="@+id/tvTagType"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="6dp"
                    android:textColor="@color/text_primary"
                    android:textSize="15sp"
                    android:textStyle="bold" />

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:layout_marginTop="12dp"
                    android:layout_marginBottom="12dp"
                    android:background="@color/divider" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="TECHNOLOGIEN"
                    style="@style/JrzSectionLabel" />

                <TextView
                    android:id="@+id/tvTechList"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="6dp"
                    android:fontFamily="monospace"
                    android:textColor="@color/text_mono"
                    android:textSize="12sp"
                    android:lineSpacingExtra="4dp" />

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

        <!-- NDEF Content Card -->
        <com.google.android.material.card.MaterialCardView
            android:id="@+id/cardNdef"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:visibility="gone"
            app:cardBackgroundColor="@color/card_dark"
            app:cardCornerRadius="12dp"
            app:strokeColor="@color/divider"
            app:strokeWidth="1dp">

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

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="NDEF-INHALT"
                    style="@style/JrzSectionLabel" />

                <TextView
                    android:id="@+id/tvNdefContent"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8dp"
                    android:fontFamily="monospace"
                    android:textColor="@color/text_mono"
                    android:textSize="13sp"
                    android:lineSpacingExtra="3dp" />

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

        <!-- Raw / Diagnose Card -->
        <com.google.android.material.card.MaterialCardView
            android:id="@+id/cardRaw"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:visibility="gone"
            app:cardBackgroundColor="@color/log_background"
            app:cardCornerRadius="12dp"
            app:strokeColor="@color/divider"
            app:strokeWidth="1dp">

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

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="ROHDATEN / DIAGNOSE"
                    style="@style/JrzSectionLabel"
                    android:textColor="@color/accent_cyan" />

                <TextView
                    android:id="@+id/tvRawPages"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8dp"
                    android:fontFamily="monospace"
                    android:textColor="@color/log_text"
                    android:textSize="11sp"
                    android:lineSpacingExtra="2dp" />

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

        <!-- Save Button -->
        <com.google.android.material.button.MaterialButton
            android:id="@+id/btnSaveDump"
            android:layout_width="match_parent"
            android:layout_height="52dp"
            android:layout_marginTop="8dp"
            android:text="@string/read_save_btn"
            android:textColor="@color/bg_dark"
            android:textStyle="bold"
            android:letterSpacing="0.08"
            android:visibility="gone"
            app:backgroundTint="@color/accent_cyan"
            app:cornerRadius="12dp" />

    </LinearLayout>
</ScrollView>
