

/* Responsive design variables */
:root {
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --radius-1: 0.25rem;
  --radius-2: 0.5rem;
  --radius-3: 0.75rem;
  --container-max: 70rem; /* ~1120px */
  --bp-sm: 48rem;  /* 768px */
  --bp-md: 64rem;  /* 1024px */
  --bp-lg: 80rem;  /* 1280px */
}

.ais-CustomMenu-count{
  color:white;
  display: inline-block;
  background-color: rgba(197,201,224,.2);
  border-radius: 4px;
  margin-left: 8px;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 4px;
  padding-right: 4px;
  font-size: 10px;
  letter-spacing: 1.3px;
  font-family: Open Sans,system-ui,BlinkMacSystemFont,-apple-system,sans-serif;
}

#entersearch{
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 21.875rem; /* 350px */
  height: 2.25rem; /* 36px */
  flex-shrink: 0; /* Prevent shrinking */
}
button.Search-searchbar{
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: var(--radius-2);
  padding: 0.375rem 0.625rem;
  width: 100%;
  height: 100%;
  cursor: pointer;
  transition: border-color 0.2s ease;
  font-size: 0.8125rem;
  color: #6c757d;
  line-height: 1;
  box-sizing: border-box;
}
.Search-searchbar:hover {
  border-color: #adb5bd;
}
.Search-searchbar:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}
.Search-searchbar .SearchIcon {
  margin-right: 0.5rem;
}
kbd.Search-searchbar-kbd {
  margin-left: auto;
  background: #e9ecef;
  border: 1px solid #ced4da;
  border-radius: 0.1875rem;
  padding: 0.0625rem 0.25rem;
  font-size: 0.625rem;
  font-weight: 500;
  color: #495057;
  line-height: 1.2;
  white-space: nowrap;
}
/* Custom styling for search container */


/* Search button styling */


/* Search icon styling */


/* Keyboard shortcut styling */


/* Responsive adjustments */
@media (max-width: 48rem) {
  #entersearch {
  min-width: 11.25rem;
  max-width: 13.75rem;
  margin-right: var(--space-2);
  height: 2rem;
  }
  
  .Search-searchbar {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  gap: 0.25rem;
  }
  
  .Search-searchbar-kbd {
    display: none;
  }
  
  .tingle-modal-box {
  max-width: 95% !important;
  width: 98% !important;
  margin: var(--space-4) auto !important;
  }
  
  #searchHelpers {
    width: 100%; /* Mobile-first: full width on small screens */
  }
  
  #results_filters {
    flex-direction: column;
    gap: 0.9375rem;
    padding-right: 0.625rem; /* Reduced right padding for mobile */
  }
  
  #searchDiv.has-query {
    padding-right: 0; /* Keep scrollbar flush on mobile too */
  }
  
  /* Mobile responsive styling for modern glassmorphism design */
  .ais-InfiniteHits-list {
    margin-left: 0;
    border-radius: 12px;
    box-shadow: 
      0 4px 16px rgba(0, 0, 0, 0.08),
      0 1px 0 rgba(255, 255, 255, 0.4) inset;
  }
  
  .ais-InfiniteHits-item {
    width: calc(100% - 16px);
    margin-left: 8px;
    margin-right: 8px;
    margin-bottom: 6px;
  }
  
  .ais-InfiniteHits-item a:not(a.aa-ItemLink) {
    padding: 14px 16px;
    border-radius: 10px;
  }
  
  .ais-InfiniteHits-loadMore button {
    padding: 12px 24px;
    font-size: 11px;
    min-width: 150px;
    margin: 16px auto;
    border-radius: 10px;
  }
  
  /* Mobile responsive autocomplete suggestions */
  .aa-Panel {
    border-radius: 10px;
  margin-top: 0.375rem;
  margin-bottom: 0.75rem;
    box-shadow: 
      0 6px 24px rgba(0, 0, 0, 0.15),
      0 1px 0 rgba(255, 255, 255, 0.4) inset;
  }
  
  .aa-List {
  padding: 0.375rem;
  }
  
  .aa-Item {
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-2);
  margin-bottom: 0.25rem;
  }
  
  .aa-Hit-container {
  height: 2.75rem;
  padding: 0 0.75rem;
  }
  
  .aa-ItemContent {
  font-size: 0.8125rem;
  }
  
  .aa-ItemIcon {
  width: 1.125rem;
  height: 1.125rem;
  margin-right: 0.625rem;
  }
}

/* Ensure header layout doesn't break */
header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 3rem; /* 48px */
  padding: var(--space-2) var(--space-4);
}

header nav {
  flex-grow: 1;
  display: flex;
  justify-content: center; /* Center the navigation */
}

header nav ul {
  display: flex;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  align-items: center;
}

header nav ul li a {
  text-decoration: none;
  color: inherit;
  font-size: 0.875rem;
  white-space: nowrap;
}

/* Ensure logo stays on the left */
.ts3d-logo {
  flex-shrink: 0;
}

/* Ensure menu button stays on the right */
.menu-btn {
  flex-shrink: 0;
  margin-left: 0.5rem;
}

/* Search results container positioning */
.tingle-modal {
  z-index: 9999;
  cursor: default;
}

.tingle-modal-box {
  max-width: var(--container-max) !important;
  width: 95% !important;
  margin: var(--space-5) auto !important;
  border-radius: var(--radius-2) !important;
  box-shadow: 0 0.625rem 2.5rem rgba(0, 0, 0, 0.1) !important;
  position: relative; /* Ensure proper stacking context */
}

.tingle-modal-box__content {
  padding: 0 !important;
  overflow: visible; /* Allow sliding panel to extend outside */
}

/* Search input and results styling */
.aa-Autocomplete {
  width: 100%;
}
input[type="search"]:focus{
  border-color: rgb(44, 95, 233);
}
.aa-Form {
  border-bottom: 1px solid #eee;
  padding: 1.25rem;
  position: relative;
}

