/* === Outer Wrapper for Search === */
.custom-search-bar {
  width: 100%;
  max-width: 600px;
  margin: 0 auto; /* center align */
  padding: 3px 8px;
  display: block;
  box-sizing: border-box;
}

/* === Inner Wrapper for Input + Results === */
.glossary-wrapper {
  position: relative; /* crucial for absolute dropdown */
  width: 100%;
  display: block;
  box-sizing: border-box;
}

/* === Search Input Field === */
.glossary-search-input {
  width: 100% !important;
  padding: 10px 18px 10px 42px !important;
  border-radius: 50px !important;
  border: none !important;
  outline: none !important;
  font-size: 15px !important;
  background-color: white !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23aaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 14px center !important;
  background-size: 18px !important;
  box-sizing: border-box !important;
  display: block !important;
  transition: box-shadow 0.3s ease !important;
}


/* Optional: focus effect */
.glossary-search-input:focus {
  box-shadow: 0 0 10px rgba(162, 89, 255, 0.4);
}

/* === Search Results Dropdown === */
.glossary-search-results {
  position: absolute;
  top: 100%; /* directly below input */
  left: 0;
  right: 0; /* ensures it matches parent width */
  width: auto; /* auto width controlled by left & right */
  max-height: 250px;
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #ccc;
  box-shadow: 0 4px 15px rgba(162, 89, 255, 0.25);
  z-index: 999;
  display: none;
  box-sizing: border-box;
}

/* === Each Result Item === */
.glossary-search-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s ease;
}

.glossary-search-item:hover {
  background-color: #f0f0f0;
}

/* === Highlight Selected Result === */
.glossary-highlight {
  background-color: #fffa8c !important;
  transition: background-color 1.5s ease;
}

/* === Responsive Adjustments === */
@media (max-width: 1024px) {
  .glossary-search-input {
    font-size: 14px;
    padding: 8px 16px 8px 40px;
  }
}

@media (max-width: 768px) {
  .custom-search-bar {
    flex-direction: column;
    gap: 8px;
    padding: 5px;
  }

  .glossary-search-input {
    padding: 10px 14px 10px 38px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .glossary-search-input {
    font-size: 13px;
    padding: 8px 12px 8px 36px;
  }
}
