/* Guidee Custom Search Bar - Phase 7 Live + Mobile
 * Version 1.1.0
 * Live suggestions with thumbnails + mobile optimized
 */

.guidee-custom-search-wrapper {
  width: 100%;
  height: 40px;
  position: relative;
  z-index: 10000;
}

/* Hide browser default clear button (blue X) */
.guidee-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.guidee-search-input::-webkit-search-decoration {
  -webkit-appearance: none !important;
}

.guidee-search-input::-ms-clear,
.guidee-search-input::-ms-reveal {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.guidee-search-input[type="search"] {
  -moz-appearance: none !important;
}

/* Overlay */
.guidee-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 998;
  display: none;
}

.guidee-search-overlay.active {
  display: block;
}

.guidee-custom-search-form {
  width: 100%;
  height: 100%;
}

.guidee-search-input-container {
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
  background: #f8f8f8;
  border-radius: 20px;
  padding: 0 48px 0 0;
  transition: background 0.3s ease;
  position: relative;
  border: none !important;
  z-index: 10000;
}

/* Hide bottom corners when dropdown active */
.guidee-custom-search-form.dropdown-active .guidee-search-input-container {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.guidee-custom-search-form:focus-within .guidee-search-input-container {
  background: #f8f8f8;
}

/* Reliable separator via ::after - 90% length */
.guidee-search-input-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 5%;
  right: 5%;
  width: 90%;
  height: 1px;
  background: #dddddd;
  display: none;
  margin: 0 auto;
}

.guidee-custom-search-form.dropdown-active .guidee-search-input-container::after {
  display: block;
}

.guidee-search-icon {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 45px;
  padding-left: 12px;
  color: #666666;
  pointer-events: none;
}

.guidee-search-input {
  flex: 1;
  height: 100%;
  border: none !important;
  background: transparent !important;
  padding: 0 10px 0 0 !important;
  font-size: 16px;
  outline: none !important;
  color: #333333;
  box-sizing: border-box !important;
}

.guidee-search-input::placeholder {
  color: #999999;
}

/* Clear */
.guidee-search-clear {
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 30px;
  background: transparent !important;
  border: none !important;
  cursor: pointer;
  color: #666666;
  z-index: 10001;
}

.guidee-search-clear.active {
  display: flex;
}

.guidee-search-clear:hover {
  background: #e8e8e8 !important;
  border-radius: 20px !important;
}

/* Submit */
.guidee-search-submit {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #000000 !important;
  border-radius: 50%;
  border: none !important;
  cursor: pointer;
  z-index: 10001;
  transition: transform 0.1s ease;
  font-size: 20px;
  color: white;
}

.guidee-custom-search-form:focus-within .guidee-search-submit {
  display: flex;
}

.guidee-search-submit:active {
  transform: translateY(-50%) scale(0.92);
}

.guidee-search-submit::after {
  content: '\2192';
}

/* Dropdown */
.guidee-search-results-dropdown {
  position: absolute;
  top: 40px;
  left: 0;
  width: 100%;
  background: #f8f8f8;
  border-radius: 0 0 20px 20px;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 10001;
  display: none;
  box-sizing: border-box;
  border: none !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.guidee-search-results-dropdown.active {
  display: block;
}

/* Suggestions */
.guidee-search-result-item {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.guidee-search-result-item:hover,
.guidee-search-result-item:focus {
  background: #e8e8e8;
  outline: none;
}

.guidee-search-result-thumbnail {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 6px;
  overflow: hidden;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guidee-search-result-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guidee-search-result-thumbnail .guidee-search-result-icon {
  width: 24px;
  height: 24px;
  color: #666;
}

.guidee-search-result-text {
  flex: 1;
  min-width: 0;
}

.guidee-search-result-title {
  font-weight: bold;
  color: #333333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guidee-search-result-subtitle {
  font-size: 14px;
  color: #999999;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile */
@media (max-width: 767px) {
  .guidee-custom-search-wrapper {
    height: 48px;
  }

  .guidee-search-input-container {
    height: 48px;
    border-radius: 24px;
  }

  .guidee-custom-search-form.dropdown-active .guidee-search-input-container {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .guidee-search-input {
    font-size: 17px;
  }

  .guidee-search-results-dropdown {
    top: 48px;
    border-radius: 0 0 24px 24px;
    max-height: 80vh;
  }

  .guidee-search-result-item {
    padding: 16px 20px;
    gap: 18px;
  }

  .guidee-search-result-thumbnail {
    width: 60px;
    height: 60px;
  }

  .guidee-search-result-title {
    font-size: 16px;
  }

  .guidee-search-result-subtitle {
    font-size: 15px;
  }
}

/* Loading state */
.guidee-search-loading {
  padding: 20px;
  text-align: center;
  color: #999;
  font-style: italic;
}

/* No results */
.guidee-search-no-results {
  padding: 20px;
  text-align: center;
  color: #999;
}