/* ── Tech Stack Detector ──────────────────────────────────────────────────── */

/* Form (mirrors cms.css pattern) */
.td-form .form-row {
  display: flex;
  gap: 10px;
}
.td-form .input-wrap--url { flex: 1; }
.td-form .input {
  width: 100%;
  height: 44px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: var(--mono);
  transition: border-color .2s, box-shadow .2s;
}
.td-form .input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 138, 248, .3);
}
.td-form .btn-primary {
  min-height: 44px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .15s, filter .2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.td-form .btn-primary:hover  { transform: scale(1.02); filter: brightness(1.1); }
.td-form .btn-primary:active { transform: scale(.98); }
.td-form .btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }

/* Error */
.td-error {
  color: var(--red);
  font-size: 14px;
  margin-top: 16px;
  animation: fadeInUp .3s var(--ease-out);
}

/* Results wrapper */
#tdResults {
  margin-top: 16px;
  animation: fadeInUp .35s var(--ease-out);
}

/* Meta bar */
.td-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 12px;
}
.td-meta-url {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
}
.td-meta-time {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Empty state */
.td-empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
  animation: fadeInUp .3s var(--ease-out);
}
.td-empty-icon {
  display: block;
  font-size: 36px;
  margin-bottom: 14px;
}
.td-empty strong {
  display: block;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 8px;
}
.td-empty p {
  font-size: 13px;
  margin: 0;
}

/* Category section */
.td-category {
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  animation: fadeInUp .35s var(--ease-out);
}
.td-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(91, 138, 248, .12);
}
.td-category-icon {
  font-size: 16px;
  line-height: 1;
}
.td-category-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  flex: 1;
}
.td-category-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(91, 138, 248, .1);
  border: 1px solid rgba(91, 138, 248, .2);
  border-radius: 10px;
  padding: 1px 8px;
}

/* Card grid */
.td-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

/* Individual card */
.td-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  transition: border-color .15s, background .15s;
  min-width: 0;
}
.td-card:hover {
  border-color: var(--accent);
  background: rgba(91, 138, 248, .04);
}
.td-card-icon {
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}
.td-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* Version badge */
.td-version {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(91, 138, 248, .1);
  color: var(--accent);
  border: 1px solid rgba(91, 138, 248, .2);
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--mono);
}

/* History */
.td-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 10px;
}
.td-history-header h3 {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 0;
}
.td-history-clear {
  font-size: 12px;
  color: var(--red);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  transition: opacity .15s;
}
.td-history-clear:hover { opacity: .7; }
.td-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 6px;
  transition: border-color .15s;
}
.td-history-item:hover { border-color: var(--accent); }
.td-history-url {
  font-size: 13px;
  color: var(--text);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.td-history-meta {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 600px) {
  .td-form .form-row { flex-direction: column; }
  .td-form .btn-primary { width: 100%; justify-content: center; }
  .td-form .input { width: 100%; }
  .td-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
  .td-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
}
