/* ==========================================================================
   Search demo — the tabbed browser mock.

   Ported from the inline styles in
   src/app/(frontend)/how-it-works/how-it-works.html, which is where this
   component was first built. The class names are kept identical to that
   original (`arcrel-vis__*`) so the two stay diffable: if the demo is ever
   fixed in one place, a reader can find the matching rule in the other.

   Not extracted out of how-it-works.html into a shared sheet, deliberately.
   That file is a 7,000-line Elementor-era export with its own self-contained
   style block, and rewiring a working, indexed page to depend on an external
   sheet is a real risk for no benefit to this task. The duplication is the
   cheaper mistake. If a third page ever needs this, that is the moment to
   pull all three onto one sheet.

   Scoped variables rather than the original's :root-ish block, so nothing
   here leaks into the rest of the page.
   ========================================================================== */

.mseo-demo {
  --card: #141420;
  --card-2: #191926;
  --purple: #6119ac;
  --purple-bright: #8b5cf6;
  --purple-glow: #7c3aed;
  --purple-soft: rgba(139, 92, 246, 0.14);
  --purple-border: rgba(139, 92, 246, 0.24);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.12);
  --green-glow: rgba(34, 197, 94, 0.35);
  --white: #ffffff;
  --text: #e8e8f0;
  --muted: #a1a1b5;
  --faint: #6c6c80;
  --line: #2a2a3d;
  --serp-title: #99c3ff;
  --serp-url: #b9b9c8;
  --font-head: var(--font-display);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Demo column ─────────────────────────────────────── */
.arcrel-vis__demo-caption {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 16px;
}

.arcrel-vis__demo-caption-label {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple-bright);
}

.arcrel-vis__demo-caption-sub {
  font-size: 13px;
  color: var(--muted);
}

/* Tabs */
.arcrel-vis__tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 16px;
  max-width: 100%;
  flex-wrap: wrap;
}

.arcrel-vis__tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 9px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.25s var(--ease),
    color 0.25s var(--ease);
}

.arcrel-vis__tab:hover {
  color: var(--text);
}

.arcrel-vis__tab.is-active {
  background: linear-gradient(
    135deg,
    var(--purple) 0%,
    var(--purple-glow) 100%
  );
  color: var(--white);
  box-shadow: 0 6px 18px -8px rgba(97, 25, 172, 0.9);
}

.arcrel-vis__tab:focus-visible {
  outline: 2px solid var(--purple-bright);
  outline-offset: 2px;
}

/* Browser mock */
.arcrel-vis__browser {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow:
    0 40px 90px -30px rgba(97, 25, 172, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.arcrel-vis__browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: #1c1c28;
  border-bottom: 1px solid #000;
}

.arcrel-vis__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

.arcrel-vis__dot--r {
  background: #ff5f57;
}

.arcrel-vis__dot--y {
  background: #febc2e;
}

.arcrel-vis__dot--g {
  background: #28c840;
}

.arcrel-vis__browser-url {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 10px;
  padding: 5px 14px;
  background: #0f0f16;
  border-radius: 100px;
  font-size: 12px;
  color: #8a8a99;
  font-family: var(--font-body);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.arcrel-vis__lock {
  width: 13px;
  height: 13px;
  color: var(--green);
  flex-shrink: 0;
}

/* Google screen — fixed-height viewport that holds every panel */
.arcrel-vis__screen {
  position: relative;
  height: clamp(420px, 52vw, 500px);
  background: #ffffff;
  color: #202124;
  overflow: hidden;
}

/* Each tab is a panel that fills the viewport */
.arcrel-vis__panel {
  position: absolute;
  inset: 0;
  display: none;
}

.arcrel-vis__panel.is-active {
  display: block;
}

.arcrel-vis__panel--dark .arcrel-vis__stage--result {
  background: #0e0e14;
}

/* Two stages per panel: the homepage (typing) and the results */
.arcrel-vis__stage {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.45s var(--ease),
    transform 0.45s var(--ease);
}

.arcrel-vis__panel.is-searching .arcrel-vis__stage--home {
  opacity: 1;
  visibility: visible;
}

.arcrel-vis__panel.is-showing .arcrel-vis__stage--home {
  opacity: 0;
  transform: translateY(-14px);
}

.arcrel-vis__panel.is-showing .arcrel-vis__stage--result {
  opacity: 1;
  visibility: visible;
}

/* ── Stage 1 · Google homepage ── */
.arcrel-vis__stage--home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px;
  text-align: center;
  background: #fff;
}

.arcrel-vis__home-logo {
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.arcrel-vis__home-field {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(460px, 100%);
  height: 48px;
  padding: 0 20px;
  border: 1px solid #dfe1e5;
  border-radius: 100px;
  box-shadow: 0 1px 8px rgba(32, 33, 36, 0.14);
}

.arcrel-vis__home-btn {
  padding: 0.95em 2em;
  background: #f8f9fa;
  border: 1px solid #f8f9fa;
  border-radius: var(--radius);
  color: #3c4043;
  }

.arcrel-vis__search-icon {
  width: 18px;
  height: 18px;
  color: #9aa0a6;
  flex-shrink: 0;
}

.arcrel-vis__search-text {
  font-size: 15px;
  color: #202124;
  font-family: var(--font-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arcrel-vis__caret {
  width: 1.5px;
  height: 20px;
  background: #4285f4;
  margin-left: -8px;
  animation: arcrelVisBlink 1s step-end infinite;
  flex-shrink: 0;
}

@keyframes arcrelVisBlink {
  50% {
    opacity: 0;
  }
}

/* ── Stage 2 · Results ── */
.arcrel-vis__stage--result {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

/* Real screenshots bleed edge to edge and scroll if taller than the frame */
.arcrel-vis__panel--shot .arcrel-vis__stage--result {
  font-size: 0;
}

.arcrel-vis__panel--shot img {
  display: block;
  width: 100%;
  height: auto;
}

/* Recreated results carry inner padding */
.arcrel-vis__result-inner {
  padding: clamp(16px, 2.4vw, 24px);
}

.arcrel-vis__result-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.arcrel-vis__logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.arcrel-vis__logo--sm {
  font-size: 19px;
}

.arcrel-vis__search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 18px;
  border: 1px solid #dfe1e5;
  border-radius: 100px;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.12);
}

.arcrel-vis__search-field--sm {
  height: 40px;
}

/* Result badge — fixed to the panel, above the scrolling screenshot */
.arcrel-vis__shot-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 100px;
  font-family: var(--font-head);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 0.4s var(--ease) 0.1s,
    transform 0.4s var(--ease) 0.1s;
}

.arcrel-vis__panel.is-showing .arcrel-vis__shot-badge {
  opacity: 1;
  transform: none;
}

.arcrel-vis__shot-badge svg {
  width: 13px;
  height: 13px;
}

.arcrel-vis__shot-badge--win {
  background: var(--green);
  color: #06210f;
  box-shadow: 0 6px 16px -4px var(--green-glow);
}

.arcrel-vis__shot-badge--ai {
  background: linear-gradient(
    135deg,
    var(--purple-bright),
    var(--purple-glow)
  );
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(124, 58, 237, 0.8);
}

/* Soft fade at the bottom of a scrollable screenshot to hint "more" */
.arcrel-vis__panel--shot.is-showing::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(255, 255, 255, 0.9)
  );
}

