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

<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <!-- State order is critical: most specific states must come first. -->

  <!-- 1. State: Mouse-click on a hovered button. -->
  <item android:state_hovered="true" android:state_pressed="true">
    <ripple android:color="@color/color_on_surface_with_alpha_16">
      <item>
        <shape android:shape="rectangle">
          <solid android:color="@color/color_on_surface_with_alpha_12" />
          <corners android:radius="@dimen/home_surface_search_box_background_radius"/>
        </shape>
      </item>
    </ripple>
  </item>

  <!-- 2. State: Hovered (but not pressed). -->
  <item android:state_hovered="true">
    <shape android:shape="rectangle">
      <solid android:color="@color/color_on_surface_with_alpha_12" />
      <corners android:radius="@dimen/home_surface_search_box_background_radius"/>
    </shape>
  </item>

  <!-- 3. State: Focused (but not pressed): Show outline. -->
  <item android:state_focused="true" android:state_pressed="false">
    <shape android:shape="rectangle">
      <corners android:radius="@dimen/home_surface_search_box_background_radius"/>
      <stroke
        android:color="@macro/default_control_color_active"
        android:width="@dimen/focused_outline_stroke_width" />
    </shape>
  </item>

  <!-- 4. Default, including pressed. -->
  <item>
    <ripple android:color="@color/color_on_surface_with_alpha_16">
      <!-- Item is transparent, so mask is needed for ripple to be visible. -->
      <item android:id="@android:id/mask">
        <shape android:shape="rectangle">
          <solid android:color="@android:color/white" />
          <corners android:radius="@dimen/home_surface_search_box_background_radius"/>
        </shape>
      </item>
    </ripple>
  </item>
</selector>
