/* ==========================================================================
   GESTURA AI - Component Explorer & 3D Lab Stylesheet
   ========================================================================== */

.explorer-container {
  display: grid;
  grid-template-columns: 1fr 410px;
  gap: 1.5rem;
  min-height: calc(100vh - 160px);
}

/* 3D Stage & Canvas Wrapper */
.viewport-stage {
  position: relative;
  background: radial-gradient(circle at 50% 50%, #0c1630 0%, #060913 85%);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8), var(--glass-shadow);
  display: flex;
  flex-direction: column;
}

#three-canvas-container {
  width: 100%;
  flex: 1;
  min-height: 520px;
  position: relative;
  cursor: grab;
}

#three-canvas-container:active {
  cursor: grabbing;
}

#three-canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* 3D Viewport HUD Overlays */
.viewport-hud-top {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

.viewport-badge-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
}

.hud-badge {
  background: rgba(6, 11, 25, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-family-tech);
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hud-badge.active-comp {
  color: var(--cyan-core);
  border-color: var(--cyan-core);
  box-shadow: 0 0 10px var(--cyan-glow);
}

/* Viewport Floating Controls Toolbar */
.viewport-toolbar {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(6, 11, 25, 0.88);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--pill-radius);
  padding: 0.4rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 10;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.tool-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.45rem 0.75rem;
  border-radius: var(--pill-radius);
  font-family: var(--font-family-tech);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.tool-btn:hover {
  background: var(--cyan-subtle);
  color: var(--cyan-core);
}

.tool-btn.active {
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--cyan-core);
  color: var(--cyan-core);
}

/* Component Switcher Cards Bar */
.component-selector-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(6, 11, 25, 0.95);
  border-top: 1px solid var(--border-color);
  z-index: 5;
}

.comp-tab-btn {
  background: rgba(14, 23, 47, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 8px;
  padding: 0.65rem 0.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition-fast);
  text-align: center;
  position: relative;
}

.comp-tab-btn:hover {
  background: rgba(20, 34, 68, 0.8);
  border-color: rgba(0, 240, 255, 0.4);
  color: var(--text-primary);
}

.comp-tab-btn.active {
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.15) 0%, rgba(37, 99, 235, 0.25) 100%);
  border-color: var(--cyan-core);
  color: var(--cyan-core);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.comp-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20%;
  width: 60%;
  height: 3px;
  background: var(--cyan-core);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--cyan-core);
}

.comp-tab-step {
  font-size: 0.62rem;
  font-family: var(--font-family-tech);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-neon);
}

.comp-tab-title {
  font-family: var(--font-family-tech);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Sidebar Technical Dossier Panel */
.component-dossier-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100%;
}

.dossier-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
}

.dossier-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1rem;
}

.dossier-step-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-family-tech);
  font-size: 0.75rem;
  color: var(--cyan-core);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
}

.dossier-title {
  font-family: var(--font-family-tech);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.dossier-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Pressure & Thermodynamic States Matrix */
.thermo-matrix {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  background: rgba(6, 11, 25, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 1rem;
}

.thermo-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.thermo-label {
  font-family: var(--font-family-tech);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.thermo-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.thermo-value.high-side {
  color: #f87171;
}

.thermo-value.low-side {
  color: #38bdf8;
}

/* Section Blocks */
.dossier-block h4 {
  font-family: var(--font-family-tech);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--cyan-core);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dossier-block p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tvet-tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tvet-tips-list li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: rgba(15, 23, 42, 0.6);
  border-left: 3px solid var(--blue-neon);
  padding: 0.5rem 0.75rem;
  border-radius: 0 6px 6px 0;
  line-height: 1.4;
}

/* Gesture Help Callout */
.gesture-help-callout {
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 8px;
  padding: 0.9rem;
}

.gesture-help-callout h5 {
  font-family: var(--font-family-tech);
  font-size: 0.82rem;
  color: var(--cyan-core);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.gesture-help-callout ul {
  list-style: none;
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gesture-help-callout kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: monospace;
  color: var(--cyan-core);
}

@media (max-width: 1024px) {
  .explorer-container {
    grid-template-columns: 1fr;
  }
  #three-canvas-container {
    min-height: 420px;
  }
}
