<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
    android:padding="16dp"
    android:background="@color/bg_base"
    tools:context=".ui.home.HomeFragment">

    <!-- Section Header -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_marginBottom="16dp">

        <TextView
            android:id="@+id/text_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fontFamily="@font/font_bebas_neue"
            android:text="CLASSIFICAÇÃO"
            android:textSize="28sp"
            android:textColor="@color/text_1"
            android:letterSpacing="0.04" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fontFamily="@font/font_ibm_plex_sans"
            android:text="Tabela classificativa em tempo real."
            android:textColor="@color/text_2"
            android:textSize="12sp"
            android:layout_marginTop="4dp" />
    </LinearLayout>

    <!-- Escaloes Toggle Group -->
    <com.google.android.material.button.MaterialButtonToggleGroup
        android:id="@+id/toggleGroupEscalao"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="14dp"
        app:checkedButton="@id/btnSeniores"
        android:gravity="center"
        app:singleSelection="true">

        <com.google.android.material.button.MaterialButton
            android:id="@+id/btnSeniores"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:fontFamily="@font/font_ibm_plex_sans"
            android:text="Seniores"
            android:textColor="@color/toggle_text_color"
            android:textSize="12sp"
            android:textStyle="bold"
            app:backgroundTint="@color/toggle_bg_color"
            app:strokeColor="@color/border"
            app:strokeWidth="1dp"
            app:cornerRadius="8dp" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/btnJuniores"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:fontFamily="@font/font_ibm_plex_sans"
            android:text="Juniores"
            android:textColor="@color/toggle_text_color"
            android:textSize="12sp"
            android:textStyle="bold"
            app:backgroundTint="@color/toggle_bg_color"
            app:strokeColor="@color/border"
            app:strokeWidth="1dp"
            app:cornerRadius="8dp" />
    </com.google.android.material.button.MaterialButtonToggleGroup>

    <!-- Table Container with Rounded Corners & Borders -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:orientation="vertical"
        android:background="@drawable/bg_match_item"> <!-- Uses 12dp corners, bg_surface, border stroke -->

        <!-- Table Header -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:paddingVertical="10dp"
            android:paddingHorizontal="12dp"
            android:background="@color/bg_elevated"
            android:gravity="center_vertical">

            <TextView
                android:layout_width="26dp"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="Pos"
                android:textColor="@color/text_3"
                android:textSize="9sp"
                android:textStyle="bold"
                android:fontFamily="@font/font_ibm_plex_mono" />

            <Space
                android:layout_width="30dp"
                android:layout_height="wrap_content" />

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="Clube"
                android:textColor="@color/text_3"
                android:textSize="9sp"
                android:textStyle="bold"
                android:fontFamily="@font/font_ibm_plex_mono" />

            <TextView
                android:layout_width="24dp"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="J"
                android:textColor="@color/text_3"
                android:textSize="9sp"
                android:textStyle="bold"
                android:fontFamily="@font/font_ibm_plex_mono" />

            <TextView
                android:layout_width="24dp"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="V"
                android:textColor="@color/text_3"
                android:textSize="9sp"
                android:textStyle="bold"
                android:fontFamily="@font/font_ibm_plex_mono" />

            <TextView
                android:layout_width="24dp"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="E"
                android:textColor="@color/text_3"
                android:textSize="9sp"
                android:textStyle="bold"
                android:fontFamily="@font/font_ibm_plex_mono" />

            <TextView
                android:layout_width="24dp"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="D"
                android:textColor="@color/text_3"
                android:textSize="9sp"
                android:textStyle="bold"
                android:fontFamily="@font/font_ibm_plex_mono" />

            <TextView
                android:layout_width="26dp"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="DG"
                android:textColor="@color/text_3"
                android:textSize="9sp"
                android:textStyle="bold"
                android:fontFamily="@font/font_ibm_plex_mono" />

            <TextView
                android:layout_width="32dp"
                android:layout_height="wrap_content"
                android:gravity="end"
                android:text="Pts"
                android:textColor="@color/brand"
                android:textSize="9sp"
                android:textStyle="bold"
                android:fontFamily="@font/font_ibm_plex_mono" />
        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@color/border" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recycler_standings"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:clipToPadding="false" />
    </LinearLayout>
</LinearLayout>