<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/rootLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/bg_dark"
    android:fitsSystemWindows="true">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/appBarLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/surface_dark"
        android:fitsSystemWindows="true"
        app:elevation="0dp">

        <!-- Brand Header -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="72dp"
            android:orientation="horizontal"
            android:gravity="center_vertical"
            android:paddingStart="20dp"
            android:paddingEnd="20dp">

            <!-- NFC Icon -->
            <ImageView
                android:layout_width="36dp"
                android:layout_height="36dp"
                android:src="@drawable/ic_nfc"
                android:contentDescription="NFC" />

            <!-- Brand Text -->
            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="vertical"
                android:layout_marginStart="12dp">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/app_name_brand"
                    android:textColor="@color/accent_cyan"
                    android:textSize="22sp"
                    android:textStyle="bold"
                    android:letterSpacing="0.05" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/app_name_sub"
                    android:textColor="@color/text_secondary"
                    android:textSize="10sp"
                    android:letterSpacing="0.2" />

            </LinearLayout>

            <!-- NFC Status Dot -->
            <LinearLayout
                android:id="@+id/nfcStatusBadge"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:gravity="center_vertical"
                android:background="@drawable/bg_status_waiting"
                android:paddingHorizontal="10dp"
                android:paddingVertical="5dp">

                <View
                    android:id="@+id/nfcStatusDot"
                    android:layout_width="7dp"
                    android:layout_height="7dp"
                    android:background="@drawable/dot_active" />

                <TextView
                    android:id="@+id/tvNfcStatus"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="6dp"
                    android:text="NFC"
                    android:textColor="@color/accent_cyan"
                    android:textSize="11sp"
                    android:textStyle="bold"
                    android:letterSpacing="0.1" />

            </LinearLayout>

        </LinearLayout>

        <!-- Divider line under header -->
        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@color/divider" />

        <!-- Tabs -->
        <com.google.android.material.tabs.TabLayout
            android:id="@+id/tabLayout"
            android:layout_width="match_parent"
            android:layout_height="48dp"
            android:background="@color/surface_dark"
            app:tabMode="fixed"
            app:tabGravity="fill"
            app:tabTextColor="@color/text_secondary"
            app:tabSelectedTextColor="@color/accent_cyan"
            app:tabIndicatorColor="@color/accent_cyan"
            app:tabIndicatorHeight="2dp"
            app:tabIndicatorFullWidth="false"
            app:tabTextAppearance="@style/JrzTabText" />

    </com.google.android.material.appbar.AppBarLayout>

    <androidx.viewpager2.widget.ViewPager2
        android:id="@+id/viewPager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/bg_dark"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
