/* Qubyt Core — Bloch küresi etkileşimli demo (qubit-and-bloch-sphere) */

.algo-bloch-demo {
  margin: 1.5rem 0 1.75rem;
  padding: 0;
  border: none;
  background: transparent;
}

.algo-bloch-demo__frame {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid rgba(167, 139, 250, 0.22);
  background:
    radial-gradient(ellipse 85% 70% at 15% 10%, rgba(167, 139, 250, 0.1), transparent 55%),
    radial-gradient(ellipse 70% 60% at 88% 92%, rgba(56, 189, 248, 0.08), transparent 50%),
    rgba(8, 10, 18, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 48px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.algo-bloch-demo__canvas {
  display: block;
  width: 100%;
  height: auto;
  min-height: clamp(260px, 40vh, 370px);
  max-height: 390px;
  aspect-ratio: 16 / 10;
  cursor: grab;
}

.algo-bloch-demo__canvas.is-dragging {
  cursor: grabbing;
}

.algo-bloch-demo__tagbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid rgba(167, 139, 250, 0.14);
  background: rgba(6, 8, 16, 0.55);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(154, 163, 181, 0.85);
}

.algo-bloch-demo__tag {
  color: #c4b5fd;
  font-weight: 600;
}

.algo-bloch-demo__badge {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: help;
}

.algo-bloch-demo__hint {
  color: rgba(148, 163, 184, 0.75);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.02em;
}

.algo-bloch-demo__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid rgba(167, 139, 250, 0.12);
}

@media (min-width: 900px) {
  .algo-bloch-demo__body {
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  }
}

.algo-bloch-demo__controls {
  padding: 1rem 1.1rem 1.15rem;
  border-bottom: 1px solid rgba(167, 139, 250, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

@media (min-width: 900px) {
  .algo-bloch-demo__controls {
    border-bottom: none;
    border-right: 1px solid rgba(167, 139, 250, 0.1);
  }
}

.algo-bloch-demo__group-label {
  margin: 0 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(186, 230, 253, 0.9);
}

.algo-bloch-demo__gates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.algo-bloch-demo__btn {
  margin: 0;
  padding: 0.42rem 0.72rem;
  border-radius: calc(var(--radius-sm) - 2px);
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.12);
  color: #e9d5ff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.12s ease;
}

.algo-bloch-demo__btn:hover {
  background: rgba(167, 139, 250, 0.22);
  border-color: rgba(196, 181, 253, 0.55);
}

.algo-bloch-demo__btn:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.75);
  outline-offset: 2px;
}

.algo-bloch-demo__btn:active {
  transform: scale(0.97);
}

.algo-bloch-demo__btn--ghost {
  background: rgba(12, 16, 28, 0.6);
  border-color: rgba(125, 211, 252, 0.25);
  color: #bae6fd;
}

.algo-bloch-demo__btn--ghost:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(125, 211, 252, 0.45);
}

.algo-bloch-demo__btn--accent {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.14);
  color: #fde68a;
}

.algo-bloch-demo__btn--accent:hover {
  background: rgba(251, 191, 36, 0.24);
  border-color: rgba(253, 224, 71, 0.55);
}

.algo-bloch-demo__btn:disabled,
.algo-bloch-demo__slider:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.algo-bloch-demo__slider-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr 3.25rem;
  align-items: center;
  gap: 0.55rem;
}

.algo-bloch-demo__slider-row label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(203, 213, 245, 0.9);
}

.algo-bloch-demo__slider-row output {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-align: right;
  color: rgba(148, 163, 184, 0.9);
  font-variant-numeric: tabular-nums;
}

.algo-bloch-demo__slider {
  width: 100%;
  accent-color: #a78bfa;
}

.algo-bloch-demo__readout {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(226, 232, 240, 0.92);
}

.algo-bloch-demo__readout-row {
  margin: 0;
  padding: 0.5rem 0.6rem;
  border-radius: calc(var(--radius-sm) - 2px);
  border: 1px solid rgba(125, 211, 252, 0.12);
  background: rgba(6, 10, 20, 0.5);
}

.algo-bloch-demo__readout-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
  margin-bottom: 0.2rem;
}

.algo-bloch-demo__readout-value {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  word-break: break-word;
  color: #f1f5f9;
}

@media (max-width: 599px) {
  .algo-bloch-demo__controls {
    padding: 0.85rem 0.75rem 1rem;
    gap: 0.7rem;
  }

  .algo-bloch-demo__readout {
    padding: 0.85rem 0.75rem 1rem;
    gap: 0.5rem;
    font-size: 0.7rem;
  }

  .algo-bloch-demo__readout-value {
    font-size: 0.66rem;
    line-height: 1.45;
    word-break: break-all;
  }

  .algo-bloch-demo__slider-row {
    grid-template-columns: 2.5rem 1fr 2.85rem;
    gap: 0.4rem;
  }

  .algo-bloch-demo__tagbar {
    padding: 0.55rem 0.75rem;
    font-size: 0.62rem;
  }

  .algo-bloch-demo__badge {
    font-size: 0.58rem;
  }
}

.algo-bloch-demo__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-bloch-demo__caption {
  margin: 0.65rem 0 0;
  padding: 0 0.15rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(154, 163, 181, 0.88);
}

.algo-bloch-demo__caption strong {
  color: rgba(226, 232, 240, 0.95);
  font-weight: 600;
}
