
/* ========================================
   EUPHORIAXEPLEX GLOBAL SEARCH
======================================== */

.search-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  z-index: 10000;
  margin-left: 10px;
}

/* SEARCH ICON BUTTON */
button#searchToggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 44px !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 10px !important;

  color: #c4baff !important;
  background: #101630 !important;
  border: 1px solid #7567d9 !important;
  border-radius: 10px !important;

  cursor: pointer;
  position: relative;
  z-index: 10002;
  box-sizing: border-box;
  font-size: 0 !important;
  line-height: 1 !important;

  transition:
    background .2s ease,
    border-color .2s ease,
    box-shadow .2s ease;
}

button#searchToggle svg {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;

  width: 24px !important;
  min-width: 24px !important;
  height: 24px !important;
  min-height: 24px !important;

  overflow: visible;
  fill: none !important;
  stroke: #c4baff !important;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

button#searchToggle:hover,
button#searchToggle[aria-expanded="true"] {
  background: #25204c !important;
  border-color: #a394ff !important;
  box-shadow: 0 0 15px #7160ff55;
}

/* FLOATING SEARCH POPUP */
#searchPopup {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;

  width: 420px;
  max-width: calc(100vw - 24px);
  padding: 12px;

  background: #0c1025;
  border: 1px solid rgba(130, 120, 255, .55);
  border-radius: 14px;

  box-shadow: 0 16px 45px rgba(0, 0, 0, .7);
  z-index: 10001;
  box-sizing: border-box;
}

#searchPopup[hidden] {
  display: none !important;
}

/* SEARCH INPUT */
.search-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;

  width: 100%;
  min-height: 48px;
  padding: 0 10px;

  box-sizing: border-box;
  background: #101630;
  border: 1px solid rgba(130, 120, 255, .45);
  border-radius: 9px;

  transition: border-color .2s ease;
}

.search-wrapper:focus-within {
  border-color: #9b8cff;
  box-shadow: 0 0 10px #7160ff22;
}

.search-wrapper input {
  flex: 1;
  width: 0;
  min-width: 0;
  height: 40px;

  padding: 0;
  margin: 0;
  border: 0;
  outline: none;

  background: transparent;
  color: #fff;

  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 600;
}

.search-wrapper input::placeholder {
  color: #8490b8;
}

.search-wrapper input::-webkit-search-cancel-button {
  display: none;
}

/* CLEAR AND CLOSE BUTTONS */
button.search-action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;

  min-width: 28px;
  min-height: 30px;
  padding: 5px;

  border: none;
  border-radius: 6px;
  background: transparent;
  color: #b8aaff;

  cursor: pointer;
  font-size: 17px;
}

button.search-action:hover {
  background: #7567d933;
  color: white;
}

button.search-action[hidden] {
  display: none !important;
}

/* DROPDOWN RESULTS */
#searchResults {
  display: block;
  width: 100%;
  max-height: 320px;
  overflow-y: auto;

  margin-top: 8px;
  padding: 5px;

  background: #090d1e;
  border: 1px solid rgba(120, 130, 255, .25);
  border-radius: 9px;
  box-sizing: border-box;

  scrollbar-width: thin;
  scrollbar-color: #7567d9 #090d1e;
}

#searchResults[hidden] {
  display: none !important;
}

.search-result {
  display: block;
  width: 100%;
  padding: 11px 12px;

  text-align: left;
  overflow-wrap: anywhere;

  color: #dce3ff;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(130, 140, 200, .12);
  border-radius: 6px;

  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
}

.search-result:last-child {
  border-bottom: none;
}

.search-result:hover,
.search-result:focus-visible {
  outline: none;
  background: rgba(105, 95, 255, .18);
}

.search-result strong {
  display: block;
  color: #a89aff;
  font-family: 'Russo One', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .4px;
}

.search-result span {
  display: block;
  margin-top: 5px;
  color: #aab5d9;
  line-height: 1.4;
}

.search-empty {
  padding: 18px 10px;
  color: #aab5d9;
  text-align: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
}

/* HIGHLIGHTED MATCH */
.search-highlight {
  background: #ffe45c;
  color: #171329;
  padding: 1px 3px;
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(255, 228, 92, .3);
  scroll-margin-top: 100px;
}

/* MOBILE */
@media (max-width: 600px) {
  .search-container {
    margin-left: 5px;
  }

  button#searchToggle {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    flex-basis: 40px !important;
  }

  #searchPopup {
    position: fixed;
    top: 75px;
    left: 12px;
    right: 12px;

    width: auto;
    max-width: none;
  }

  #searchResults {
    max-height: 55vh;
  }
}
