/**
 * glTF JSON Anatomy Explorer — üç panel senkron demo
 */

.doc-gltf-json-anatomy {
  margin: 1rem 0 1.25rem;
  padding: 0.95rem 0.95rem 1.05rem;
  border-radius: 14px;
  border: 1px solid rgba(55, 100, 175, 0.38);
  background:
    radial-gradient(ellipse 90% 60% at 0% 0%, rgba(46, 231, 242, 0.05) 0%, transparent 55%),
    linear-gradient(168deg, rgba(2, 4, 10, 0.92) 0%, rgba(5, 8, 18, 0.96) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55) inset,
    0 12px 36px rgba(0, 0, 0, 0.38);
}

.doc-gltf-json-anatomy__hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.75rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.doc-gltf-json-anatomy__tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(46, 231, 242, 0.92);
  background: rgba(46, 231, 242, 0.08);
  border: 1px solid rgba(46, 231, 242, 0.22);
}

.doc-gltf-json-anatomy__hint {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(165, 185, 215, 0.78);
}

.doc-gltf-json-anatomy__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 0.75rem;
  align-items: stretch;
}

.doc-gltf-json-anatomy__col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.doc-gltf-json-anatomy__col-title {
  margin: 0;
  padding: 0.55rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(170, 190, 220, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
}

.doc-gltf-json-anatomy__json {
  flex: 1;
  padding: 0.55rem 0.5rem 0.65rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  line-height: 1.55;
  overflow: auto;
}

.doc-gltf-json-anatomy__json-block {
  margin: 0 0 0.55rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.22);
}

.doc-gltf-json-anatomy__json-block:last-child {
  margin-bottom: 0;
}

.doc-gltf-json-anatomy__json-head {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(94, 200, 255, 0.88);
}

.doc-gltf-json-anatomy__json-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem 0.38rem;
  width: 100%;
  margin: 0.12rem 0;
  padding: 0.28rem 0.38rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: rgba(195, 210, 230, 0.92);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.doc-gltf-json-anatomy__json-row:hover,
.doc-gltf-json-anatomy__json-row:focus-visible {
  background: rgba(46, 231, 242, 0.06);
  border-color: rgba(46, 231, 242, 0.16);
  outline: none;
}

.doc-gltf-json-anatomy__json-row.is-active {
  background: rgba(46, 231, 242, 0.1);
  border-color: rgba(46, 231, 242, 0.32);
  box-shadow: 0 0 18px rgba(46, 231, 242, 0.1);
}

.doc-gltf-json-anatomy__json-key {
  color: rgba(199, 146, 234, 0.95);
}

.doc-gltf-json-anatomy__json-val {
  color: rgba(247, 140, 108, 0.98);
  font-weight: 600;
}

.doc-gltf-json-anatomy__json-str {
  color: rgba(195, 232, 141, 0.95);
}

.doc-gltf-json-anatomy__col--chain [data-gja-chain] {
  flex: 1;
  min-height: 0;
}

.doc-gltf-json-anatomy__chain-body {
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.55rem 0.35rem;
  gap: 0.35rem;
}

.doc-gltf-json-anatomy__chain-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.doc-gltf-json-anatomy__chain-step:not(:last-child)::after {
  content: "";
  display: block;
  width: 2px;
  height: 0.45rem;
  margin: 0.12rem auto;
  background: linear-gradient(180deg, rgba(46, 231, 242, 0.5), rgba(46, 231, 242, 0.12));
  border-radius: 999px;
}

.doc-gltf-json-anatomy__chain-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  width: 100%;
  padding: 0.42rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.32);
  color: rgba(210, 220, 235, 0.94);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.doc-gltf-json-anatomy__chain-btn:hover,
.doc-gltf-json-anatomy__chain-btn:focus-visible {
  border-color: rgba(181, 108, 255, 0.28);
  background: rgba(181, 108, 255, 0.08);
  outline: none;
}

.doc-gltf-json-anatomy__chain-btn.is-active {
  border-color: rgba(181, 108, 255, 0.42);
  background: rgba(181, 108, 255, 0.12);
  box-shadow: 0 0 20px rgba(181, 108, 255, 0.12);
}

.doc-gltf-json-anatomy__chain-btn.is-dim {
  opacity: 0.42;
}

.doc-gltf-json-anatomy__chain-index {
  padding: 0.08rem 0.38rem;
  border-radius: 6px;
  font-size: 0.68rem;
  color: rgba(181, 108, 255, 0.95);
  background: rgba(181, 108, 255, 0.12);
  border: 1px solid rgba(181, 108, 255, 0.22);
}

.doc-gltf-json-anatomy__explainer {
  margin: 0.45rem 0 0;
  padding: 0.55rem 0.58rem;
  border-radius: 8px;
  border: 1px solid rgba(46, 231, 242, 0.14);
  background: rgba(46, 231, 242, 0.05);
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(185, 200, 225, 0.9);
  min-height: 4.5rem;
}

