/* coordinate-spaces.html — Uzay Zinciri Gezgini (doc-csx) */

.doc-csx {
  margin: 1.15rem 0 0.35rem;
  border-radius: 16px;
  border: 1px solid rgba(94, 180, 255, 0.26);
  background: linear-gradient(
    168deg,
    rgba(16, 22, 42, 0.82) 0%,
    rgba(10, 14, 28, 0.72) 48%,
    rgba(18, 14, 36, 0.78) 100%
  );
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.42) inset,
    0 12px 38px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.doc-csx__top {
  padding: 0.75rem 0.9rem 0.9rem;
  background:
    radial-gradient(110% 85% at 50% 12%, rgba(46, 231, 242, 0.06) 0%, transparent 52%),
    rgba(5, 8, 18, 0.52);
  border-bottom: 1px solid rgba(110, 150, 210, 0.14);
}

/* Yan yana sahne + NDC — tek WebGL tuvali stage üzerinde */
.doc-csx__stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0.55rem;
  margin: 0 auto;
  max-width: min(100%, 1180px);
  height: clamp(340px, 52vmin, 580px);
  min-height: 320px;
}

.doc-csx--local .doc-csx__stage {
  grid-template-columns: 1fr;
}

.doc-csx--local .doc-csx__pane--ndc {
  display: none;
}

.doc-csx__pane {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  border-radius: 14px;
  border: 1px solid rgba(110, 150, 210, 0.18);
  background:
    radial-gradient(ellipse 70% 55% at 50% 40%, rgba(46, 231, 242, 0.04) 0%, transparent 60%),
    rgba(5, 10, 22, 0.55);
  overflow: hidden;
  pointer-events: none;
}

.doc-csx__pane--ndc {
  border-color: rgba(181, 108, 255, 0.28);
  background:
    radial-gradient(ellipse 65% 50% at 50% 45%, rgba(181, 108, 255, 0.07) 0%, transparent 58%),
    rgba(8, 10, 22, 0.72);
}

.doc-csx__stage > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 3;
  touch-action: none;
  cursor: grab;
  border-radius: 14px;
}

.doc-csx__stage > canvas:active {
  cursor: grabbing;
}

.doc-csx__hud {
  position: absolute;
  left: 0.65rem;
  top: 0.65rem;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  pointer-events: none;
}

.doc-csx__badge,
.doc-csx__chip {
  padding: 0.32rem 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(120, 190, 255, 0.22);
  background: linear-gradient(
    165deg,
    rgba(18, 28, 48, 0.55) 0%,
    rgba(10, 14, 28, 0.72) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 8px 24px rgba(0, 0, 0, 0.35);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(210, 235, 255, 0.92);
}

.doc-csx__chip {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(150, 220, 255, 0.88);
}

.doc-csx__pane-label {
  position: absolute;
  left: 0.65rem;
  bottom: 0.55rem;
  z-index: 2;
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(110, 150, 210, 0.22);
  background: rgba(10, 12, 24, 0.72);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(175, 205, 248, 0.82);
  pointer-events: none;
}

.doc-csx__pane-label--ndc {
  left: auto;
  right: 0.65rem;
  border-color: rgba(181, 108, 255, 0.4);
  color: rgba(230, 210, 255, 0.96);
}

.doc-csx__error {
  margin: 0.85rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 90, 120, 0.35);
  background: rgba(80, 16, 28, 0.45);
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(255, 200, 210, 0.95);
}

.doc-csx__desc {
  margin: 0.9rem 0 0;
  padding: 0.7rem 0.8rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(110, 150, 210, 0.14);
  border-left: 3px solid rgba(46, 231, 242, 0.42);
  background: rgba(8, 14, 28, 0.48);
  font-size: 0.84rem;
  line-height: 1.6;
  color: rgba(185, 205, 235, 0.9);
}

.doc-csx__desc:empty {
  display: none;
}

