/* Tool Discovery Widget Styles */

.td-widget {
  position: relative;
  max-width: 520px;
  width: 100%;
  margin: 1.5rem auto;
  font-family: var(--body-font, 'Poppins', sans-serif);
}

.td-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.td-search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted, #7a8aaa);
  pointer-events: none;
  flex-shrink: 0;
}

.td-input {
  width: 100%;
  background: var(--bg-card, #151e30);
  border: 1px solid var(--border, #1e2a42);
  border-radius: var(--radius, 8px);
  padding: 0.85rem 1rem 0.85rem 3rem;
  color: var(--text, #e8eef8);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.3));
}

.td-input:focus {
  outline: none;
  border-color: var(--primary, #c89a0a);
  box-shadow: 0 0 0 3px var(--primary-soft, rgba(200,154,10,0.12)), var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.3));
}

.td-input::placeholder {
  color: var(--text-faint, #556580);
}

.td-clear {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted, #7a8aaa);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  transition: all 0.15s ease;
}

.td-clear:hover {
  background: var(--primary-soft, rgba(200,154,10,0.12));
  color: var(--primary, #c89a0a);
}

.td-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card, #151e30);
  border: 1px solid var(--border, #1e2a42);
  border-radius: var(--radius, 8px);
  box-shadow: var(--shadow, 0 8px 32px rgba(0,0,0,0.4));
  overflow: hidden;
  z-index: 100;
  max-height: 480px;
  overflow-y: auto;
}

.td-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: background 0.1s ease;
  border-bottom: 1px solid var(--border, #1e2a42);
}

.td-item:last-child {
  border-bottom: none;
}

.td-item:hover,
.td-item.td-selected {
  background: var(--primary-soft, rgba(200,154,10,0.12));
}

.td-item-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
  width: 2.25rem;
  text-align: center;
}

.td-item-content {
  flex: 1;
  min-width: 0;
}

.td-item-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text, #e8eef8);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td-item-desc {
  font-size: 0.8rem;
  color: var(--text-muted, #7a8aaa);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.td-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.td-category {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--primary, #c89a0a);
  background: var(--primary-soft, rgba(200,154,10,0.12));
  padding: 0.12rem 0.5rem;
  border-radius: 20px;
}

.td-badge {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--warning, #eab308);
  background: var(--warning-soft, rgba(234,179,8,0.12));
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.td-arrow {
  color: var(--text-faint, #556580);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.td-item:hover .td-arrow,
.td-item.td-selected .td-arrow {
  transform: translateX(4px);
  color: var(--primary, #c89a0a);
}

.td-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted, #7a8aaa);
  gap: 0.75rem;
}

.td-empty svg {
  opacity: 0.4;
}

/* Hero placement variant */
.td-hero {
  margin-top: 1.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.td-hero .td-input {
  font-size: 1.05rem;
  padding: 1rem 1.25rem 1rem 3.5rem;
  border-radius: 10px;
}

.td-hero .td-search-icon {
  left: 1.25rem;
  width: 24px;
  height: 24px;
}

.td-hero .td-clear {
  right: 1.25rem;
}

/* Sidebar/compact variant */
.td-compact .td-input {
  padding: 0.65rem 0.85rem 0.65rem 2.5rem;
  font-size: 0.85rem;
}

.td-compact .td-search-icon {
  left: 0.75rem;
  width: 18px;
  height: 18px;
}

/* Responsive */
@media (max-width: 480px) {
  .td-results {
    left: -1rem;
    right: -1rem;
    border-radius: 0 0 var(--radius, 8px) var(--radius, 8px);
    max-height: 60vh;
  }

  .td-item {
    padding: 0.75rem 0.85rem;
  }

  .td-item-name {
    font-size: 0.88rem;
  }

  .td-item-desc {
    font-size: 0.75rem;
  }
}

/* Print */
@media print {
  .td-widget { display: none !important; }
}