/* ── Domain Info Button ─────────────────────────────────────────── */
.domain-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted, #888);
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  flex-shrink: 0;
  vertical-align: middle;
  position: relative;
  /* smooth color + scale on press */
  transition: color 0.18s ease, background 0.18s ease, transform 0.12s ease;
}

.domain-info-btn:hover {
  color: var(--accent, #4f8ef7);
  background: color-mix(in srgb, var(--accent, #4f8ef7) 12%, transparent);
  transform: scale(1.15);
}

.domain-info-btn:active {
  transform: scale(0.88);
}

/* pulse ring when tooltip is open */
.domain-info-btn.is-active {
  color: var(--accent, #4f8ef7);
  background: color-mix(in srgb, var(--accent, #4f8ef7) 16%, transparent);
}

.domain-info-btn.is-active::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--accent, #4f8ef7);
  opacity: 0;
  animation: dtt-ring 1.6s ease-out infinite;
}

@keyframes dtt-ring {
  0% {
    opacity: 0.6;
    transform: scale(0.85);
  }

  100% {
    opacity: 0;
    transform: scale(1.7);
  }
}

/* ── Tooltip ─────────────────────────────────────────────────────── */
.result-breadcrumb {
  position: relative;
}

/*
  CHANGED: position: fixed (was: absolute, top/left anchored to breadcrumb).
  Fixed positioning is set relative to the viewport, and its exact
  top/left/right/bottom are calculated + written inline by JS
  (positionDomainTooltip in results.php) every time the tooltip opens,
  so it always flips/clamps to stay fully on-screen instead of being
  cut off by the header or the window edges.
  Use visibility/opacity/transform so CSS transitions still work
  (display:none can't be transitioned).
*/
.domain-tooltip {
  position: fixed;
  z-index: 200;
  min-width: 240px;
  max-width: 300px;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .06), 0 12px 28px -4px rgba(0, 0, 0, .14);
  font-size: 0.8rem;
  line-height: 1.4;
  pointer-events: none;

  /* hidden state */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top left;
  transition:
    opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s linear 0.2s;
}

.domain-tooltip.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition:
    opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s linear 0s;
}

.dark .domain-tooltip {
  background: #1e1e2e;
  border-color: #333;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .3), 0 12px 28px -4px rgba(0, 0, 0, .5);
}

/* ── Inner content ───────────────────────────────────────────────── */
.domain-tooltip-inner {
  padding: 11px 13px;
}

/* Rows fade in staggered once tooltip opens */
.domain-tooltip.is-open .dtt-badge,
.domain-tooltip.is-open .dtt-table tr,
.domain-tooltip.is-open .dtt-more-link {
  animation: dtt-row-in 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.domain-tooltip.is-open .dtt-badge {
  animation-delay: 0.04s;
}

.domain-tooltip.is-open .dtt-table tr:nth-child(1) {
  animation-delay: 0.07s;
}

.domain-tooltip.is-open .dtt-table tr:nth-child(2) {
  animation-delay: 0.10s;
}

.domain-tooltip.is-open .dtt-table tr:nth-child(3) {
  animation-delay: 0.13s;
}

.domain-tooltip.is-open .dtt-table tr:nth-child(4) {
  animation-delay: 0.16s;
}

.domain-tooltip.is-open .dtt-table tr:nth-child(5) {
  animation-delay: 0.19s;
}

.domain-tooltip.is-open .dtt-more-link {
  animation-delay: 0.22s;
}

@keyframes dtt-row-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading spinner */
.dtt-loading {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted, #888);
  font-style: normal;
  font-size: 0.78rem;
}

.dtt-loading::before {
  content: '';
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  border: 2px solid color-mix(in srgb, var(--accent, #4f8ef7) 30%, transparent);
  border-top-color: var(--accent, #4f8ef7);
  border-radius: 50%;
  animation: dtt-spin 0.7s linear infinite;
}

@keyframes dtt-spin {
  to {
    transform: rotate(360deg);
  }
}

.dtt-error {
  color: var(--text-muted, #888);
  font-style: italic;
  font-size: 0.78rem;
}

/* ── Badge ───────────────────────────────────────────────────────── */
.dtt-badge {
  display: inline-block;
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 9px;
}

.badge-ok {
  background: #d4f0de;
  color: #1a7a3a;
}

.badge-warn {
  background: #fff3cd;
  color: #856404;
}

.badge-new {
  background: #fde8e8;
  color: #b91c1c;
}

.dark .badge-ok {
  background: #1a3d27;
  color: #6ee7a0;
}

.dark .badge-warn {
  background: #3a2e10;
  color: #fcd34d;
}

.dark .badge-new {
  background: #3d1a1a;
  color: #fca5a5;
}

/* ── Table ───────────────────────────────────────────────────────── */
.dtt-table {
  width: 100%;
  border-collapse: collapse;
}

.dtt-table td {
  padding: 3px 0;
  vertical-align: top;
}

.dtt-table td:first-child {
  color: var(--text-muted, #888);
  padding-right: 10px;
  white-space: nowrap;
  font-weight: 500;
  font-size: 0.75rem;
}

.dtt-table code {
  font-size: 0.69rem;
  background: var(--code-bg, #f0f0f0);
  border-radius: 3px;
  padding: 1px 4px;
}

.dark .dtt-table code {
  background: #2a2a3a;
}

/* ── Wayback ─────────────────────────────────────────────────────── */
.dtt-wb-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.dtt-wb-link:hover {
  color: var(--accent, #4f8ef7);
}

.dtt-wb-age {
  display: inline-block;
  margin-left: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted, #888);
  background: var(--code-bg, #f0f0f0);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
}

.dark .dtt-wb-age {
  background: #2a2a3a;
}

/* ── More from domain link ───────────────────────────────────────── */
.dtt-more-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent, #4f8ef7);
  text-decoration: none;
  border-top: 1px solid var(--border, #e0e0e0);
  padding-top: 9px;
  width: 100%;
  transition: gap 0.15s ease, opacity 0.15s ease;
}

.dtt-more-link:hover {
  opacity: 0.8;
  gap: 8px;
  /* arrow slides right on hover */
}

.dark .dtt-more-link {
  border-top-color: #2a2a3a;
}




















/* ── Ghost Search Button ─────────────────────────────────────────── */
.ghost-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(128, 128, 128, 0);
  color: var(--text-muted, #888);
  cursor: pointer;
  padding: 0;
  margin-left: 2px;
  flex-shrink: 0;
  vertical-align: middle;
  position: relative;

  will-change: transform, background-color, color;
  -webkit-font-smoothing: antialiased;

  transition:
    color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.ghost-search-btn:hover {
  color: var(--accent, #4f8ef7) !important;
  background-color: var(--ghost-hover-bg, rgba(79, 142, 247, 0.12));
  transform: scale(1.18);
}

.ghost-search-btn:active {
  transform: scale(0.92);
  transition: transform 0.05s linear;
}

.dark .ghost-search-btn {
  --ghost-hover-bg: rgba(79, 142, 247, 0.2);
}

.ghost-search-btn svg {
  pointer-events: none;
  transition: transform 0.2s ease;
}