/* Add search icon to input field */
.aa-Form::before {
  content: "";
  position: absolute;
  left: 1.8rem; /* Moved slightly more to the right */
  top: 49%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
  z-index: 10; /* Much higher z-index to appear above everything */
  opacity: 0.6; /* Slightly more subtle */
}

.aa-Input {
  width: 100%;
  padding: 0.75rem 3rem 0.75rem 3.25rem; /* Added right padding for reset button, left padding for search icon */
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: var(--radius-2);
  outline: none;
  position: relative; /* Ensure proper stacking context */
  z-index: 1; /* Lower than the icon */
}

.aa-Input:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

#searchDiv {
  padding-top:0;
  padding-left:var(--space-3);
}

/* Remove right padding when showing results to make scrollbar flush */
#searchDiv.has-query {
  padding-right: 0;
}

/* Hide search results and filters when no query, but keep hierarchical menu for browsing */
#searchDiv:not(.has-query) #results_filters,
#searchDiv:not(.has-query) #stats,
#searchDiv:not(.has-query) #current-refinements,
#searchDiv:not(.has-query) #Hits-per-page,
#searchDiv:not(.has-query) #labelLocation,
#searchDiv:not(.has-query) #header,
#searchDiv:not(.has-query) #recentsearchPanel {
  display: none !important;
}

/* Always show hierarchical menu for category browsing */
#hierarchical-menu {
  display: block !important;
}

/* Always show hits container */
#hits {
  display: block;
}

/* Show elements when search has query */
#searchDiv.has-query #results_filters,
#searchDiv.has-query #current-refinements,
#searchDiv.has-query #hierarchical-menu,
#searchDiv.has-query #Hits-per-page,
#searchDiv.has-query #labelLocation,
#searchDiv.has-query #header,
#searchDiv.has-query #recentsearchPanel {
  display: block !important;
}

/* Ensure results_filters is flex when visible */
#searchDiv.has-query #results_filters {
  display: flex !important;
}
.ais-InfiniteHits-list{
  padding-top:1rem !important;
  padding-right: 10px !important; /* Ensure padding for scrollbar */
}
#results_filters {
  /* gap: 25px;
  margin-top: 20px; */
  padding-left: 0;
  padding-right: 0px; /* Maintain right padding for filters only */
}

#searchHelpers {
  width: 300px; /* Fixed width for desktop/tablet */
  flex-shrink: 0;
  /* Ensure scrolling if content overflows */
  overflow-y: auto;
  overflow-x: hidden;
  /* Match hits list glass look */
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.4) inset;
  /* Scrollbar styling analogous to .ais-InfiniteHits-list */
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

/* WebKit scrollbar styling for filters panel */
#searchHelpers::-webkit-scrollbar { width: 0.375rem; }
#searchHelpers::-webkit-scrollbar-track { background: transparent; }
#searchHelpers::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(99, 102, 241, 0.4) 0%,
    rgba(139, 92, 246, 0.4) 100%
  );
  border-radius: 10px;
  transition: all 0.3s ease;
}
#searchHelpers::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(99, 102, 241, 0.6) 0%,
    rgba(139, 92, 246, 0.6) 100%
  );
}

#hits {
  flex: 1;
  margin: 0;
  padding: 0;
}

/* Language filters (C++ / C#) minimalist bar */
#language-filters {
  display: none; /* shown dynamically when links exist */
  /* gap: 0.5rem;*/
  margin: 0 0 0.75rem 0; 
  padding: 0;
  flex-wrap: wrap;
  align-items: center;
}

/* Shared minimalist pill style */
#language-filters .language-filter-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-size: 0.7rem;
  letter-spacing: .5px;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--lang-pill-bg, #f3f4f6);
  color: #3b82f6; /* light blue text */
  border: 1px solid #e5e7eb;
  line-height: 1;
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
/* Remove previous dark styles if any */
#language-filters .language-filter-link.ais-CustomMenu-item,
#language-filters .language-filter-link.ais-CustomMenu-item1 { background: #f3f4f6; border:1px solid #e5e7eb; }

#language-filters .language-filter-link:hover {
  background:#eef2ff;
  border-color:#c7d2fe;
}
#language-filters .language-filter-link:focus-visible {
  outline:2px solid #6366f1;
  outline-offset:2px;
}
#language-filters .language-filter-link .ais-CustomMenu-count,
#language-filters .language-filter-link .ais-HitsCount, 
#language-filters .language-filter-link .ais-CustomMenu-count {
  background: rgba(99,102,241,.12);
  color:#4f46e5;
  padding:2px 6px;
  border-radius: 10px;
  font-size:10px;
  letter-spacing: .5px;
  margin-left:2px;
}
/* Active state (Algolia adds --selected to parent li; replicate using aria-current or pathname match later if needed) */
#language-filters .language-filter-link[aria-current="page"],
#language-filters .language-filter-link.active,
#language-filters .language-filter-link.ais-CustomMenu-item--selected,
#language-filters .language-filter-link.ais-CustomMenu-item1--selected {
  background:#3b82f6;
  color:#fff;
  border-color:#3b82f6;
}
.language-filter-link.active > .ais-CustomMenu-label {
  color:white;
  font-weight: 900;
}
#language-filters .language-filter-link[aria-current="page"] .ais-CustomMenu-count,
#language-filters .language-filter-link.active .ais-CustomMenu-count {
  background: rgba(255,255,255,.25);
  color:#fff;
}
/* Mobile positioning: stack and scroll horizontally if needed */
@media (max-width: 48rem) {
  #language-filters {
    order: 2; /* place just above stats/hits if flex reorder needed */
    width: 100%;
    margin: 0 0 0.5rem 0;
    gap: 0.4rem;
  }
  #language-filters .language-filter-link {
    font-size: 0.65rem;
    padding: 0.3rem 0.55rem;
  }
  
  /* Mobile responsive query suggestions */
  #recentsearchPanel {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  #recentsearchPanel .aa-Panel:not(:empty)::before {
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
  }
  
  #recentsearchPanel .aa-List {
    padding: 0.5rem;
    gap: 0.375rem;
  }
  
  #recentsearchPanel .aa-Item {
    font-size: 0.8125rem !important;
    padding: 0.375rem 0.625rem !important;
    max-width: 150px !important;
  }
}

