/* CSS styles for the combined image/text search panel dialog */
/* ===== TEXT SEARCH PANEL ===== */
#textSearchPanel {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 40px;
  background: rgba(30, 30, 30, 0.75);
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
  padding: 1.2em 1.5em;
  z-index: 2000;
  min-width: 300px;
  transition: opacity 0.2s;
}

.search-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5em;
  position: relative;
}

.search-input-container {
  position: relative;
  display: flex;
  width: 100%;
}

.search-input-container label {
  color: #fff;
  font-size: 1em;
  margin-right: 0.5em;
  white-space: nowrap;
}

.search-input-container input[type="text"] {
  margin-right: 1em;
  min-width: 120px;
}

#searchInput,
#negativeSearchInput {
  flex: 1;
  font-size: 1.1em;
  padding: 0.4em 2.2em 0.4em 0.7em;
  border-radius: 6px;
  border: 1px solid #888;
  background: #222;
  color: #fff;
  width: 350px;
  min-width: 200px;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
}

#clearTextSearchBtn,
#clearNegativeTextSearchBtn {
  position: absolute;
  right: 0.5em;
  top: 50%;
  transform: translate(-10px, -100%);
  background: #333;
  border: none;
  border-radius: 6px;
  width: 1.8em;
  height: 1.8em;
  color: #fff;
  font-size: 1.1em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#doSearchBtn {
  margin-left: 1em;
  padding: 0.4em 1.2em;
  border-radius: 6px;
  border: none;
  background: #444;
  color: #fff;
  font-size: 1em;
  cursor: pointer;
  align-self: flex-end;
}

.vertical-search-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  width: 100%;
}

.search-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5em;
  width: 100%;
}

.search-label {
  min-width: 80px;
  text-align: right;
  color: #fff;
  font-size: 1em;
  margin-right: 0.5em;
}

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

.search-field-wrapper input[type="text"] {
  width: 100%;
  font-size: 1.1em;
  padding: 0.4em 2.2em 0.4em 0.7em;
  border-radius: 6px;
  border: 1px solid #888;
  background: #222;
  color: #fff;
}

.search-label[for="searchInput"],
.search-label[for="negativeSearchInput"] {
  color: #faea0e;
  font-weight: bold;
}

.query-image-label,
.query-image {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 0.3em 0.8em;
  border-radius: 6px;
  font-size: 1.1em;
  font-weight: bold;
  z-index: 5000;
  pointer-events: none;
  user-select: none;
}
.query-image {
  width: 32px;
  height: 32px;
  background-size: cover;
  background-position: center;
  border-radius: 50%;
}

.upload-link-container {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -18px);
  margin-top: 2px;
  white-space: nowrap;
}

.upload-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  padding: 2px 4px;
  border-radius: 3px;
}

.upload-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.upload-link:active {
  background: rgba(255, 255, 255, 0.2);
}


.button-label {
  font-size: 12px;
  color: #fff;
  text-align: center;
  opacity: 0.8;
}

.search-icon-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.clear-search-container:has(#clearSearchBtn[style*="display: none"]) {
  display: none;
}

#clearSearchBtn[style*="display: none"] + .button-label {
  display: none;
}

.search-bottom-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-top: 1em;
  width: 100%;
  gap: 1em;
}

.weight-row {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 0.2em;
}

.search-upload-hint {
  flex: 1;
  min-width: 0;
  white-space: normal;
}

.search-input-container.vertical-search-inputs {
  display: flex;
  flex-direction: row;
  gap: 1.5em;
  width: 100%;
}

.search-image-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 140px;
  max-width: 180px;
  flex-shrink: 0;
  margin-right: 0.5em;
}

.search-image-column .search-row {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
}

.search-image-column .search-field-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: auto !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
  padding: 0;
}

.search-fields-column {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.5em 1em;
  align-items: start;
  width: 100%;
}

.search-label {
  grid-column: 1;
  text-align: right;
  align-self: start;
  margin-top: 0.2em;
  width: 140px;
  box-sizing: border-box;
}

.search-field-wrapper {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  width: 100%;
  position: relative;
}

.search-field-wrapper input[type="text"] {
  width: 100%;
  font-size: 1.1em;
  padding: 0.4em 2.2em 0.4em 0.7em;
  border-radius: 6px;
  border: 1px solid #888;
  background: #222;
  color: #fff;
}

.search-image-label {
  color: #faea0e;
  font-weight: bold;
  font-size: 1.08em;
  margin-bottom: 0.4em;
  text-align: center;
  width: 100%;
  letter-spacing: 0.5px;
}

#searchImageThumbArea {
  width: 120px;
  height: 120px;
  margin-bottom: 0.7em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-thumb-img {
  max-width: 110px;
  max-height: 110px;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  background: #222;
}

.search-thumb-placeholder {
  width: 110px;
  height: 110px;
  border: 2px dashed #aaa;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  background: #181818;
  cursor: pointer;
  transition: border-color 0.2s;
  font-size: 2.2em;
}


/* ===== WEIGHT SLIDER WIDGET ===== */
.weight-slider {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 0.3em;
  margin-bottom: 0.3em;
  user-select: none;
}

.weight-slider-bar {
  width: 120px;
  height: 10px;
  background: #333;
  border-radius: 5px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}

.weight-slider-fill {
  height: 100%;
  background: linear-gradient(90deg, #faea0e 60%, #fff700 100%);
  border-radius: 5px 0 0 5px;
  transition: width 0.15s;
}

.weight-slider-value {
  min-width: 2.5em;
  text-align: right;
  color: #faea0e;
  font-size: 0.95em;
  margin-left: 0.5em;
  font-family: monospace;
}

/* Field-specific weight sliders */
#imgPromptWeightSlider {
  transform: translateX(-25%);
  margin-left: 0 auto;
  display: flex;
  justify-content: center;
}

#posPromptWeightSlider,
#negPromptWeightSlider {
  width: max-content;
}

#closeTextSearchBtn {
  position: absolute;
  top: 0.7em;
  right: 0.7em;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5em;
  cursor: pointer;
  z-index: 10;
  padding: 0;
  line-height: 1;
}

#imageSearchBtn.dragover,
#searchPanel.dragover,
#textSearchPanel.dragover,
#searchImageThumbArea.dragover {
  outline: 2px dashed limegreen;
  background: rgba(0, 255, 0, 0.1);
}
