/* 3d-space.css — 3D Space ページ専用スタイル */

/* フィールド調整パネル折りたたみ */
#field-adjust { display: none !important; }
#field-adjust.open { display: block !important; }

/* トグルボタン行 */
.space-toggle-row {
  display: flex;
  gap: 6px;
  padding: 2px 0;
  flex-wrap: wrap;
}
.space-toggle-btn {
  background: none;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 3px 10px;
  color: #94a3b8;
  font-size: 11px;
  cursor: pointer;
}
.space-toggle-btn:hover { border-color: #7c3aed; color: #e2e8f0; }

/* 折りたたみパネル共通 */
.space-panel { display: none; }
.space-panel.open { display: block; }

/* STS詳細パネル内の子要素表示 */
.space-panel.open > .vrm-motion-row { display: flex; }
.space-panel.open > .vrm-pipeline-toggle-row { display: flex; }
.space-panel.open > #vrm-pipeline-panel { display: none; }
.space-panel.open > .options-row { display: flex; }
.space-panel.open > .vrm-timing-row { display: flex; }

/* ラッパーをリセット */
#scroll-wrapper {
  overflow: hidden;
  height: calc(100vh - 56px);
  position: relative;
}

/* Canvas 全画面 */
#space-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

/* ローディングオーバーレイ */
#loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 26, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 100;
  transition: opacity 0.4s;
}

#loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #2a2d3e;
  border-top-color: #7c6ff7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: #94a3b8;
  font-size: 14px;
}

.loading-progress {
  color: #7c6ff7;
  font-size: 20px;
  font-weight: bold;
  min-height: 28px;
}

/* コントロールパネル */
#controls-panel {
  position: absolute;
  top: 36px;
  right: 12px;
  left: auto;
  background: rgba(20, 22, 34, 0.95);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  z-index: 10;
  max-height: 40vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2a2d3e transparent;
}

.panel-title {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn {
  background: #1e2132;
  color: #94a3b8;
  border: 1px solid #2a2d3e;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn:hover {
  background: #2a2d3e;
  color: #e2e8f0;
}

.btn.active {
  background: #4c3fc7;
  color: #fff;
  border-color: #7c6ff7;
}

/* パネルセクション */
.panel-section {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

/* パネルセパレータ */
.panel-sep,
.panel-separator {
  width: 1px;
  height: 20px;
  background: #2a2d3e;
  margin: 0 2px;
}

/* アニメーションタブ */
.anim-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.anim-tab {
  background: #1e2132;
  color: #64748b;
  border: 1px solid #2a2d3e;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.anim-tab:hover {
  background: #2a2d3e;
  color: #94a3b8;
}

.anim-tab.active {
  background: #252840;
  color: #a5b4fc;
  border-color: #4c3fc7;
}

/* アニメーションタブコンテンツ */
.anim-tab-content {
  position: relative;
  width: 100%;
}

.anim-pane {
  display: none;
}

.anim-pane.active {
  display: block;
}

/* アニメボタングリッド */
.anim-btn-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.anim-btn {
  text-align: center;
  padding: 5px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.anim-btn.active {
  background: #4c3fc7;
  color: #fff;
  border-color: #7c6ff7;
}

.anim-btn.loading {
  opacity: 0.5;
  cursor: wait;
}

/* 待機に戻すボタン */
.idle-reset-btn {
  font-size: 11px;
  padding: 5px 10px;
  background: #1e2132;
  color: #94a3b8;
  border-color: #374151;
  text-align: center;
  width: 100%;
}

.idle-reset-btn:hover {
  background: #374151;
  color: #e2e8f0;
}

/* ヒント表示（左下） — パネルが下部にあるのでPC幅のみ表示 */
#hint {
  display: none;
}

/* 状態表示（左上） */
#status-label {
  position: absolute;
  top: 14px;
  left: 14px;
  color: #7c6ff7;
  font-size: 12px;
  pointer-events: none;
  z-index: 10;
  background: rgba(20, 22, 34, 0.7);
  padding: 4px 10px;
  border-radius: 6px;
  min-height: 24px;
}