/* Hide original inline language links inside hierarchical menu to avoid duplicates */
#hierarchical-menu .ais-CustomMenu-item, 
#hierarchical-menu .ais-CustomMenu-item1 {
  display: none !important;
}

/* Empty state styling */
.search-empty-state {
  text-align: center;
  padding: 3.75rem 1.25rem;
  color: #666;
}

.search-empty-state .empty-state-icon {
  margin-bottom: 1.25rem;
  color: #999;
  opacity: 0.7;
}

.search-empty-state .empty-state-icon svg {
  width: 64px;
  height: 64px;
}

.search-empty-state h3 {
  margin-bottom: 0.625rem;
  color: #333;
  font-size: 1.25rem;
  font-weight: 600;
}

.search-empty-state p {
  margin-bottom: 1.875rem;
  font-size: 0.875rem;
  color: #666;
}

.search-empty-state .search-hints {
  margin-top: 1.875rem;
}

.search-empty-state .search-hints > span {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  color: #777;
  font-weight: 500;
}

.search-empty-state .search-examples {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-empty-state .search-examples code {
  background: #f1f3f4;
  color: #5f6368;
  padding: 0.375rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid #e8eaed;
  transition: all 0.2s ease;
}

.search-empty-state .search-examples code:hover {
  background: #e8f0fe;
  color: #1967d2;
  border-color: #dadce0;
}

/* No results styling */
.no-results-message {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: #666;
}

.no-results-message .no-results-icon {
  margin-bottom: 1rem;
  color: #dc3545;
  opacity: 0.7;
}

.no-results-message .no-results-icon svg {
  width: 3rem;
  height: 3rem;
}

.no-results-message .no-results-text {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.no-results-message .no-results-suggestion {
  display: block;
  font-size: 0.875rem;
  color: #666;
}

/* Footer instructions */
.search-footer {
  padding: 1.25rem;
  border-top: 1px solid #eee;
  background: #f8f9fa;
  text-align: center;
}

.search-footer-shortcuts {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: 0.625rem;
}

.search-footer-shortcut {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #666;
}

.search-footer-shortcut kbd {
  background: #e9ecef;
  border: 1px solid #ced4da;
  border-radius: 0.1875rem;
  padding: 0.125rem 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #495057;
}

.search-footer-text {
  font-size: 0.6875rem;
  color: #999;
}

.ais-Hits-item {
  padding: 0.9375rem;
  border-bottom: 1px solid #eee;
}

.ais-Hits-item:last-child {
  border-bottom: none;
}

.hit-name {
  font-weight: 600;
  color: #0d6efd;
  margin-bottom: 0.3125rem;
}

.hit-description {
  color: #666;
  font-size: 0.875rem;
  line-height: 1.4;
}

.ais-CustomMenu-item,
.ais-CustomMenu-item1 {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 0.125rem solid #333;
  border-radius: var(--radius-1);
  background-color: #333;
  color: #fff;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  position: absolute;
  bottom: 10%;
}

.ais-CustomMenu-item { left: 0.625rem; }

.ais-CustomMenu-item1 { left: 2.8rem; }

.ais-CustomMenu-item:hover,
.ais-CustomMenu-item1:hover {
  background-color: rgb(167, 167, 167);
}

.ais-HierarchicalMenu-item--selected>div>.ais-CustomMenu-item,
.ais-HierarchicalMenu-item--selected>div>.ais-CustomMenu-item1 {

  background-color: rgb(167, 167, 167);

}
.ais-HierarchicalMenu-item--selected>div>.ais-CustomMenu-item1>.ais-CustomMenu-count, 
.ais-HierarchicalMenu-item--selected>div>.ais-CustomMenu-item>.ais-CustomMenu-count {

  color: rgb(255, 255, 255);
  font-weight: 900;
  background-color: #333;

}
.aa-InputWrapperPrefix{
  display: none;
}
.ais-CustomMenu-item:hover>.ais-CustomMenu-count,
.ais-CustomMenu-item1:hover>.ais-CustomMenu-count {
  
  background-color: #333;
  font-weight: 900;
}


.ais-CustomMenu-label {
  color: black;
}



.ais-ClearRefinements {
  margin: 1em 0;
}

.ais-SearchBox , .aa-Autocomplete {
  position: relative;
  z-index: 1;
}

button#entersearch {
  border-color: #002bff;
  border-radius: 5px;
}

.tingle-modal-box__content {
  padding: 0 !important;
}

.ais-HierarchicalMenu-link:before {
  background-image: none !important;
  background-repeat: no-repeat;
  content: "";
  display: inline-block;
  height: 1rem;
  margin-right: .5rem;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  width: 1rem;
}

.ais-CurrentRefinements {
  margin-top: 0.5em;
  margin-left: 0.625rem;
}

/* Current Refinements Item Styling - Remove background/borders, hide label, make text blue */
.ais-CurrentRefinements-item {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  margin-bottom: 0.5rem;
}

/* Hide the "Location:" label completely */
.ais-CurrentRefinements-label {
  display: none !important;
}

/* Style the category text to be blue */
.ais-CurrentRefinements-category {
  color: #2563eb !important; /* Blue color */
  background: none !important;
  border: none !important;
  padding: 0;
}

/* Style the category label text */
.ais-CurrentRefinements-categoryLabel {
  color: #2563eb !important; /* Blue color */
  font-weight: 500;
  background: none !important;
  border: none !important;
}

/* Style the delete button */
.ais-CurrentRefinements-delete {
  background: none !important;
  border: none !important;
  color: #6b7280 !important; /* Gray color for the X button */
  font-size: 1rem;
  margin-left: 0.5rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.ais-CurrentRefinements-delete:hover {
  background-color: rgba(239, 68, 68, 0.1) !important; /* Light red background on hover */
  color: #ef4444 !important; /* Red color on hover */
}
form[role="search"].aa-Form ,
form[role="search"].ais-SearchBox-form {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.ais-HitsPerPage {
  /* width: calc(70% - 1rem);  */
  display: block;
  margin-left: auto;
  margin-right: auto;

}
.ais-HitsCount {
  display: inline-block;
  background-color: rgba(197,201,224,.2);
  color: #5e6283;
  border-radius: 4px;
  margin-left: 8px;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 4px;
  padding-right: 4px;
  font-size: 10px;
  letter-spacing: 1.3px;
  font-family: Open Sans,system-ui,BlinkMacSystemFont,-apple-system,sans-serif;
}
#results_filters {
  display: flex;
  justify-content: space-between;
}

a.ais-HierarchicalMenu-link {
  color: black
}

a.ais-HierarchicalMenu-link:visited {
  color: black
}

a.ais-HierarchicalMenu-link:hover {
  color: #2980b9;
  font-weight: bold;
}

li.ais-HierarchicalMenu-item--selected.ais-HierarchicalMenu-item--parent {

  font-weight: bold;
  color: #2980b9;
}

a.ais-Menu-link {
  color: black
}

a.ais-Menu-link:visited {
  color: black
}

a.ais-Menu-link:hover {
  color: #2980b9
}

.ais-Menu-item--selected .ais-Menu-label {
  color: #2980b9
}

li.ais-HierarchicalMenu-item--selected {

  font-weight: bold;
  color: #2980b9;
}

.ais-HierarchicalMenu-list--child {
  font-weight: normal !important;

  color: #2980b9;
}

.ais-HierarchicalMenu-label {
  color: #2980b9
}

#hierarchical-menu {
  padding: 10px;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* ================================
   RESPONSIVE SEARCH LAYOUT
   ================================ */

/* Filters header styling */
.filters-header {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  font-size: 1.6rem;
  display: inline-block;
}

/* Main search layout container */
.search-layout {
  display: flex;
  gap: var(--space-4);
  width: 100%;
  min-height: 400px;
  justify-content: space-between;
}

/* Hide mobile triggers on desktop */
.mobile-filters-trigger,
.mobile-filters-close,
.mobile-filters-overlay {
  display: none;
}

/* Filters container */
.search-filters-container {
  flex: 0 0 280px;
  min-width: 250px;
  max-width: 320px;
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  max-height: 600px;
  /* Ensure visibility on desktop */
  display: block;
  visibility: visible;
}

/* Results container */
.search-results-container {
  flex: 1;
  padding: var(--space-3);
  padding-right: 0;
  padding-top:0;
  min-width: 0; /* Allow shrinking */
}

/* Mobile-first responsive design with sliding panel */
@media (max-width: 768px) {
  .search-layout {
    flex-direction: column;
    gap: 0;
    padding: var(--space-2);
    position: relative;
  }
  /* Hide footer shortcuts on mobile */
  .search-footer-shortcuts { display: none !important; }

  /* Adjust overall searchDiv padding and ensure right padding consistent */
  #searchDiv { padding: var(--space-2) var(--space-3) var(--space-2) var(--space-3) !important; }
  #searchDiv.has-query { padding-right: var(--space-3) !important; }
  
  /* Mobile filter trigger button */
  .mobile-filters-trigger {
    display: block;
    width: 100%;
    padding: var(--space-3);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-2);
    color: #4338ca;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: var(--space-3);
    text-align: center;
    position: relative;
  /* Add symmetric horizontal spacing */
  margin-left: 0;
  margin-right: var(--space-3);
  }
  
  .mobile-filters-trigger:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
  }
  
  .mobile-filters-trigger::after {
    content: " →";
    font-size: 1.2em;
    margin-left: var(--space-2);
  }
  
  /* Sliding panel for mobile filters */
  .search-filters-container {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    height: 100vh;
    max-width: none;
    min-width: auto;
    z-index: 10001; /* Above modal overlay */
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding: var(--space-5) var(--space-4);
    /* Prevent content from flowing behind the panel */
    will-change: transform;
  }
  
  .search-filters-container.panel-open {
    right: 0;
    /* Add subtle entrance animation */
    animation: slideInFromRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  @keyframes slideInFromRight {
    from {
      transform: translateX(100%);
      opacity: 0.8;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
  
  /* Close button for mobile panel */
  .mobile-filters-close {
    position: absolute;
  top: var(--space-2);
  right: var(--space-2);
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #666;
    transition: all 0.2s ease;
  }
  
  .mobile-filters-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
  }
  
  /* Mobile overlay */
  .mobile-filters-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000; /* Between modal and sliding panel */
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(2px);
  }
  
  .mobile-filters-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  .search-results-container {
    flex: none;
    width: 100%;
    padding: 0;
  }
  
  .filters-header {
    font-size: 1.4rem;
    text-align: left;
    margin-bottom: var(--space-4);
    margin-top: var(--space-4);
    color: #333;
    font-weight: 600;
  }
  
  /* Enhanced mobile filter items */
  .search-filters-container .ais-HierarchicalMenu-link {
    display: block;
    padding: var(--space-3) var(--space-2);
    margin-bottom: var(--space-1);
    border-radius: var(--radius-2);
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.1);
    transition: all 0.2s ease;
    text-decoration: none;
    color: #333;
    font-size: 1rem;
    font-weight: 500;
    min-height: 44px; /* Minimum touch target size */
    display: flex;
    align-items: center;
  }
  
  .search-filters-container .ais-HierarchicalMenu-link:hover,
  .search-filters-container .ais-HierarchicalMenu-link:active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
    color: #4338ca;
  }
  
  /* Active filter styling */
  .search-filters-container .ais-HierarchicalMenu-item--selected .ais-HierarchicalMenu-link {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #4338ca;
    font-weight: 600;
  }
}

