/**
 * Header Autocomplete v3 Styles
 * 
 * Custom styles for the Algolia Autocomplete implementation (v3)
 * Designed to match the wordpress-search.js styling approach
 */

/* Container styling */
.algolia-header-search-autocomplete {
  position: relative;
  max-width: 600px;
  margin: auto;
  width: 100%;
}

/* Autocomplete container */
.aa-Autocomplete {
  width: 100%;
}

/* Input styling */
.aa-Form {
  border: 1px solid #c2c2c2;
  border-radius: 8px;
  font-family: "Work Sans", sans-serif;
  font-size: 14px;
  height: 64px;
  line-height: 150%;
  padding: 14px 40px 14px 16px;
  width: 100%;
  box-shadow: none;
}

.aa-Form .aa-Input {
  font-size: 16px;
  font-weight: 400;
  line-height: 150%;
}

.aa-DetachedSearchButton {
  border-radius: 8px;
  border: 1px solid #c2c2c2;
  background-color: #fff;
  padding: 14px;
}
.aa-DetachedSearchButton .aa-DetachedSearchButtonIcon {
  display: none;
}
.aa-DetachedSearchButton .aa-DetachedSearchButtonPlaceholder {
  color: #101212;
  font-size: 14px;
  font-family: 'Work Sans', sans-serif;
  line-height: 150%;
  font-weight: 400;
}
.aa-DetachedFormContainer .aa-Form {
  height: 52px;
  padding: 14px;
}

/* .aa-Input {
  font-size: 16px;
  padding: 12px 16px;
  color: #333;
  border-radius: 8px;
} */

.aa-Input::placeholder {
  color: #101212;
}

.aa-InputWrapperPrefix {
  display: none;
}

.aa-InputWrapperSuffix {
  padding-right: 12px;
}

/* Panel styling */
.aa-Panel {
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 8px 0;
  z-index: 9999;
}

/* Source header */
.aa-SourceHeader {
  margin: 0;
  padding: 8px 16px;
  color: #666;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid #eee;
}

/* Item styling */
.aa-Item {
  padding: 8px 16px;
}
.aa-Item .hit-title {
  font-size: 22px;
  margin: 0;
}

.aa-ItemLink {
  display: block;
  text-decoration: none;
  color: inherit;
}

.aa-ItemContent {
  display: flex;
  align-items: flex-start;
  align-items: center;
  gap: 12px;
}

.aa-ItemIcon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  border: 1px solid #008573;
  border-radius: 50%;
  color: #008573;
  overflow: hidden;
  font-size: 15px;
}

.aa-ItemIcon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aa-ItemIcon--fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e0e0e0;
  color: #666;
  font-weight: bold;
  font-size: 18px;
}

.aa-ItemContentBody {
  flex: 1;
  min-width: 0;
}

.aa-ItemContentTitle {
  font-size: 16px;
  font-weight: 500;
  color: #101212;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aa-ItemContentTitle em {
  font-style: normal;
  font-weight: 700;
  background-color: rgba(58, 150, 207, 0.1);
  color: #0073aa;
}

.aa-ItemLocationInfo {
  color: #818888;
  font-size: 14px;
}

.aa-ItemContentType {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.aa-ItemContentDescription {
  font-size: 14px;
  color: #666;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.aa-ItemContentDescription em {
  font-style: normal;
  font-weight: 600;
  background-color: rgba(58, 150, 207, 0.1);
  color: #0073aa;
}

/* Active item */
.aa-Item[aria-selected="true"] {
  background-color: rgba(0, 133, 115, 0.05);
}

/* View all link */
.aa-Footer {
  padding: 0;
  border-top: 1px solid #eee;
}

.aa-ViewAll {
  display: block;
  padding: 12px 16px;
  text-align: center;
  color: #0073aa;
  font-weight: 500;
  text-decoration: none;
  font-size: 14px;
}

.aa-ViewAll:hover {
  text-decoration: underline;
  background-color: rgba(58, 150, 207, 0.05);
}

/* No results */
.aa-NoResultsContainer {
  padding: 16px;
}

.aa-NoResults {
  padding: 16px;
  text-align: center;
  color: #666;
  background-color: #f9f9f9;
  border-radius: 4px;
}

.aa-NoResults p {
  margin: 0 0 10px;
}

.aa-NoResults p:first-child {
  font-weight: 500;
  color: #333;
}

.aa-NoResults ul {
  margin: 0;
  padding-left: 20px;
  text-align: left;
}

.aa-NoResults li {
  margin-bottom: 4px;
}

/* Loading indicator */
.aa-LoadingIndicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .aa-Form {
    max-width: 100%;
  }

  .aa-Panel {
    max-width: 100%;
    width: 100%;
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    margin-top: 8px;
  }
}
