/**
 * BufferView Scanner — kaydırılabilir dilim penceresi · Three.js r170
 */

.doc-gltf-bv-scanner {
  --bvs-cyan: #3db8c4;
  --bvs-blue: #6a9ec4;
  --bvs-violet: #9a7ec8;
  --bvs-amber: #c4a04a;
  --bvs-rose: #c47a8a;
  --bvs-border: rgba(255, 255, 255, 0.08);
  --bvs-surface: rgba(255, 255, 255, 0.025);
  --bvs-glow: rgba(61, 184, 196, 0.35);

  margin: 1rem 0 1.25rem;
  padding: 0.95rem 0.95rem 1.05rem;
  border-radius: 12px;
  border: 1px solid var(--bvs-border);
  background: linear-gradient(165deg, #080b12 0%, #0a1018 48%, #0c0e16 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.doc-gltf-bv-scanner__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 var(--bvs-border);
}

.doc-gltf-bv-scanner__tag {
  display: inline-flex;
  padding: 0.16rem 0.48rem;
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bvs-violet);
  background: rgba(154, 126, 200, 0.1);
  border: 1px solid rgba(154, 126, 200, 0.28);
}

.doc-gltf-bv-scanner__hint {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(160, 172, 190, 0.82);
}

.doc-gltf-bv-scanner__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.88fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: stretch;
}

.doc-gltf-bv-scanner__col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 10px;
  border: 1px solid var(--bvs-border);
  background: var(--bvs-surface);
  overflow: hidden;
}

.doc-gltf-bv-scanner__col-title {
  margin: 0;
  padding: 0.52rem 0.62rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(160, 172, 190, 0.85);
  border-bottom: 1px solid var(--bvs-border);
  background: rgba(0, 0, 0, 0.22);
}

.doc-gltf-bv-scanner__scanner-body {
  flex: 1;
  padding: 0.75rem 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.doc-gltf-bv-scanner__pool-label {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  color: rgba(160, 172, 190, 0.75);
}

.doc-gltf-bv-scanner__track-wrap {
  position: relative;
  padding: 0.35rem 0;
}

.doc-gltf-bv-scanner__track {
  position: relative;
  height: 3.25rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
}

.doc-gltf-bv-scanner__track-seg {
  position: absolute;
  top: 0;
  bottom: 0;
  opacity: 0.55;
  transition: opacity 0.2s ease, filter 0.2s ease;
  pointer-events: none;
}

.doc-gltf-bv-scanner__track-seg--position {
  background: linear-gradient(180deg, rgba(61, 184, 196, 0.45), rgba(61, 184, 196, 0.18));
}

.doc-gltf-bv-scanner__track-seg--normal {
  background: linear-gradient(180deg, rgba(106, 158, 196, 0.45), rgba(106, 158, 196, 0.18));
}

.doc-gltf-bv-scanner__track-seg--uv {
  background: linear-gradient(180deg, rgba(154, 126, 200, 0.45), rgba(154, 126, 200, 0.18));
}

.doc-gltf-bv-scanner__track-seg--indices {
  background: linear-gradient(180deg, rgba(196, 160, 74, 0.45), rgba(196, 160, 74, 0.18));
}

.doc-gltf-bv-scanner__track-seg.is-dimmed {
  opacity: 0.22;
  filter: saturate(0.5);
}

.doc-gltf-bv-scanner__track-seg.is-active {
  opacity: 0.85;
  filter: saturate(1.15);
}

.doc-gltf-bv-scanner__viewport {
  position: absolute;
  top: 0.22rem;
  bottom: 0.22rem;
  min-width: 12%;
  border-radius: 6px;
  border: 2px solid rgba(154, 126, 200, 0.75);
  background: linear-gradient(
    180deg,
    rgba(154, 126, 200, 0.22) 0%,
    rgba(61, 184, 196, 0.08) 100%
  );
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 18px rgba(154, 126, 200, 0.25),
    inset 0 0 12px rgba(61, 184, 196, 0.12);
  cursor: grab;
  touch-action: none;
  z-index: 2;
  transition: box-shadow 0.18s ease;
}

.doc-gltf-bv-scanner__viewport.is-dragging {
  cursor: grabbing;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.15),
    0 0 28px rgba(61, 184, 196, 0.45),
    inset 0 0 16px rgba(61, 184, 196, 0.2);
}