/* Tablet responsiveness with sliding panel */
@media (min-width: 769px) and (max-width: 1024px) {
  .search-layout {
    gap: var(--space-3);
    position: relative;
  }
  /* Hide footer shortcuts on tablet */
  .search-footer-shortcuts { display: none !important; }
  /* Adjust searchDiv padding on tablet */
  #searchDiv { padding: var(--space-3) var(--space-4) var(--space-3) var(--space-4) !important; }
  #searchDiv.has-query { padding-right: var(--space-4) !important; }
  
  /* Show mobile trigger on tablet too */
  .mobile-filters-trigger {
    display: block;
    width: auto;
    padding: var(--space-2) var(--space-4);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-2);
    color: #4338ca;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: var(--space-3);
    align-self: flex-start;
  margin-right: var(--space-3);
  }
  
  .mobile-filters-trigger:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
  }
  
  .mobile-filters-trigger::after {
    content: " →";
    font-size: 1.1em;
    margin-left: var(--space-2);
  }
  
  /* Show mobile overlay on tablet */
  .mobile-filters-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(2px);
  }
  
  .mobile-filters-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  /* Show close button on tablet */
  .mobile-filters-close {
    display: flex;
    position: absolute;
  top: var(--space-2);
  right: var(--space-2);
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #666;
    transition: all 0.2s ease;
  }
  
  .mobile-filters-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
  }
  
  /* Tablet sliding panel - covers half the screen */
  .search-filters-container {
    position: fixed;
    top: 0;
    right: -50%;
    width: 50%;
    height: 100vh;
    max-width: none;
    min-width: auto;
    z-index: 10001; /* Above modal overlay */
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding: var(--space-5) var(--space-4);
    will-change: transform;
  }
  
  .search-filters-container.panel-open {
    right: 0;
    animation: slideInFromRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .search-results-container {
    flex: 1;
    padding: var(--space-2);
    padding-right: 0;
  }
  
  .filters-header {
    font-size: 1.3rem;
    text-align: left;
    margin-bottom: var(--space-4);
    margin-top: var(--space-4);
    color: #333;
    font-weight: 600;
  }
  
  /* Enhanced tablet filter items */
  .search-filters-container .ais-HierarchicalMenu-link {
    display: block;
    padding: var(--space-2) var(--space-2);
    margin-bottom: var(--space-1);
    border-radius: var(--radius-2);
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.1);
    transition: all 0.2s ease;
    text-decoration: none;
    color: #333;
    font-size: 0.95rem;
    font-weight: 500;
    min-height: 40px;
    display: flex;
    align-items: center;
  }
  
  .search-filters-container .ais-HierarchicalMenu-link:hover,
  .search-filters-container .ais-HierarchicalMenu-link:active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
    color: #4338ca;
  }
  
  /* Active filter styling for tablet */
  .search-filters-container .ais-HierarchicalMenu-item--selected .ais-HierarchicalMenu-link {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #4338ca;
    font-weight: 600;
  }
}

