/* ==========================================================================
   css/app_B.css — Propeller Application Workspace Core Rules Layout
   ========================================================================== */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #030914;
  color: #ffffff;
  overflow-x: hidden;
}

/* Absolute layout insurance to keep viewports flexible and responsive */
#canvas-3d-target, #plot-target {
  width: 100% !important;
  height: 100% !important;
  min-height: 380px !important;
  position: relative !important;
  display: block !important;
}

/* Theory Interactive Header Button Component */
.nav-cta-theory {
  background: transparent;
  border: 1px solid var(--amber, #c8a84b);
  color: var(--amber, #c8a84b);
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-cta-theory:hover {
  background: rgba(200, 168, 75, 0.1);
  color: #ffffff;
  border-color: #ffffff;
}

/* Workspace Navigation Viewport Switchers */
.chart-panel.is-hidden,
.visualizer-panel.is-hidden {
  display: none !important;
}

.cad-toggle-wrapper {
  display: flex;
  background: rgba(10, 22, 40, 0.8);
  border: 1px solid rgba(200, 168, 75, 0.3);
  padding: 2px;
}

.btn-switch-view {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.4rem 1rem;
  font-family: monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-switch-view.active-view {
  background: var(--amber, #c8a84b);
  color: #030914;
  font-weight: bold;
}

.btn-switch-view:hover:not(.active-view) {
  color: #ffffff;
  background: rgba(200, 168, 75, 0.15);
}

/* Application Interface Block Dimensions */
.app-workspace {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2rem;
  flex: 1;
  box-sizing: border-box;
}

.control-panel {
  background: #0b1a29;
  border: 1px solid rgba(200, 168, 75, 0.2);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.panel-title {
  font-size: 20px;
  color: #ffffff;
  border-bottom: 1px solid rgba(200, 168, 75, 0.15);
  padding-bottom: 0.75rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Linear Input Parameter Elements */
.input-group, .input-group-final {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.input-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--amber, #c8a84b);
  display: flex;
  justify-content: space-between;
}

.input-label span {
  color: #94a3b8;
  font-family: monospace;
}

.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: #142638;
  border: 1px solid rgba(200, 168, 75, 0.1);
  outline: none;
  border-radius: 2px;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--amber, #c8a84b);
  border: 1px solid #ffffff;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Dynamic Live Report Frame */
.telemetry-wrapper {
  margin-top: 2rem;
}

.telemetry-title {
  margin-bottom: 0.5rem;
}

.telemetry-deck {
  background: rgba(6, 13, 24, 0.6);
  border: 1px solid rgba(200, 168, 75, 0.15);
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.telemetry-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.telemetry-label {
  color: #94a3b8;
}

.telemetry-val {
  font-family: monospace;
  font-size: 15px;
  color: #38bdf8;
  font-weight: bold;
}

.total-row {
  border-top: 1px solid rgba(200, 168, 75, 0.2);
  padding-top: 8px;
  margin-top: 4px;
}

.highlight-text {
  color: var(--amber, #c8a84b);
}

.total-val {
  font-size: 18px;
  color: #22c55e;
}

/* Viewport Containers layout mapping */
.workspace-right {
  display: flex;
  flex-direction: column;
}

.split-viewport-container {
  display: flex;
  flex-direction: row; 
  height: 100%;
}

.viewport-box {
  background: #060d18;
  border: 1px solid rgba(200, 168, 75, 0.15);
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Toolbars inside Workspace Frames */
.cad-toolbar {
  background: rgba(10, 22, 40, 0.8);
  border-bottom: 1px solid rgba(200, 168, 75, 0.15);
  padding: 0.6rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.cad-actions {
  display: flex;
  gap: 0.5rem;
}

.cad-btn, .cad-select {
  background: rgba(200, 168, 75, 0.05);
  border: 1px solid rgba(200, 168, 75, 0.3);
  color: #ffffff;
  padding: 0.4rem 0.8rem;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cad-select {
  background: #0b1a29;
  outline: none;
}

.cad-btn:hover, .cad-select:hover {
  background: rgba(200, 168, 75, 0.15);
  border-color: var(--amber, #c8a84b);
}

.aspect-ratio-hud, .chart-title-hud {
  font-family: monospace;
  font-size: 11px;
  color: #94a3b8;
}

.aspect-ratio-hud span {
  color: #38bdf8;
  font-weight: bold;
}

#canvas-3d-target {
  width: 100%;
  flex: 1;
  cursor: grab;
}

#canvas-3d-target:active {
  cursor: grabbing;
}

#plot-target {
  width: 100%;
  flex: 1;
}

/* Dynamic Overlays and Math Modals */
.theory-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 9, 20, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.theory-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.theory-modal {
  background: #0b1a29;
  border: 1px solid rgba(200, 168, 75, 0.25);
  width: 92%;
  max-width: 1100px;
  max-height: 85vh;
  padding: 3rem;
  position: relative;
  overflow-y: auto;
  box-sizing: border-box;
}

.theory-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  background: transparent;
  border: 1px solid rgba(200, 168, 75, 0.3);
  color: var(--amber, #c8a84b);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.theory-close:hover {
  background: rgba(200, 168, 75, 0.1);
  color: #ffffff;
}

.theory-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; margin-top: 1rem; }
.theory-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--amber, #c8a84b); display: block; margin-bottom: 0.5rem; font-weight: bold; }
.theory-left h2, .theory-right h2 { color: #ffffff; font-size: 24px; margin-bottom: 0.75rem; font-weight: 400; }
.theory-meta { font-size: 13px; color: #94a3b8; margin-bottom: 1.5rem; }
.theory-left p, .theory-right p { font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, 0.8); margin-bottom: 1.25rem; }

.equation-box { background: rgba(10, 22, 40, 0.6); border-left: 3px solid var(--amber, #c8a84b); padding: 1.25rem; margin: 1.5rem 0; }
.eq-title { font-size: 10px; text-transform: uppercase; color: #94a3b8; margin-bottom: 0.5rem; }
.eq-math { font-family: 'Courier New', monospace; font-size: 20px; color: #ffffff; font-weight: bold; margin-bottom: 0.5rem; }
.equation-box p { font-size: 12px; color: #94a3b8; margin: 0; }

.tutorial-step { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.step-num { background: rgba(200, 168, 75, 0.08); border: 1px solid rgba(200, 168, 75, 0.4); color: var(--amber, #c8a84b); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: monospace; font-weight: bold; }
.step-text h4 { color: #ffffff; font-size: 14px; margin-top: 0; margin-bottom: 0.35rem; }
.step-text p { font-size: 13px; color: #94a3b8; margin: 0; }

.theory-start-btn { width: 100%; background: var(--amber, #c8a84b); color: #030914; border: none; padding: 1rem; font-weight: bold; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; margin-top: 1rem; }
.theory-start-btn:hover { background: #ffffff; }

.divider {
  height: 1px;
  background: rgba(200, 168, 75, 0.1);
  width: 100%;
}

/* Responsiveness Configurations */
@media (max-width: 1180px) {
  .app-workspace {
    grid-template-columns: 1fr;
  }
  .split-viewport-container {
    flex-direction: column;
  }
  .viewport-box {
    height: 450px;
  }
}

@media (max-width: 1024px) {
  .theory-grid { grid-template-columns: 1fr; gap: 2rem; }
  .theory-modal { padding: 2rem; }
}