:root {
  --ep-c-white: #252628; /* Dark background */
  --ep-c-medium-white: #2e2f32; /* Hover background */
  --ep-c-white-gray: #323336; /* Border color */
  --ep-c-white-red: #ffe8ed;
  --ep-c-white-yellow: #fdeeca;
  --ep-c-medium-gray: #626262;
  --ep-c-light-gray: #999;
  --ep-c-black: #ffffff; /* Text color */
  --ep-c-medium-red: #d73c38;
  --ep-c-dark-red: #b93431;
  --ep-c-medium-dark-blue: #71ca99; /* Accent color */
  --ep-c-highlight: #71ca99;
  --ep-status-ok: #6aa000;
  --ep-status-warning: #e3e600;
  --ep-status-error: red;
}

.wgs-search {
  padding: 150px 40px 100px;
  text-align: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url(../../images/hero/hero-5.png);
  background-repeat: no-repeat;
  margin-top: -90px;
  background-position: center -13px;
}

.wgs-search__content {
  position: relative;
  max-width: 800px;
  width: 100%;
}

.wgs-search__title {
  max-width: 520px;
  margin: 0 auto 10px;
  font-size: 48px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.wgs-search__subtitle {
  font-size: 1.125rem;
  color: #fff;
  margin: 0 0 20px 0;
  line-height: 1.6;
  max-width: 430px;
  margin-left: auto;
  margin-right: auto;
}

.wgs-search__form-wrapper {
  margin-bottom: 25px;
}

.wgs-search__form-box {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50px;
  padding: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1;
  pointer-events: auto;
}

.wgs-search__form-box form {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  width: 100%;
}

.wgs-search__form-box form .ep-autosuggest-container {
  width: 100%;
}

.wgs-search__input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 16px 24px;
  font-size: 1rem;
  color: #2d3748;
  border-radius: 50px;
  padding-right: 70px;
  position: relative;
  z-index: 2;
  pointer-events: auto;
  cursor: text;
}

.wgs-search__input::placeholder {
  color: #757575;
}

.wgs-search__button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: #08090a;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 3;
  pointer-events: auto;
}

.wgs-search__button:hover {
  background: #4bcd95;
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 6px 20px rgba(45, 55, 72, 0.4);
}

.wgs-search__button i {
  width: 20px;
  height: 20px;
}