/* Large screen optimizations */
@media (min-width: 1025px) {
  .search-layout {
    max-width: 1400px;
    margin: 0 auto;
  }
  
  .search-filters-container {
    flex: 0 0 320px;
    max-width: 380px;
    /* Reset any mobile positioning */
    position: static;
    width: auto;
    height: auto;
    right: auto;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
    overflow-y: auto;
    max-height: 600px;
  }
  
  /* Hide all mobile elements on desktop */
  .mobile-filters-trigger,
  .mobile-filters-close,
  .mobile-filters-overlay {
    display: none !important;
  }
}

.tingle-modal-box {
  display: block !important;
  border-radius: var(--search-border-radius) !important;
  box-shadow: .25rem .5rem 1rem rgba(0, 0, 0, .35) !important;
}

/* Enhanced autocomplete item components */
.aa-ItemActionButton{
  align-items: center;
  display: flex;
  height: 35px;
  width: 30px;
  margin-right: 12px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.aa-ItemActionButton:hover {
  background-color: rgba(99, 102, 241, 0.1);
}

.aa-ItemContent{
  display: inline-flex;
  align-items: center;
  flex-grow: 1;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  letter-spacing: 0.3px;
}

.aa-ItemIcon{
  width: 20px;
  height: 20px;
  margin-right: 12px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.aa-Item:hover .aa-ItemIcon {
  opacity: 1;
}

/* Enhanced selected state */
li.aa-Item[aria-selected="true"]{
  background: rgba(99, 102, 241, 0.15) !important;
  border-color: rgba(99, 102, 241, 0.4) !important;
  border-radius: 8px;
  box-shadow: 
    0 4px 16px rgba(99, 102, 241, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.5) inset !important;
    
 > div.aa-ItemLink > .aa-Hit-container {
    color: #4338ca;
    font-weight: 600;
  }
}
.aa-Hit-container{    
  align-items: center;
  display: flex;
  flex-direction: row;
  height: 48px;
  padding: 0 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.aa-ItemActions{
  display: flex;
}

/* Disable keyboard navigation for query suggestions */
#recentsearchPanel .aa-Item,
#recentsearchPanel .aa-ItemLink {
  pointer-events: auto;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Remove focus styles from query suggestions - override for horizontal layout */
#recentsearchPanel .aa-Item:focus,
#recentsearchPanel .aa-Item[aria-selected="true"] {
  /* Let horizontal layout styles take precedence */
  background: #f3f4f6 !important;
  border: 1px solid #d1d5db !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  outline: none !important;
}

.tingle-modal {
  backdrop-filter: blur(0px) !important;
  background: rgba(132, 133, 136, 0.25) !important;

}

#hits {
  height: 40.625rem; /* 650px */
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  margin-right: 0;
  padding-right: 0;
  box-sizing: border-box;
}

#stats {
  float: left;
}