.arcrel-vis__panel--dark.is-showing::after {
  background: linear-gradient(180deg, transparent, rgba(14, 14, 20, 0.9));
}

/* The #1 winning result */
.arcrel-vis__winner {
  position: relative;
  padding: 18px 20px 20px;
  border: 2px solid var(--green);
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    rgba(34, 197, 94, 0.06),
    rgba(34, 197, 94, 0.02)
  );
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.08);
  margin-bottom: 22px;
}

.arcrel-vis__winner--you {
  border-style: dashed;
  border-color: var(--purple);
  background: linear-gradient(
    180deg,
    rgba(139, 92, 246, 0.08),
    rgba(139, 92, 246, 0.02)
  );
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.08);
}

.arcrel-vis__winner-badge {
  position: absolute;
  top: -13px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 100px;
  background: var(--green);
  color: #06210f;
  font-family: var(--font-head);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 16px -4px var(--green-glow);
  white-space: nowrap;
}

.arcrel-vis__winner--you .arcrel-vis__winner-badge {
  background: linear-gradient(
    135deg,
    var(--purple-bright),
    var(--purple-glow)
  );
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(124, 58, 237, 0.8);
}

.arcrel-vis__winner-badge svg {
  width: 13px;
  height: 13px;
}

.arcrel-vis__result-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 7px;
}

.arcrel-vis__favicon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--fav, #6119ac);
  color: #fff;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.arcrel-vis__favicon--ghost {
  background: transparent;
  border: 1.5px dashed var(--fav);
  color: var(--fav);
}

.arcrel-vis__result-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.arcrel-vis__result-name {
  font-size: 13px;
  color: #202124;
  font-weight: 500;
  line-height: 1.3;
}

.arcrel-vis__result-url {
  font-size: 12.5px;
  color: #4d5156;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arcrel-vis__result-title {
  display: block;
  color: #1a0dab;
  line-height: 1.3;
  margin-bottom: 5px;
  text-decoration: none;
}

.arcrel-vis__result-title:hover {
  text-decoration: underline;
}

.arcrel-vis__winner--you .arcrel-vis__result-title {
  color: var(--purple);
}

.arcrel-vis__result-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: #4d5156;
  font-family: var(--font-body);
}

/* The competitors below (dimmed) */
.arcrel-vis__losers {
  display: grid;
  gap: 15px;
  padding-left: 4px;
  opacity: 0.72;
}

.arcrel-vis__loser {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 16px;
  border-left: 2px solid #ececf0;
}

.arcrel-vis__loser span {
  font-size: 13px;
  color: #5f6368;
  font-weight: 500;
}

.arcrel-vis__loser i {
  font-style: normal;
  font-size: 14.5px;
  color: #7b7fce;
  font-family: var(--font-body);
}

@media (max-width: 560px) {
  .arcrel-vis__logo {
    font-size: 18px;
  }
  .arcrel-vis__home-btn {
    display: none;
  }
  .arcrel-vis__tab {
    padding: 9px 14px;
    font-size: 12.5px;
  }
  .arcrel-vis__winner-badge {
    font-size: 10.5px;
    padding: 4px 10px;
  }
}
