/*
Copyright 2026 Sand Harbor Software, LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

.bundle-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.bundle-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.meadow-search-open,
.meadow-search-close {
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  border-radius: var(--meadow-header-action-border-radius, 0.35rem);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.meadow-search-open {
  display: inline-flex;
  width: var(--meadow-header-action-size, 2.5rem);
  height: var(--meadow-header-action-size, 2.5rem);
  min-height: var(--meadow-header-action-size, 2.5rem);
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0.5rem;
  border-color: var(--meadow-header-action-border-color, #d1d5db);
  background: var(--meadow-header-action-background, #ffffff);
  color: var(--meadow-header-action-color, #4b5563);
  line-height: 1;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.meadow-search-open svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.meadow-search-open:hover {
  border-color: var(--meadow-header-action-hover-border-color, #9ca3af);
  background: var(--meadow-header-action-hover-background, #f9fafb);
  color: var(--meadow-header-action-hover-color, #111827);
}

.meadow-search-close:hover {
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.meadow-search-panel[hidden] {
  display: none;
}

.meadow-search-panel {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: min(12vh, 6rem) 1rem 1rem;
  background: rgb(0 0 0 / 35%);
}

.meadow-search-dialog {
  width: min(42rem, 100%);
  max-height: min(44rem, 78vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgb(0 0 0 / 18%);
  border-radius: 0.75rem;
  background: Canvas;
  color: CanvasText;
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 25%);
}

.meadow-search-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border-bottom: 1px solid rgb(0 0 0 / 12%);
}

.meadow-search-input {
  min-width: 0;
  flex: 1;
  border: 1px solid rgb(0 0 0 / 22%);
  border-radius: 0.4rem;
  padding: 0.6rem 0.75rem;
  background: Canvas;
  color: CanvasText;
  font: inherit;
}

.meadow-search-close {
  width: 2.2rem;
  height: 2.2rem;
  flex: 0 0 auto;
  font-size: 1.35rem;
  line-height: 1;
}

.meadow-search-status {
  margin: 0;
  padding: 0.65rem 0.9rem 0.35rem;
  color: color-mix(in srgb, currentColor 66%, transparent);
  font-size: 0.86rem;
}

.meadow-search-results {
  overflow-y: auto;
  padding: 0.25rem 0.65rem 0.85rem;
}

.meadow-search-results-section h2 {
  margin: 0.7rem 0.35rem 0.35rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, currentColor 58%, transparent);
}

.meadow-search-result {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.7rem;
  border-radius: 0.45rem;
  color: inherit;
  text-decoration: none;
}

.meadow-search-result:hover,
.meadow-search-result:focus-visible {
  background: color-mix(in srgb, currentColor 8%, transparent);
  outline: none;
}

.meadow-search-result-title {
  font-weight: 650;
}

.meadow-search-result-snippet {
  display: block;
  color: color-mix(in srgb, currentColor 70%, transparent);
  font-size: 0.9rem;
  line-height: 1.35;
}

.meadow-search-result-content {
  border-left: 0.2rem solid color-mix(in srgb, currentColor 18%, transparent);
}

body.meadow-search-is-open {
  overflow: hidden;
}

@media (max-width: 40rem) {
  .meadow-search-panel {
    padding-top: 1rem;
  }

  .meadow-search-dialog {
    max-height: calc(100vh - 2rem);
  }
}