em#header {
  padding: 10px
}

#powered-by {
  top: 7px;
  position: relative;
}

div#menu {
  padding: 15px;
  width: 30%;
  background-color: rgb(241, 241, 241);
}

.ais-HitsPerPage-select {
  flex-direction: row;
  align-content: center;
  justify-content: center;
}

/* Hide manual load-more; we'll auto-load on scroll */
.ais-InfiniteHits-loadMore {
  display: none !important;
}

/* Enhanced glassmorphism "Show more results" button */
.ais-InfiniteHits-loadMore button {
  background: rgba(99, 102, 241, 0.9);
  backdrop-filter: blur(20px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 
    0 8px 32px rgba(99, 102, 241, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.3) inset;
  margin: 24px auto;
  display: block;
  min-width: 180px;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 12px;
}

.ais-InfiniteHits-loadMore button:hover {
  background: rgba(139, 92, 246, 0.9);
  box-shadow: 
    0 12px 40px rgba(139, 92, 246, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.4) inset;
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}

.ais-InfiniteHits-loadMore button:active {
  transform: translateY(0);
  box-shadow: 
    0 4px 16px rgba(99, 102, 241, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.ais-InfiniteHits-loadMore button:focus {
  outline: none;
  box-shadow: 
    0 0 0 4px rgba(99, 102, 241, 0.2),
    0 8px 32px rgba(99, 102, 241, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.3) inset;
}

.ais-InfiniteHits-loadMore button:disabled {
  background: rgba(156, 163, 175, 0.6);
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
  box-shadow: 
    0 4px 16px rgba(156, 163, 175, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.ais-InfiniteHits-loadMore button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg, 
    transparent, 
    rgba(255, 255, 255, 0.2), 
    transparent
  );
  transition: left 0.6s ease;
}

.ais-InfiniteHits-loadMore button:hover::before {
  left: 100%;
}

#Hits-per-page {
  float: right;
  padding-right: 20px;
  display: flex;
  align-items: center;
  top: 8px;
}

/* Minimalist styling for per-page select */
#Hits-per-page .ais-HitsPerPage-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff;
  border: none;
  border-radius: 6px;
  color: #495057;
  font-size: 12px;
  line-height: 1.2;
  padding: 6px 30px 6px 10px; /* extra right space for the arrow */
  cursor: pointer;
  box-shadow: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}

#Hits-per-page .ais-HitsPerPage-select:hover {
  background-color: #f8f9fa;
}

#Hits-per-page .ais-HitsPerPage-select:focus {
  outline: none;
  box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.15);
}

#Hits-per-page .ais-HitsPerPage-option {
  color: #333;
}

/* Hide default arrow in IE/Edge legacy */
#Hits-per-page .ais-HitsPerPage-select::-ms-expand {
  display: none;
}

.ais-InfiniteHits {
  display: flex;
  /* Set the display property to flex */
  flex-direction: column;
  position: relative;
  /* left: 45%; */
  /* top: 20px; */
  height: 100%; /*calc(100% - 50px);*/
  /* Subtract the height of the fixed button from the container's height */
  box-sizing: border-box;
}

input.ais-SearchBox-input,input.aa-Input,
.sliding-div {
  height: var(--search-height);
}
.aa-ClearButton{
  display: block;
  margin-right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #666;
}

.aa-ClearButton:hover {
  color: #333;
}

.aa-InputWrapperSuffix {
  margin-right: 6px;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15; /* Higher than search icon to appear above it */
  display: flex;
  align-items: center;
}

.ais-SearchBox-reset {
  margin-right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.ais-SearchBox-reset:hover {
  color: #333;
}

/* Enhanced glassmorphism autocomplete panel */
.aa-Panel {
  position: relative !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  width: 100% !important;
  z-index: 10;
  
  /* Modern glassmorphism design */
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.4) inset;
  margin-top: 8px;
  margin-bottom: 16px;
  
  /* Subtle gradient overlay */
  background-image: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
}

.aa-Form {
  position: relative;
}

.aa-List {
  padding: 8px;
  margin: 0;
}

/* Enhanced glassmorphism autocomplete items */
.aa-Item {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  margin-bottom: 6px;
  padding: 12px 16px;
  transition: all 0.3s ease;
  
  /* Modern glassmorphism background */
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.3) inset;
  
  /* Subtle gradient overlay */
  background-image: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.aa-Item:last-child {
  margin-bottom: 0;
}

.aa-Item:hover,
.aa-Item[aria-selected="true"] {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 
    0 4px 16px rgba(99, 102, 241, 0.15),
    0 1px 0 rgba(255, 255, 255, 0.4) inset;
  transform: translateY(-1px);
  
  /* Enhanced gradient on hover */
  background-image: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.05) 0%,
    rgba(139, 92, 246, 0.05) 100%
  );
}

/* Subtle shimmer effect on hover */
.aa-Item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg, 
    transparent, 
    rgba(255, 255, 255, 0.2), 
    transparent
  );
  transition: left 0.5s ease;
  z-index: 1;
}

.aa-Item:hover::before {
  left: 100%;
}

/* Ensure content stays above shimmer effect */
.aa-Item > * {
  position: relative;
  z-index: 2;
}

#recentsearchPanel {
  display: none; /* Hidden until 3+ character query triggers suggestions */
  position: relative;
  width: 100%;
  /* margin-top: 0.75rem; */
  margin-bottom: 0.75rem;
}