.doc-gltf-bv-scanner__viewport-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(240, 244, 252, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  white-space: nowrap;
}

.doc-gltf-bv-scanner__scan-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(61, 184, 196, 0.85),
    transparent
  );
  pointer-events: none;
  animation: bvs-scan-pulse 2.4s ease-in-out infinite;
}

@keyframes bvs-scan-pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

.doc-gltf-bv-scanner__legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.5rem;
}

.doc-gltf-bv-scanner__legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.64rem;
  color: rgba(160, 172, 190, 0.8);
}

.doc-gltf-bv-scanner__legend-swatch {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.doc-gltf-bv-scanner__legend-swatch--position {
  background: var(--bvs-cyan);
}

.doc-gltf-bv-scanner__legend-swatch--normal {
  background: var(--bvs-blue);
}

.doc-gltf-bv-scanner__legend-swatch--uv {
  background: var(--bvs-violet);
}

.doc-gltf-bv-scanner__legend-swatch--indices {
  background: var(--bvs-amber);
}

.doc-gltf-bv-scanner__panel-body {
  flex: 1;
  padding: 0.65rem 0.62rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.doc-gltf-bv-scanner__presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.38rem;
}

.doc-gltf-bv-scanner__preset {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.42rem 0.45rem;
  border-radius: 7px;
  border: 1px solid var(--bvs-border);
  background: rgba(0, 0, 0, 0.28);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 600;
  color: rgba(200, 210, 225, 0.88);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.doc-gltf-bv-scanner__preset-id {
  font-size: 0.58rem;
  color: rgba(160, 172, 190, 0.82);
}

.doc-gltf-bv-scanner__preset-range {
  font-size: 0.68rem;
  color: var(--bvs-cyan);
}

.doc-gltf-bv-scanner__preset-hint {
  font-size: 0.56rem;
  font-weight: 500;
  color: rgba(140, 152, 170, 0.78);
}

.doc-gltf-bv-scanner__preset.is-active .doc-gltf-bv-scanner__preset-id,
.doc-gltf-bv-scanner__preset.is-active .doc-gltf-bv-scanner__preset-range {
  color: #fff;
}

.doc-gltf-bv-scanner__preset:hover,
.doc-gltf-bv-scanner__preset:focus-visible {
  border-color: rgba(154, 126, 200, 0.45);
  background: rgba(154, 126, 200, 0.08);
  outline: none;
}

.doc-gltf-bv-scanner__preset.is-active {
  border-color: rgba(61, 184, 196, 0.55);
  background: rgba(61, 184, 196, 0.12);
  color: #fff;
}

.doc-gltf-bv-scanner__segment-name {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(235, 240, 248, 0.95);
}

.doc-gltf-bv-scanner__segment-sub {
  margin: 0;
  font-size: 0.72rem;
  color: rgba(160, 172, 190, 0.82);
}

.doc-gltf-bv-scanner__fields {
  display: grid;
  gap: 0.32rem;
  padding: 0.48rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--bvs-border);
  background: rgba(0, 0, 0, 0.32);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.66rem;
}

.doc-gltf-bv-scanner__field-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.doc-gltf-bv-scanner__field-k {
  color: rgba(160, 172, 190, 0.75);
}

.doc-gltf-bv-scanner__field-v {
  color: var(--bvs-cyan);
  font-weight: 600;
}

.doc-gltf-bv-scanner__explainer {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(180, 190, 205, 0.88);
}

.doc-gltf-bv-scanner__flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding-top: 0.15rem;
  font-size: 0.64rem;
  color: rgba(140, 152, 170, 0.75);
}

.doc-gltf-bv-scanner__flow-step {
  padding: 0.12rem 0.32rem;
  border-radius: 4px;
  border: 1px solid var(--bvs-border);
  background: rgba(0, 0, 0, 0.25);
}

.doc-gltf-bv-scanner__flow-arrow {
  opacity: 0.45;
}

.doc-gltf-bv-scanner__col--scene {
  min-height: 100%;
}

.doc-gltf-bv-scanner__scene-wrap {
  position: relative;
  flex: 1;
  min-height: 280px;
  background: #060a14;
}

.doc-gltf-bv-scanner__scene-wrap [data-bvs-mount] {
  position: absolute;
  inset: 0;
}