.doc-csx__bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-items: stretch;
  padding: 0.75rem 0.9rem 0.85rem;
  border-bottom: 1px solid rgba(110, 150, 210, 0.12);
}

.doc-csx__col--side {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
  min-height: 0;
}

.doc-csx__panel--vertex {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.doc-csx__panel--matrix {
  min-height: 0;
}

.doc-csx__panel--vertex .doc-csx__kv {
  flex: 1 1 auto;
  margin-top: 0.75rem;
}

.doc-csx__panel {
  border-radius: 12px;
  border: 1px solid rgba(94, 200, 255, 0.14);
  background: rgba(8, 14, 28, 0.55);
  padding: 0.65rem 0.7rem 0.7rem;
  min-height: 0;
}

.doc-csx__h {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(190, 208, 240, 0.9);
}

.doc-csx__space {
  display: grid;
  gap: 0.35rem;
}

.doc-csx__radio,
.doc-csx__chk {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: rgba(190, 208, 240, 0.94);
  cursor: pointer;
}

.doc-csx__radio input,
.doc-csx__chk input {
  accent-color: #5ec8ff;
}

.doc-csx__controls {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(110, 150, 210, 0.12);
  display: grid;
  gap: 0.35rem;
}

.doc-csx__mat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.doc-csx__mat-title {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(150, 185, 230, 0.7);
}

.doc-csx__mat {
  margin: 0.25rem 0 0;
  padding: 0.5rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(110, 150, 210, 0.18);
  background: rgba(5, 10, 22, 0.72);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  line-height: 1.45;
  color: rgba(175, 205, 248, 0.9);
  overflow-x: auto;
  white-space: pre;
}

.doc-csx__equation {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(110, 150, 210, 0.12);
}

.doc-csx__eq-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: rgba(210, 235, 255, 0.92);
}

.doc-csx__eq {
  margin: 0.35rem 0 0;
  padding: 0.5rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(110, 150, 210, 0.18);
  background: rgba(5, 10, 22, 0.62);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  line-height: 1.45;
  color: rgba(175, 205, 248, 0.9);
  overflow-x: auto;
  white-space: pre;
}

.doc-csx__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
}

.doc-csx__lbl {
  font-size: 0.82rem;
  color: rgba(190, 208, 240, 0.84);
}

.doc-csx__range {
  width: 100%;
  accent-color: #5ec8ff;
}

.doc-csx__out {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(130, 235, 255, 0.95);
}

.doc-csx__kv {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.45rem;
}

.doc-csx__kv-row {
  display: grid;
  grid-template-columns: 5.8rem 1fr;
  gap: 0.6rem;
  align-items: baseline;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(110, 150, 210, 0.1);
}

.doc-csx__kv-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.doc-csx__kv-k {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(150, 185, 230, 0.7);
  text-transform: uppercase;
}

.doc-csx__kv-v {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  color: rgba(210, 228, 255, 0.92);
  white-space: pre-wrap;
}

.doc-csx__caption {
  margin: 0;
  padding: 0.75rem 0.9rem 0.85rem;
  font-size: 0.82rem;
  line-height: 1.52;
  color: rgba(165, 188, 228, 0.82);
  border-top: 1px solid rgba(110, 150, 210, 0.1);
}

.doc-csx__caption strong {
  color: rgba(210, 235, 255, 0.95);
  font-weight: 700;
}

@media (max-width: 980px) {
  .doc-csx__bottom {
    grid-template-columns: 1fr;
  }

  .doc-csx__kv-row {
    grid-template-columns: 5.2rem 1fr;
  }

  .doc-csx__stage {
    grid-template-columns: 1fr;
    height: clamp(520px, 88vmin, 720px);
  }

  .doc-csx--local .doc-csx__stage {
    height: clamp(280px, 52vmin, 420px);
  }

  .doc-csx__pane--ndc {
    min-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .doc-csx__pane {
    transition: none;
  }
}