/* Add label above suggestions - only show when panel has content */
#recentsearchPanel .aa-Panel:not(:empty)::before {
  content: "Not finding what you're looking for? Try one of these queries";
  display: block;
  font-size: 0.875rem;
  color: #666;
  /* margin-bottom: 0.5rem; */
  font-weight: 500;
  padding-top: .5rem;
  padding-left: .5rem;
}

/* Horizontal panel layout */
#recentsearchPanel .aa-Panel {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0;
  border-radius: 8px;
  box-shadow: none;
  /* border: 1px solid #e5e7eb; */
  background: #f9fafb;
}

/* Hide empty panels */
#recentsearchPanel .aa-Panel:empty {
  display: none !important;
}

/* Horizontal scrollable list */
#recentsearchPanel .aa-List {
  display: flex !important;
  flex-direction: row !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  gap: 0.5rem;
  padding: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

/* Horizontal scroll webkit styling */
#recentsearchPanel .aa-List::-webkit-scrollbar {
  height: 4px;
}

#recentsearchPanel .aa-List::-webkit-scrollbar-track {
  background: transparent;
}

#recentsearchPanel .aa-List::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.4) 0%, rgba(139, 92, 246, 0.4) 100%);
  border-radius: 10px;
}

#recentsearchPanel .aa-List::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.6) 0%, rgba(139, 92, 246, 0.6) 100%);
}

/* Horizontal suggestion items - responsive width */
#recentsearchPanel .aa-Item {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: fit-content !important;
  max-width: 200px !important;
  white-space: nowrap !important;
  border-radius: 20px !important;
  padding: 0.5rem 0.75rem !important;
  background: white !important;
  border: 1px solid #e5e7eb !important;
  transition: all 0.2s ease !important;
  font-size: 0.875rem !important;
  margin-bottom: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#recentsearchPanel .aa-Item:hover {
  background: #f3f4f6 !important;
  border-color: #d1d5db !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Style the query text */
#recentsearchPanel .aa-Hit-container {
  color: #374151 !important;
  font-weight: 500 !important;
  height: auto !important;
  padding: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Style for query suggestion text without spacing issues */
.query-suggestion-text {
  color: #374151;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
}

/* Custom highlighting for query suggestions */
.query-suggestion-text mark {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #1d4ed8 !important;
  border-radius: 3px;
  padding: 0.125rem 0.25rem;
  font-weight: 600;
}

#recentsearchPanel .aa-Hit-container mark {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #1d4ed8 !important;
  border-radius: 3px;
  padding: 0.125rem 0.25rem;
}

.aa-Input {
  padding-right: 40px !important; /* Make room for the reset button */
}
input.ais-SearchBox-input, input.aa-Input{
  width: 100%;
  padding-left: 2rem;
  font-size: 100%;
  border-color: var(--ts3d-lt-grey);
  border-top-left-radius: var(--search-border-radius);
  border-top-right-radius:var(--search-border-radius) ;
  border-bottom-right-radius: var(--search-border-radius);
  border-bottom-left-radius: var(--search-border-radius);
  border-bottom-color: rgba(167, 167, 167, 0);
  box-shadow: 0px 1px;
}
#GoButton{
  width: fit-content;
  display: inline-block;
}
input.ais-SearchBox-input.is-focused, input.aa-Input.is-focused{
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

img[role="Knowledge Base Article"] {
  width: 50px !important;
}
.ais-InfiniteHits-loadMore{
  margin: 0 auto !important; /* Center the button container */
}
#stats {
  /*float: right;*/
  padding: 5px;
  text-align: right;
}
/* Removed conflicting #searchHelpers width rule - handled in responsive section */
.tingle-modal-box__footer {
  padding: var(--space-2) var(--space-4) !important;
  background-color: var(--search-grey) !important;
  border-radius: 0 0 var(--search-border-radius) var(--search-border-radius) !important;
}

.ais-CurrentRefinements--noRefinement{
  display:none;
}
.ais-InfiniteHits-list {
  position: relative;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  /* allow content to define height for better infinite scroll */
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-direction: column;
  
  /* Modern glassmorphism-inspired design */
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.5) inset;
  margin-left: 20px;
  
  /* Subtle gradient overlay */
  background-image: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  
  /* Modern scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

/* Modern webkit scrollbar styling */
.ais-InfiniteHits-list::-webkit-scrollbar { width: 0.375rem; }

.ais-InfiniteHits-list::-webkit-scrollbar-track {
  background: transparent;
}

.ais-InfiniteHits-list::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(99, 102, 241, 0.4) 0%,
    rgba(139, 92, 246, 0.4) 100%
  );
  border-radius: 10px;
  transition: all 0.3s ease;
}

.ais-InfiniteHits-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(99, 102, 241, 0.6) 0%,
    rgba(139, 92, 246, 0.6) 100%
  );
}

.ais-InstantSearch {
  max-width: 960px;
  overflow: hidden;
  margin: 0 auto;
}

.ais-InfiniteHits-item {
  margin-bottom: 8px;
  box-shadow: none !important;
  align-items: initial;
  background: initial;
  font-weight: initial;
  font-size: initial;
  padding: 0 !important;
  width: calc(100% - 2rem);
  margin-left: 1rem;
  margin-right: 1rem;
}
li.aa-Item.ais-InfiniteHits-item{
  flex-direction: column !important;
  align-items: normal !important;
  margin-bottom:0 !important;
}
.ais-InfiniteHits-item a:not(a.aa-ItemLink) {
  padding: 1.125rem 1.25rem 1.3125rem 1.25rem; /* Added extra bottom padding for underline space */
  border: none; /* Removed border */
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.3) inset;
  flex-grow: 1;
  transition: all 0.3s ease;
  display: block;
  text-decoration: none;
  position: relative; /* For underline positioning */
  margin-bottom: 0.3125rem; /* Extra space to prevent underline truncation */
}

