/* Qubyt Core — algoritma sayfaları canlı devre + örnek histogram (pilot) */

.algo-live-demo {
  margin: 1.35rem 0 0;
  padding: 0;
}

.algo-live-demo__intro {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(154, 163, 181, 0.92);
}

.algo-live-demo__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 900px) {
  .algo-live-demo__grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    /* stretch: histogram panelinde gereksiz dikey kaydırma çubuğu */
    align-items: start;
  }
}

.algo-live-demo__panel {
  margin: 0;
  min-width: 0;
  overflow: visible;
  padding: 0.85rem 0.9rem 0.95rem;
  border-radius: var(--radius);
  border: 1px solid rgba(167, 139, 250, 0.18);
  background:
    linear-gradient(165deg, rgba(167, 139, 250, 0.05) 0%, transparent 48%),
    rgba(8, 10, 18, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.algo-live-demo__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.65rem;
}

.algo-live-demo__tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4b5fd;
}

.algo-live-demo__title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.95);
}

.algo-live-demo__circuit-frame {
  --circuit-wire: #7dd3fc;
  --circuit-muted: #94a3b8;
  --circuit-gate-text: #fca5a5;
  --circuit-control: #fb923c;
  --circuit-classical: #6ee7b7;

  padding: 0.65rem 0.5rem 0.75rem;
  border-radius: calc(var(--radius-sm) - 2px);
  border: 1px solid rgba(125, 211, 252, 0.14);
  background: rgba(6, 8, 14, 0.65);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.algo-live-demo__circuit-frame .circuit-viz {
  display: block;
  width: 100%;
  min-width: 280px;
  height: auto;
}

.circuit-viz__col-bg {
  transition: fill 0.2s ease, stroke 0.2s ease, opacity 0.2s ease;
}

.circuit-viz__col--active .circuit-viz__col-bg {
  fill: rgba(167, 139, 250, 0.14);
  stroke: rgba(167, 139, 250, 0.42);
  stroke-width: 1;
}

.circuit-viz__col--dim .circuit-viz__col-bg {
  opacity: 0.45;
}

.algo-live-demo__moments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.55rem 0 0;
}

.algo-live-demo__moment-btn {
  margin: 0;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  background: rgba(8, 10, 18, 0.75);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(203, 213, 225, 0.9);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.algo-live-demo__moment-btn:hover {
  border-color: rgba(167, 139, 250, 0.45);
  color: #e2e8f0;
}

.algo-live-demo__moment-btn--active,
.algo-live-demo__moment-btn[aria-pressed="true"] {
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(167, 139, 250, 0.12);
  color: #e9d5ff;
}

.algo-live-demo__moment-btn--all {
  border-style: dashed;
  opacity: 0.92;
}

/* Tümü: moment turu oynatılırken */
.algo-live-demo__moment-btn--playing {
  border-color: rgba(110, 231, 183, 0.55);
  border-style: solid;
  background: rgba(110, 231, 183, 0.1);
  color: #a7f3d0;
  opacity: 1;
}

.algo-live-demo__moments[data-moment-tour="playing"] .algo-live-demo__moment-btn--all {
  border-style: solid;
}

.algo-live-demo__note {
  margin: 0.55rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: rgba(148, 163, 184, 0.88);
}

/* Faz 2 — öğretim alt-devresi kapsamı (grid altı) */
.algo-live-demo__scope {
  margin: 1rem 0 0;
  padding: 0.9rem 1rem 0.95rem;
  border-radius: calc(var(--radius-sm) - 2px);
  border: 1px solid rgba(167, 139, 250, 0.16);
  background:
    linear-gradient(165deg, rgba(167, 139, 250, 0.06) 0%, transparent 52%),
    rgba(10, 12, 20, 0.82);
  font-size: 0.84rem;
  line-height: 1.55;
  color: rgba(203, 213, 225, 0.92);
}

.algo-live-demo__scope p {
  margin: 0 0 0.65rem;
}

.algo-live-demo__scope p:last-child {
  margin-bottom: 0;
}

.algo-live-demo__scope strong {
  color: #c4b5fd;
  font-weight: 600;
}

[data-shots-histogram] {
  overflow: visible;
}

.algo-shots-histogram {
  padding: 0.35rem 0.15rem 0.2rem;
  overflow: visible;
}

.algo-shots-histogram__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: rgba(148, 163, 184, 0.9);
}

.algo-shots-histogram__shots {
  color: #bae6fd;
  font-weight: 600;
}

.algo-shots-histogram__bars {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.algo-shots-histogram__row {
  display: grid;
  grid-template-columns: 3.25rem 1fr 2.75rem;
  align-items: center;
  gap: 0.5rem;
}

.algo-shots-histogram__ket {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: 0.04em;
}

.algo-shots-histogram__track {
  position: relative;
  height: 0.48rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.algo-shots-histogram__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.95), rgba(125, 211, 252, 0.95));
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.35);
  transition: width 0.45s var(--ease-out, ease);
}

.algo-shots-histogram__pct {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-align: right;
  color: rgba(203, 213, 245, 0.9);
  font-variant-numeric: tabular-nums;
}

.algo-shots-histogram__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.algo-live-demo__err {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(248, 113, 113, 0.9);
}

@media (max-width: 599px) {
  .algo-shots-histogram__row {
    grid-template-columns: 2.85rem 1fr 2.5rem;
    gap: 0.4rem;
  }
}