.doc-gltf-bv-scanner__mount {
  display: block;
  width: 100%;
  height: 100%;
}

.doc-gltf-bv-scanner__scene-labels {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}

.doc-gltf-bv-scanner__vertex-label {
  position: absolute;
  transform: translate(-50%, -145%);
  padding: 0.1rem 0.32rem;
  border-radius: 4px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(210, 240, 244, 0.95);
  background: rgba(6, 10, 20, 0.78);
  border: 1px solid rgba(61, 184, 196, 0.32);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.doc-gltf-bv-scanner__scene-hud {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  z-index: 4;
  max-width: calc(100% - 1rem);
  padding: 0.28rem 0.48rem;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 500;
  color: rgba(210, 220, 235, 0.92);
  background: rgba(6, 10, 20, 0.82);
  border: 1px solid var(--bvs-border);
  pointer-events: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.doc-gltf-bv-scanner.is-mode-position .doc-gltf-bv-scanner__scene-hud {
  border-color: rgba(61, 184, 196, 0.45);
  color: rgba(180, 235, 240, 0.95);
}

.doc-gltf-bv-scanner.is-mode-normal .doc-gltf-bv-scanner__scene-hud {
  border-color: rgba(106, 158, 196, 0.45);
}

.doc-gltf-bv-scanner.is-mode-uv .doc-gltf-bv-scanner__scene-hud {
  border-color: rgba(154, 126, 200, 0.5);
  color: rgba(220, 210, 240, 0.95);
}

.doc-gltf-bv-scanner.is-mode-indices .doc-gltf-bv-scanner__scene-hud {
  border-color: rgba(196, 160, 74, 0.5);
  color: rgba(240, 225, 180, 0.95);
}

.doc-gltf-bv-scanner__uv-grid-wrap {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1rem;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.doc-gltf-bv-scanner.is-mode-uv .doc-gltf-bv-scanner__uv-grid-wrap {
  opacity: 1;
  transform: scale(1);
}

.doc-gltf-bv-scanner__uv-grid-title {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(154, 126, 200, 0.85);
}

.doc-gltf-bv-scanner__uv-grid-wrap canvas {
  display: block;
  width: min(220px, 72%);
  height: auto;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid rgba(154, 126, 200, 0.4);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 28px rgba(154, 126, 200, 0.18);
}

.doc-gltf-bv-scanner.is-mode-uv .doc-gltf-bv-scanner__scene-wrap {
  background: radial-gradient(ellipse at center, rgba(154, 126, 200, 0.08) 0%, #060a14 68%);
}

.doc-gltf-bv-scanner.is-mode-uv .doc-gltf-bv-scanner__scene-engage,
.doc-gltf-bv-scanner.is-mode-uv .doc-gltf-bv-scanner__engage-exit {
  display: none;
}

.doc-gltf-bv-scanner__scene-engage {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: rgba(6, 10, 20, 0.55);
  backdrop-filter: blur(2px);
}

.doc-gltf-bv-scanner.is-orbit-engaged .doc-gltf-bv-scanner__scene-engage,
.doc-gltf-bv-scanner:not(.is-touch-gated) .doc-gltf-bv-scanner__scene-engage {
  display: none;
}

.doc-gltf-bv-scanner__engage-btn {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(61, 184, 196, 0.45);
  background: rgba(61, 184, 196, 0.12);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.doc-gltf-bv-scanner__engage-note {
  margin: 0;
  max-width: 14rem;
  text-align: center;
  font-size: 0.65rem;
  color: rgba(160, 172, 190, 0.8);
}

.doc-gltf-bv-scanner__engage-exit {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 7;
  padding: 0.22rem 0.48rem;
  border-radius: 6px;
  border: 1px solid var(--bvs-border);
  background: rgba(6, 10, 20, 0.88);
  color: rgba(200, 210, 225, 0.9);
  font-size: 0.62rem;
  cursor: pointer;
}

.doc-gltf-bv-scanner__caption {
  margin: 0.85rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--bvs-border);
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(160, 172, 190, 0.88);
}

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

  .doc-gltf-bv-scanner__scene-wrap {
    min-height: 240px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .doc-gltf-bv-scanner__scan-line {
    animation: none;
    opacity: 0.6;
  }

  .doc-gltf-bv-scanner__viewport,
  .doc-gltf-bv-scanner__track-seg {
    transition: none;
  }
}
