<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView 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:background="#F6F7FB"
    tools:context=".ui.alerts.AlertsFragment">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingBottom="24dp">

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="190dp">

            <View
                android:layout_width="match_parent"
                android:layout_height="190dp"
                android:background="@drawable/bg_header_top" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center"
                android:orientation="vertical">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/alerts_header_title"
                    android:textColor="#FFFFFF"
                    android:textSize="26sp"
                    android:textStyle="bold" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="6dp"
                    android:text="@string/alerts_header_subtitle"
                    android:textColor="#E1EAFF"
                    android:textSize="14sp" />
            </LinearLayout>
        </FrameLayout>

        <androidx.cardview.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="20dp"
            android:layout_marginTop="-50dp"
            android:layout_marginEnd="20dp"
            app:cardCornerRadius="20dp"
            app:cardElevation="4dp">

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

                <ImageView
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:src="@drawable/ic_alert_warning" />

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="14dp"
                    android:layout_weight="1"
                    android:orientation="vertical">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/alerts_summary_title"
                        android:textColor="#111827"
                        android:textSize="16sp"
                        android:textStyle="bold" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="4dp"
                        android:text="@string/alerts_summary_desc"
                        android:textColor="#6B7280" />
                </LinearLayout>
            </LinearLayout>
        </androidx.cardview.widget.CardView>

        <LinearLayout
            android:id="@+id/filterRow"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:gravity="center_horizontal"
            android:orientation="horizontal"
            android:paddingStart="20dp"
            android:paddingEnd="20dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@drawable/bg_filter_chip_active"
                android:text="@string/alerts_filter_all"
                android:textColor="#1C6CFF"
                android:textStyle="bold" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="12dp"
                android:background="@drawable/bg_filter_chip_neutral"
                android:text="@string/alerts_filter_pending"
                android:textColor="#64748B"
                android:textStyle="bold" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="12dp"
                android:background="@drawable/bg_filter_chip_neutral"
                android:text="@string/alerts_filter_resolved"
                android:textColor="#64748B"
                android:textStyle="bold" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/alertsList"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:orientation="vertical"
            android:paddingStart="20dp"
            android:paddingEnd="20dp">

            <com.google.android.material.card.MaterialCardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="12dp"
                app:cardBackgroundColor="#FFFFFF"
                app:cardCornerRadius="22dp"
                app:strokeColor="#E1E5EF"
                app:strokeWidth="1dp">

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

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

                        <FrameLayout
                            android:layout_width="56dp"
                            android:layout_height="56dp"
                            android:background="@drawable/bg_alert_icon_warning">

                            <ImageView
                                android:layout_width="match_parent"
                                android:layout_height="match_parent"
                                android:padding="14dp"
                                android:src="@drawable/ic_alert_warning" />
                        </FrameLayout>

                        <LinearLayout
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="16dp"
                            android:layout_weight="1"
                            android:orientation="vertical">

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="@string/alerts_school_title"
                                android:textColor="#111827"
                                android:textSize="17sp"
                                android:textStyle="bold" />

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="2dp"
                                android:text="@string/alerts_school_desc"
                                android:textColor="#6B7280" />
                        </LinearLayout>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:background="@drawable/bg_chip_warning"
                            android:text="@string/alerts_status_attention"
                            android:textColor="#B45309"
                            android:textStyle="bold" />
                    </LinearLayout>

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/alerts_school_time"
                            android:textColor="#0F172A"
                            android:textStyle="bold" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/alerts_school_action"
                            android:textColor="#1C6CFF"
                            android:textStyle="bold" />
                    </LinearLayout>
                </LinearLayout>
            </com.google.android.material.card.MaterialCardView>

            <com.google.android.material.card.MaterialCardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                app:cardBackgroundColor="#FFFFFF"
                app:cardCornerRadius="22dp"
                app:strokeColor="#E1E5EF"
                app:strokeWidth="1dp">

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

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

                        <FrameLayout
                            android:layout_width="56dp"
                            android:layout_height="56dp"
                            android:background="@drawable/bg_alert_icon_info">

                            <ImageView
                                android:layout_width="match_parent"
                                android:layout_height="match_parent"
                                android:padding="14dp"
                                android:src="@android:drawable/ic_dialog_info"
                                app:tint="#1F6AEF" />
                        </FrameLayout>

                        <LinearLayout
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="16dp"
                            android:layout_weight="1"
                            android:orientation="vertical">

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="@string/alerts_geofence_title"
                                android:textColor="#111827"
                                android:textSize="17sp"
                                android:textStyle="bold" />

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="2dp"
                                android:text="@string/alerts_geofence_desc"
                                android:textColor="#6B7280" />
                        </LinearLayout>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:background="@drawable/bg_chip_success"
                            android:text="@string/alerts_status_resolved"
                            android:textColor="#0F7A45"
                            android:textStyle="bold" />
                    </LinearLayout>

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/alerts_geofence_time"
                            android:textColor="#0F172A"
                            android:textStyle="bold" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/alerts_geofence_action"
                            android:textColor="#9CA3AF" />
                    </LinearLayout>
                </LinearLayout>
            </com.google.android.material.card.MaterialCardView>
        </LinearLayout>
    </LinearLayout>

</androidx.core.widget.NestedScrollView>