.ais-InfiniteHits-item a:not(a.aa-ItemLink):hover {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.4) inset;
  transform: translateY(-2px);
  
  /* Enhanced thicker underline effect on hover */
  border-bottom: 0.1875rem solid rgba(99, 102, 241, 0.6);
}
.ais-InfiniteHits--empty{
  display:none;
}
.ais-InfiniteHits-item.focused:not(li.aa-Item), 
.ais-InfiniteHits-item:hover:not(li.aa-Item) {
  transform: none;
}

/* Unified styling for both keyboard focus and mouse hover */
.ais-InfiniteHits-item.focused:not(li.aa-Item) a:not(a.aa-ItemLink),
.ais-InfiniteHits-item:hover:not(li.aa-Item) a:not(a.aa-ItemLink) {
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 
    0 12px 32px rgba(99, 102, 241, 0.15),
    0 1px 0 rgba(255, 255, 255, 0.4) inset;
  transform: translateY(-3px);
  outline: none; /* remove default browser outline */
}

/* Remove default focus ring from links inside hits when focused */
.ais-InfiniteHits-item a:focus {
  outline: none !important;
  box-shadow: none !important;
}
.ais-InfiniteHits-item:hover .hit-name {
  color: var(--ts3d-dk-blue);
}

.ais-Highlight-highlighted, .ais-Snippet-highlighted {
  color: var(--ts3d-dk-grey);
}

.ais-Stats {
  float: right;
}

#entersearch {
  position: relative;
}

.ais-InfiniteHits-item:hover:before {
  opacity: 1;
}

.ais-InfiniteHits-item:after {
  z-index: -1;
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  border-radius: 10px;
}



.ais-Panel-header {
  color: #55a5d9;
}


.ais-Panel {
  width: 281.86px;
  position: relative;
  left: -27px;
  top: -1267px;
  border-radius: 4px;
  color: white;
  padding: 7px;
  margin: 5px;
}

.ais-InfiniteHits-item img {
  margin-right: 1em;
}

.hit-name {
  margin-bottom: 0.5em;
}

.hit-description {
  color: #888;
  font-size: 14px;
  margin-bottom: 0.5em;
}
.KeyboardNavUpDownIcon{
  display:flex;
  border: 0.125rem solid;
  padding: 0.125rem;
  border-radius: var(--radius-2);
}
.SearchFooter-navigation-tip-icon{ margin-right: var(--space-2); }
.SearchFooter-navigation-tip {
  display: inline-flex;
  align-items: center;
  margin-right: 1rem;
}
.hit-location {
  color: var(--ts3d-dk-grey);
  background-color: #ededed;
  border: 1px solid;
  margin-right: 1em;
  border-radius: 0.3125rem;
  padding: 0.0625rem 0.125rem;
  font-size: 0.75rem;
}
.video-tag{
  color: white;
  margin-top: 1em;
  background-color: #FF0000;
}
.hit-product {
  color: var(--ts3d-dk-grey);
  background-color: #b1e7ff;
  margin-right: 1em;
  border: 1px solid;
  border-radius: 0.3125rem;
  padding: 0.0625rem 0.25rem;
  font-size: 0.75rem;
  &.hc{
    background-color: var(--hc-logo);
    color:white;
  }
  &.ceetron{
    background-color: var(--ceetron-logo);
    color:white;
  }
  &.ceesam{
    background-color: var(--ceesam-logo);
    color:white;
  }
  &.he{
    background-color: var(--he-logo);
    color:white;
  }
  &.hp{
    background-color: var(--hp-logo);
    color:white;
  }
  &.hv{
    background-color: var(--hv-logo);
    color:white;
  }
  &.hnp{
    background-color: var(--hnp-logo);
    color:white;
  }
  &.hl{
    background-color: var(--hl-logo);
    color:white;
  }
  &.spinfire{
    background-color: #00ffff3d;
    color:black;
  }
}
.hit-price {
  color: black;
  background-color: #f0d1ff;
  font-size: 12px;
  border: 1px solid;
  padding: 1px 3px;
  border-radius: 5px;
}

/* ================================
   ADDITIONAL MOBILE ENHANCEMENTS
   ================================ */

/* Mobile-specific modal adjustments */
@media (max-width: 480px) {
  .tingle-modal-box {
    width: 98% !important;
    max-width: 98% !important;
    margin: var(--space-2) auto !important;
    max-height: 95vh !important;
  }
  
  /* Smaller search input on small mobile screens */
  .aa-Input {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 12px 16px;
  }
  
  /* Adjust hit items for small screens */
  .ais-InfiniteHits-item a:not(a.aa-ItemLink) {
    padding: 14px;
    font-size: 14px;
  }
  
  .hit-name {
    font-size: 16px;
    line-height: 1.3;
  }
  
  .hit-description {
    font-size: 13px;
    line-height: 1.4;
  }
  
  /* Stack filter chips vertically on very small screens */
  .hit-product,
  .hit-location,
  .hit-price {
    display: block;
    float: none;
    margin: 4px 0;
  }
}

/* Enhanced touch interactions for mobile */
@media (hover: none) and (pointer: coarse) {
  .ais-InfiniteHits-item a:not(a.aa-ItemLink) {
    /* Remove hover transforms on touch devices for better performance */
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
  }
  
  .ais-InfiniteHits-item a:not(a.aa-ItemLink):hover,
  .ais-InfiniteHits-item a:not(a.aa-ItemLink):active {
    transform: none;
    background: rgba(99, 102, 241, 0.08);
  }
  
  /* Larger touch targets for mobile */
  .search-filters-container {
    padding: var(--space-4);
  }
  
  .filters-header {
    padding: var(--space-3);
    margin: 0 -var(--space-4) var(--space-3) -var(--space-4);
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--radius-2);
  }
}