/*
 * Guidee Custom Search Bar CSS - Phase 7 Live + Mobile
 * Version 1.1.0
 * Last modified: 2026-02-20
 * Live suggestions with thumbnails + mobile optimized
 * No shadows, typography follows spec (body 16-20px, line-height 140-175%)
 */

.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 for mobile/fullscreen feel */
.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;
}

/* Rounded corners change when dropdown opens */
.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;
}

/* Separator line – 90% width, only visible when dropdown active */
.guidee-search-input-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 5%;
  right: 5%;
  width: 90%;
  height: 1px;
  background: #dddddd;
  display: none;
}

.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;
  line-height: 140%;
  letter-spacing: 0.02em;
}

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

/* Clear button */
.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 button (magnifier on focus) */
.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 container */
.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;
}

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

/* Individual suggestion item */
.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: 600;
  color: #333333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 16px;
  line-height: 140%;
  letter-spacing: 0.02em;
}

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

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

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

  .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 & no-results states */
.guidee-search-loading {
  padding: 20px;
  text-align: center;
  color: #999;
  font-style: italic;
  font-size: 16px;
}

.guidee-search-no-results {
  padding: 20px;
  text-align: center;
  color: #999;
  font-size: 16px;
}