/* Search Form Styles */
.catex-search-form {
  position: relative;
  max-width: 600px;
  margin: 0 auto 30px;
}

.catex-search-form form {
  display: flex;
  gap: 10px;
}

#term_search {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  transition: all 0.3s ease;
}

#term_search:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
}

.catex-search-submit {
  padding: 10px 20px;
  background: #2271b1;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.catex-search-submit:hover {
  background: #135e96;
}

/* Autocomplete Results */
.autocomplete-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
}

.taxonomy-suggestion {
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
  transition: background 0.2s ease;
}

.taxonomy-suggestion:last-child {
  border-bottom: none;
}

.taxonomy-suggestion a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: #333;
}

.taxonomy-suggestion:hover,
.taxonomy-suggestion.highlighted {
  background-color: #f0f0f1;
}

.term-count {
  color: #666;
  font-size: 14px;
}

/* Results Grid */
.catex-lists {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.catex-item {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  transition: all 0.3s ease;
}

.catex-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.term-name h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.term-name h4 a {
  color: #2271b1;
  text-decoration: none;
  transition: color 0.2s ease;
}

.term-name h4 a:hover {
  color: #135e96;
}

/* Pagination */
.pagination {
  margin: 30px 0;
  text-align: center;
}

.page-numbers {
  display: inline-block;
  padding: 8px 12px;
  margin: 0 4px;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: #2271b1;
  transition: all 0.3s ease;
}

.page-numbers.current {
  background: #2271b1;
  color: #fff;
  border-color: #2271b1;
}

.page-numbers:hover:not(.current) {
  background: #f0f0f1;
}

/* Status Messages */
.loading,
.no-results,
.error {
  padding: 15px;
  text-align: center;
  color: #666;
}

.error {
  color: #d63638;
}

/* Responsive Design */
@media screen and (max-width: 600px) {
  .catex-search-form form {
      flex-direction: column;
  }

  .catex-search-submit {
      width: 100%;
  }

  .catex-lists {
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 15px;
  }

  .catex-item {
      padding: 10px;
  }

  .pagination .page-numbers {
      padding: 6px 10px;
      margin: 0 2px;
  }
}

/* Accessibility */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}