<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2026 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<!-- For now, the layout direction is locked to LTR (left-anchored). -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/tab_search_overlay_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:layoutDirection="ltr"
    android:visibility="gone"
    android:background="@android:color/transparent">

    <!-- The left-anchored search panel elevated over SideUi containers -->
    <LinearLayout
        android:id="@+id/tab_search_overlay_panel"
        android:layout_width="@dimen/tab_search_overlay_width"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:background="@drawable/tab_search_overlay_panel_bg"
        android:clipToOutline="true"
        android:elevation="8dp"
        android:clickable="true"
        android:focusable="false">

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

            <ImageButton
                android:id="@+id/tab_search_close_button"
                android:layout_width="@dimen/tab_search_close_button_size"
                android:layout_height="@dimen/tab_search_close_button_size"
                android:layout_gravity="end|center_vertical"
                android:layout_marginEnd="@dimen/tab_search_close_button_margin_end"
                android:src="@drawable/ic_tab_close_tabstrip_24dp"
                android:padding="0dp"
                android:scaleType="fitCenter"
                android:background="@drawable/tab_close_button_bg_24dp"
                android:contentDescription="@string/close"
                android:focusable="true"
                android:clickable="true"
                android:importantForAccessibility="yes"
                android:accessibilityTraversalBefore="@id/search_activity_container" />
        </FrameLayout>

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1">

            <include
                android:id="@+id/search_activity_container"
                layout="@layout/search_activity"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

            <include
                android:id="@+id/empty_state_container"
                layout="@layout/empty_state_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="@dimen/toolbar_height_no_shadow"
                android:visibility="gone" />
        </FrameLayout>

    </LinearLayout>

    <!-- The transparent scrim area covering the rest of the screen -->
    <View
        android:id="@+id/tab_search_overlay_scrim"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:background="@android:color/transparent"
        android:clickable="true"
        android:focusable="false"
        android:importantForAccessibility="no" />

</LinearLayout>
