/* Docs Search Modal Styles */

.docs-search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding-top: 10vh;
}

.docs-search-modal.active {
  opacity: 1;
  pointer-events: all;
}

.docs-search-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.docs-search-dialog {
  position: relative;
  width: 90%;
  max-width: 600px;
  max-height: 70vh;
  background-color: #050505;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.docs-search-modal.active .docs-search-dialog {
  transform: scale(1);
}

.docs-search-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid #2a2a2a;
}

.docs-search-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.docs-search-icon {
  position: absolute;
  left: 0.75rem;
  width: 1rem;
  height: 1rem;
  color: #7d8187;
  pointer-events: none;
  z-index: 1;
}

.docs-search-input {
  width: 100%;
  height: 40px;
  padding: 0.5rem 2.5rem 0.5rem 2.5rem;
  background-color: #050505;
  border: 1px solid #2a2a2a;
  border-radius: 0.375rem;
  color: #ffffff;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.docs-search-input:focus {
  border-color: #ffffff;
}

.docs-search-input::placeholder {
  color: #7d8187;
}

.docs-search-clear {
  position: absolute;
  right: 0.5rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0.5px solid transparent;
  color: #7d8187;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: all 0.3s ease;
  padding: 0;
}

.docs-search-clear:hover {
  color: #ffffff;
  background-color: rgba(125, 129, 135, 0.1);
  border-color: rgba(125, 129, 135, 0.4);
}

.docs-search-clear svg {
  width: 16px;
  height: 16px;
}

.docs-search-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0.5px solid #2a2a2a;
  border-radius: 0.375rem;
  color: #7d8187;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.docs-search-close:hover {
  color: #ffffff;
  border-color: rgba(125, 129, 135, 0.4);
  background-color: rgba(125, 129, 135, 0.1);
}

.docs-search-close svg {
  width: 18px;
  height: 18px;
}

.docs-search-results {
  flex: 1;
  overflow-y: auto;
  max-height: calc(70vh - 80px);
  padding: 0.5rem;
}

.docs-search-empty {
  padding: 2rem;
  text-align: center;
  color: #7d8187;
  font-size: 0.875rem;
}

.docs-search-result {
  padding: 0.75rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 0.5px solid transparent;
}

.docs-search-result:hover,
.docs-search-result.selected {
  background-color: rgba(125, 129, 135, 0.1);
  border-color: rgba(125, 129, 135, 0.4);
}

.docs-search-result-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.docs-search-result-page {
  font-size: 0.75rem;
  color: #7d8187;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docs-search-result-heading {
  font-size: 0.875rem;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.4;
}

.docs-search-result-heading mark {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 0 2px;
  border-radius: 2px;
}

.docs-search-result-preview {
  font-size: 0.8125rem;
  color: #7d8187;
  line-height: 1.5;
  margin-top: 0.5rem;
}

.docs-search-result-preview mark {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 0 2px;
  border-radius: 2px;
}

/* Preset Searches */
.docs-search-presets {
  padding: 0.5rem;
}

.docs-search-presets-header {
  padding: 0.75rem 0.5rem 0.5rem;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: 0.5rem;
}

.docs-search-presets-title {
  font-size: 0.75rem;
  color: #7d8187;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.docs-search-presets-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.docs-search-preset {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  width: 100%;
  color: #7d8187;
}

.docs-search-preset:hover {
  color: #ffffff;
  border-color: rgba(125, 129, 135, 0.4);
  background: rgba(125, 129, 135, 0.1);
}

.docs-search-preset-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.docs-search-preset-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: inherit;
  transition: color 0.3s ease;
}

.docs-search-preset-description {
  font-size: 0.8125rem;
  color: #7d8187;
  transition: color 0.3s ease;
}

.docs-search-preset:hover .docs-search-preset-description {
  color: rgba(255, 255, 255, 0.7);
}

.docs-search-preset-arrow {
  flex-shrink: 0;
  color: #7d8187;
  transition: all 0.3s ease;
  margin-left: 0.75rem;
}

.docs-search-preset:hover .docs-search-preset-arrow {
  color: #ffffff;
  transform: translateX(2px);
}

/* Mobile optimizations */
@media (max-width: 640px) {
  .docs-search-modal {
    padding-top: 5vh;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .docs-search-dialog {
    width: 100%;
    max-height: 85vh;
  }

  .docs-search-header {
    padding: 0.75rem;
  }

  .docs-search-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .docs-search-results {
    max-height: calc(85vh - 70px);
  }

  .docs-search-close {
    width: 28px;
    height: 28px;
  }

  .docs-search-presets {
    padding: 0.25rem;
  }

  .docs-search-preset {
    padding: 0.625rem;
  }

  .docs-search-preset-title {
    font-size: 0.8125rem;
  }

  .docs-search-preset-description {
    font-size: 0.75rem;
  }
}

/* Custom scrollbar for results - Hidden but scroll functionality maintained */
.docs-search-results {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.docs-search-results::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}
