/* ==========================================================================
   VoltaLab Global Scientific & Electronic CAD Workstation Stylesheet
   Supports English (LTR) & Native Arabic (RTL) seamlessly.
   ========================================================================== */
:root {
  --bg-deep: #040711;
  --bg-panel: #0b1120;
  --bg-card: #111827;
  --bg-elevated: #1e293b;
  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-glow: rgba(56, 189, 248, 0.45);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --accent-cyan: #38bdf8;
  --accent-blue: #2563eb;
  --accent-amber: #fbbf24;
  --accent-emerald: #22c55e;
  --accent-rose: #f43f5e;
  --radius-lg: 14px;
  --radius-md: 9px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Inter', 'Segoe UI', Tahoma, system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

html[lang="ar"] {
  font-family: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, system-ui, sans-serif;
}

body {
  margin: 0;
  background: radial-gradient(circle at 18% 0%, rgba(37, 99, 235, 0.14), transparent 42%),
              radial-gradient(circle at 85% 8%, rgba(56, 189, 248, 0.10), transparent 38%),
              var(--bg-deep);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}

a:hover {
  color: #7dd3fc;
}

.container {
  max-width: 1420px;
  margin: 0 auto;
  padding: 0 18px;
}

/* Top Navigation Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(7, 11, 22, 0.90);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 56px;
  flex-wrap: wrap;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  display: grid;
  place-items: center;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a {
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 8px;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  background: rgba(56, 189, 248, 0.14);
}

.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.22);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #f8fafc !important;
  font-weight: 700;
  font-size: 0.85rem;
}

.lang-switch-btn:hover {
  background: rgba(56, 189, 248, 0.30);
}

/* Compact Hero Banner */
.page-hero {
  padding: 18px 0 12px;
}

.hero-compact-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.10);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.page-hero h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.3vw, 1.95rem);
  line-height: 1.25;
  color: #ffffff;
}

.page-hero p {
  margin: 6px 0 0;
  color: var(--text-muted);
  max-width: 860px;
  font-size: 0.95rem;
}

.mode-switch-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* CAD Workstation Frame */
.studio-shell {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  margin-bottom: 28px;
}

.studio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.studio-select {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 0.84rem;
  font-weight: 600;
  max-width: 310px;
}

.tb-btn, .studio-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tb-btn:hover, .studio-pill:hover {
  background: #334155;
  border-color: rgba(56, 189, 248, 0.5);
  color: #fff;
}

.tb-btn.active, .studio-pill.active {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: #38bdf8;
  color: #fff;
}

.tb-btn.run-btn {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.5);
  color: #86efac;
}

.tb-btn.run-btn.paused {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.55);
  color: #fde68a;
}

.tb-btn.warn-btn {
  background: rgba(249, 115, 22, 0.16);
  border-color: rgba(249, 115, 22, 0.45);
  color: #fdba74;
}

.speed-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0 6px;
}

.speed-wrap input[type="range"] {
  width: 74px;
  accent-color: var(--accent-cyan);
}

/* 3-Column Circuit Workbench Grid */
.circuit-grid {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr) 256px;
  min-height: 590px;
}

.palette-pane {
  background: rgba(15, 23, 42, 0.72);
  border-inline-end: 1px solid var(--border-subtle);
  padding: 10px;
  overflow-y: auto;
  max-height: 630px;
}

.palette-heading {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin: 8px 0 6px;
}

.palette-heading:first-child {
  margin-top: 0;
}

.palette-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 4px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 7px;
  color: #cbd5e1;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.14s ease;
}

.tool-btn:hover {
  background: rgba(51, 65, 85, 0.85);
  border-color: rgba(56, 189, 248, 0.4);
  color: #fff;
}

.tool-btn.active {
  background: rgba(37, 99, 235, 0.35);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: inset 0 0 10px rgba(56, 189, 248, 0.25);
}

.tool-sym {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

/* Center Canvas + Scope Stack */
.canvas-stage-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #070b16;
}

.canvas-ltr-wrap {
  direction: ltr;
  position: relative;
  width: 100%;
}

#circuit-canvas {
  display: block;
  width: 100%;
  height: 410px;
  touch-action: none;
  user-select: none;
}

.preset-hint-bar {
  padding: 7px 14px;
  font-size: 0.83rem;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.scope-dock {
  background: #050811;
  padding: 8px 12px 10px;
}

.scope-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.scope-probes-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.77rem;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.ch1-tag { color: #38bdf8; font-weight: 700; }
.ch2-tag { color: #fbbf24; font-weight: 700; }
.scope-stat { color: #94a3b8; margin-inline-start: 4px; }

#scope-canvas {
  display: block;
  width: 100%;
  height: 138px;
  border-radius: 7px;
  border: 1px solid rgba(56, 189, 248, 0.20);
}

/* Right Component Inspector */
.inspector-pane {
  background: rgba(15, 23, 42, 0.78);
  border-inline-start: 1px solid var(--border-subtle);
  padding: 12px;
  overflow-y: auto;
  max-height: 630px;
}

.inspector-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  margin: 0 0 10px;
}

.inspector-empty {
  font-size: 0.84rem;
  color: var(--text-muted);
  padding: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.25);
  border-radius: 9px;
}

.insp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.insp-type-pill, .insp-type-tag {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  font-weight: 800;
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 999px;
  margin-inline-end: 6px;
}

.insp-id {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.75rem;
  color: #64748b;
}

.insp-live-grid, .insp-live-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 6px;
  margin-bottom: 12px;
  direction: ltr;
}