.wgs-search__popular {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.wgs-search__popular-label {
  color: #757575;
  font-size: 0.875rem;
  font-weight: 500;
  margin-right: 0;
  white-space: nowrap;
}

.wgs-search__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.wgs-search__tag {
  background: #08090a;
  color: #e2e8f0;
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  text-decoration: none;
}

.wgs-search__tag:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .wgs-search {
    padding: 157px 20px;
    min-height: 350px;
    padding-bottom: 60px;
  }

  .wgs-search__title {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    max-width: 390px;
  }

  .wgs-search__subtitle {
    font-size: 18px;
    margin-bottom: 2rem;
  }

  .wgs-search__form-box {
    max-width: 100%;
  }

  .wgs-search__input {
    padding: 14px 20px;
    padding-right: 65px;
    font-size: 16px;
  }

  .wgs-search__input::placeholder {
    font-size: 14px;
  }

  .wgs-search__button {
    width: 44px;
    height: 44px;
  }

  .wgs-search__popular {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .wgs-search__popular-label {
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .wgs-search__title {
    font-size: 1.875rem;
  }

  .wgs-search__tag {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
}

@media (max-width: 420px) {
  .wgs-search {
    padding: 128px 20px;
    padding-bottom: 60px;
  }
}

@media (max-width: 360px) {
  .wgs-search__title {
    font-size: 28px;
  }
}

.widget-search-more {
  color: #fff;
  text-decoration: underline;
  font-size: 14px;
}

.wgs-search__form-wrapper {
  z-index: 1020;
  position: relative;
}

.wgs-search__dropdown.wgs-search__dropdown-hidden {
  top: 80%;
  opacity: 0;
  visibility: hidden;
}

.wgs-search__dropdown {
  visibility: visible;
  position: absolute;
  top: 75px;
  left: 0;
  width: 100%;
  opacity: 1;
  margin-top: 0.5rem;
  z-index: 1050;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid #323336;
  backdrop-filter: blur(12px);
  background: #252628;
  transition: all 0.25s ease;
}

.wgs-search__section {
  padding-left: 25px;
  padding-right: 25px;
  padding-top: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid #36373a;
}

.wgs-search__section .search-list-options {
  text-align: left;
}

.wgs-search__section .search-list-options a {
  font-size: 14px;
  font-weight: 500;
  padding: 8px;
  line-height: 1;
  color: #fff;
  border-radius: 6px;
  transition: all 350ms ease;
  text-transform: capitalize;
}

.wgs-search__section .search-list-options a:hover {
  background: #2e2f32;
  color: #71ca99;
}

.wgs-search__section .search-list-options i,
.wgs-search__section .search-list-options svg {
  width: 22px;
  height: 22px;
  color: #bebebf;
  margin-right: 10px;
}

.wgs-search__section .search-list-options a:hover i,
.wgs-search__section .search-list-options a:hover svg {
  color: #71ca99;
}

.wgs-search__dropdown.show {
  opacity: 1;
  transform: translateY(0);
}

.wgs-search__dropdown.d-none {
  opacity: 0;
  transform: translateY(-5px);
  pointer-events: none;
}

.wgs-search__input:focus + .wgs-search__button + #searchDropdown {
  display: block !important;
}

.widget-search-title {
  color: #757575;
  font-size: 14px;
}

/* ElasticPress Autosuggest Styles - Adapted for Dark Theme */
.ep-autosuggest-container {
  position: relative;
}

.ep-autosuggest-container .ep-autosuggest,
.ep-autosuggest {
  /* Added standalone selector for robustness */
  background: #252628;
  background: var(--ep-c-white);
  border: 1px solid #323336;
  border: 1px solid var(--ep-c-white-gray);
  -webkit-box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: none;
  position: absolute;
  width: 100%;
  z-index: 200;
  border-radius: 1rem;
  backdrop-filter: blur(12px);
  margin-top: 0.5rem;
  max-height: 420px;
  overflow-y: auto;
  top: 75px; /* Ensure positioning */
  left: 0;
}

/* Ensure it's visible when active/detected */
.ep-autosuggest.show,
.ep-autosuggest[style*="display: block"] {
  display: block !important;
  opacity: 1;
  visibility: visible;
}

.ep-autosuggest-container .ep-autosuggest > ul,
.ep-autosuggest > ul {
  list-style: none;
  margin: 0 !important;
  padding: 25px;
}

.ep-autosuggest-container .ep-autosuggest > ul > li,
.ep-autosuggest > ul > li {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
}

.ep-autosuggest-container .ep-autosuggest > ul > li > a.autosuggest-link,
.ep-autosuggest > ul > li > a.autosuggest-link {
  color: #ffffff;
  color: var(--ep-c-black);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 350ms ease;
  gap: 10px;
  text-decoration: none;
}

.ep-autosuggest-container .ep-autosuggest > ul > li > a.autosuggest-link:active,
.ep-autosuggest-container .ep-autosuggest > ul > li > a.autosuggest-link:hover,
.ep-autosuggest > ul > li > a.autosuggest-link:hover,
.ep-autosuggest > ul > li[aria-selected="true"] > a.autosuggest-link {
  background-color: #2e2f32;
  background-color: var(--ep-c-medium-white);
  color: #71ca99;
  color: var(--ep-c-highlight);
  -webkit-text-decoration: none;
  text-decoration: none;
}

.ep-autosuggest-container .selected,
.ep-autosuggest .selected {
  background-color: #2e2f32;
  background-color: var(--ep-c-medium-white);
  -webkit-text-decoration: none;
  text-decoration: none;
}

/* Icons in suggestions */
.ep-autosuggest .autosuggest-icon,
.ep-autosuggest .autosuggest-link i,
.ep-autosuggest .autosuggest-link svg {
  width: 22px;
  height: 22px;
  color: #bebebf;
  flex-shrink: 0;
}

.ep-autosuggest .autosuggest-link:hover .autosuggest-icon,
.ep-autosuggest .autosuggest-link:hover i,
.ep-autosuggest .autosuggest-link:hover svg,
.ep-autosuggest .autosuggest-item[aria-selected="true"] .autosuggest-icon,
.ep-autosuggest .autosuggest-item[aria-selected="true"] i,
.ep-autosuggest .autosuggest-item[aria-selected="true"] svg {
  color: #71ca99;
}

/* Loading state */
.is-loading .wgs-search__button {
  opacity: 0.6;
  pointer-events: none;
}

.is-loading .wgs-search__button::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hide default loading indicator */
.ep-autosuggest .ep-autosuggest-loading {
  display: none;
}