.doc-gltf-json-anatomy__explainer strong {
  color: rgba(94, 200, 255, 0.98);
  font-weight: 600;
}

.doc-gltf-json-anatomy__scene-wrap {
  position: relative;
  flex: 1;
  min-height: 320px;
  touch-action: pan-y;
}

.doc-gltf-json-anatomy__mount {
  width: 100%;
  height: 100%;
  min-height: 320px;
}

.doc-gltf-json-anatomy__scene-hud {
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 8, 16, 0.82);
  font-size: 0.74rem;
  line-height: 1.45;
  color: rgba(175, 195, 220, 0.88);
  pointer-events: none;
}

.doc-gltf-json-anatomy__scene-hud strong {
  color: rgba(230, 240, 255, 0.96);
}

.doc-gltf-json-anatomy__scene-mode {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.1rem 0.42rem;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(46, 231, 242, 0.95);
  background: rgba(46, 231, 242, 0.12);
  border: 1px solid rgba(46, 231, 242, 0.28);
  vertical-align: middle;
}

.doc-gltf-json-anatomy__caption {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(185, 198, 215, 0.9);
}

.doc-gltf-json-anatomy__caption strong {
  color: rgba(220, 230, 245, 0.98);
}

/* Mobil / tablet: JSON + zincir üstte, sahne full-width en altta */
@media (max-width: 980px) {
  .doc-gltf-json-anatomy__grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "json"
      "chain"
      "scene";
    gap: 0.65rem;
  }

  .doc-gltf-json-anatomy__col--json {
    grid-area: json;
  }

  .doc-gltf-json-anatomy__col--chain {
    grid-area: chain;
  }

  .doc-gltf-json-anatomy__col--scene {
    grid-area: scene;
  }

  .doc-gltf-json-anatomy__scene-wrap,
  .doc-gltf-json-anatomy__mount {
    min-height: min(52vh, 400px);
  }

  .doc-gltf-json-anatomy__col--scene .doc-gltf-json-anatomy__col-title {
    text-align: center;
  }
}

/* Dokunmatik: varsayılan scroll; orbit yalnızca «Sahneyi döndür» sonrası */
.doc-gltf-json-anatomy.is-orbit-engaged .doc-gltf-json-anatomy__scene-wrap {
  touch-action: none;
}

.doc-gltf-json-anatomy__scene-wrap .doc-gltf-json-anatomy__mount {
  touch-action: inherit;
  user-select: none;
  -webkit-user-select: none;
}

.doc-gltf-json-anatomy__scene-engage {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1rem;
  border-radius: 0 0 11px 11px;
  background: linear-gradient(
    180deg,
    rgba(4, 8, 16, 0.35) 0%,
    rgba(4, 8, 16, 0.78) 45%,
    rgba(4, 8, 16, 0.92) 100%
  );
  pointer-events: auto;
}

.doc-gltf-json-anatomy.is-touch-gated .doc-gltf-json-anatomy__scene-engage {
  display: flex;
}

.doc-gltf-json-anatomy.is-touch-gated.is-orbit-engaged .doc-gltf-json-anatomy__scene-engage {
  display: none;
}

.doc-gltf-json-anatomy__engage-btn {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(46, 231, 242, 0.42);
  background: linear-gradient(135deg, rgba(46, 231, 242, 0.18) 0%, rgba(46, 231, 242, 0.08) 100%);
  color: rgba(230, 250, 255, 0.98);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(46, 231, 242, 0.15);
}

.doc-gltf-json-anatomy__engage-btn:hover,
.doc-gltf-json-anatomy__engage-btn:focus-visible {
  border-color: rgba(46, 231, 242, 0.65);
  outline: none;
  box-shadow: 0 0 28px rgba(46, 231, 242, 0.28);
}

.doc-gltf-json-anatomy__engage-note {
  margin: 0;
  max-width: 16rem;
  text-align: center;
  font-size: 0.74rem;
  line-height: 1.45;
  color: rgba(165, 185, 215, 0.82);
}

.doc-gltf-json-anatomy__engage-exit {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 3;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.55);
  color: rgba(190, 205, 225, 0.9);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}

.doc-gltf-json-anatomy__engage-exit:hover,
.doc-gltf-json-anatomy__engage-exit:focus-visible {
  border-color: rgba(46, 231, 242, 0.35);
  outline: none;
}

@media (min-width: 981px) {
  .doc-gltf-json-anatomy__scene-wrap {
    touch-action: none;
  }

  .doc-gltf-json-anatomy__scene-engage,
  .doc-gltf-json-anatomy__engage-exit {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .doc-gltf-json-anatomy__json-row,
  .doc-gltf-json-anatomy__chain-btn {
    transition: none;
  }
}