.insp-live-grid > div, .insp-live-metrics > div {
  background: #090e1c;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 7px;
  padding: 6px 8px;
  text-align: center;
}

.insp-live-grid span, .insp-live-metrics span {
  display: block;
  font-size: 0.69rem;
  color: #94a3b8;
}

.insp-live-grid strong, .insp-live-metrics strong {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.8rem;
  color: #f8fafc;
}

.insp-field {
  margin-bottom: 11px;
}

.insp-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 4px;
}

.insp-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.insp-unit-badge {
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.76rem;
  color: var(--accent-amber);
  font-weight: 700;
}

.insp-inputs-row {
  display: grid;
  grid-template-columns: 1fr 82px;
  gap: 7px;
  align-items: center;
}

.insp-inputs-row input[type="range"],
.insp-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent-cyan);
}

.insp-inputs-row input[type="number"],
.insp-field select {
  width: 100%;
  background: #090e1c;
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 0.8rem;
  direction: ltr;
}

.insp-probe-btns, .phys-action-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.btn-primary-glow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff !important;
  border: 1px solid #38bdf8;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.btn-primary-glow:hover {
  filter: brightness(1.1);
}

.btn-subtle, .insp-btn, .probe-btn {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.probe-btn.ch1:hover {
  border-color: #38bdf8;
  color: #38bdf8;
}

.probe-btn.ch2:hover {
  border-color: #fbbf24;
  color: #fbbf24;
}

/* Physics Studio Layout */
.physics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  min-height: 560px;
}

#physics-canvas {
  display: block;
  width: 100%;
  height: 425px;
  touch-action: none;
  user-select: none;
}

.phys-telemetry-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: #090e1c;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  direction: ltr;
}

.phys-metric-pill {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 0.78rem;
  display: inline-flex;
  gap: 7px;
}

.phys-metric-pill span { color: #94a3b8; }
.phys-metric-pill strong { color: #f8fafc; font-family: ui-monospace, monospace; }

#physics-plot-canvas {
  display: block;
  width: 100%;
  height: 112px;
}

.studio-hint {
  font-size: 0.8rem;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 8px 0 12px;
}

.insp-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #e2e8f0;
  margin-top: 10px;
  cursor: pointer;
}

/* Interactive Calculators Workbench */
.calc-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 28px;
}

.calc-two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: start;
}

.calc-results-cards {
  display: grid;
  gap: 10px;
}

.calc-result-card {
  background: #080d1a;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 10px;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calc-result-card span {
  font-size: 0.86rem;
  color: #cbd5e1;
}

.calc-result-card strong {
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 1.05rem;
  color: var(--accent-amber);
}

.resistor-svg-stage {
  background: #070b16;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  margin: 14px 0 18px;
}

.resistor-big-readout {
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 1.85rem;
  font-weight: 800;
  color: #38bdf8;
  margin-top: 6px;
}

.resistor-big-readout span {
  font-size: 1.1rem;
  color: #fbbf24;
}

.resistor-range-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.calc-grid-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px;
}

.calc-cta-bar {
  margin-top: 18px;
}

/* Catalog Sections & Rich Engineering Documentation */
.section-block {
  margin: 34px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.38rem;
  color: #fff;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 14px;
}

.lab-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(17, 24, 39, 0.82);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.lab-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
}

.card-cat {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lab-card h3 {
  margin: 6px 0 8px;
  font-size: 1.02rem;
  color: #f8fafc;
}

.lab-card p {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.formula-pill {
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.78rem;
  color: #fde68a;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.24);
  border-radius: 7px;
  padding: 6px 10px;
  margin-bottom: 10px;
  overflow-x: auto;
}

.doc-article {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
}

.doc-article h2 {
  margin-top: 0;
  color: #fff;
  font-size: 1.28rem;
}

.doc-formula-banner {
  direction: ltr;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 1.08rem;
  font-weight: 700;
  color: #7dd3fc;
  background: #060a15;
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 10px;
  padding: 14px;
  margin: 14px 0 18px;
}

.steps-list {
  padding-inline-start: 20px;
  color: #e2e8f0;
}

.steps-list li {
  margin-bottom: 8px;
}

.faq-item {
  border-top: 1px solid var(--border-subtle);
  padding: 14px 0;
}

.faq-item h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: #f8fafc;
}

.faq-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.breadcrumb-nav {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(5, 8, 17, 0.92);
  padding: 28px 0 36px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

@media (max-width: 920px) {
  .circuit-grid {
    grid-template-columns: 1fr;
  }
  .palette-pane {
    max-height: none;
    border-inline-end: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .palette-items {
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  }
  .inspector-pane {
    max-height: none;
    border-inline-start: none;
    border-top: 1px solid var(--border-subtle);
  }
  .physics-grid, .calc-two-col {
    grid-template-columns: 1fr;
  }
}
