/* ==========================================================================
   ALGEX SDX — How It Works: Interactive Simulator & Specifications (Dark/Light)
   ========================================================================== */

.how-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 0.5rem;
}

.how-hero {
  text-align: center;
  margin-bottom: 2.25rem;
}

.interactive-player-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(11, 15, 25, 0.98));
  border: 2px solid var(--border-glass-hover);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.7), 0 0 25px var(--quantum-glow);
  margin-bottom: 2.75rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

[data-theme="light"] .interactive-player-card {
  background: #FFFFFF;
  border: 2px solid #BFDBFE;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.08), 0 0 20px rgba(37, 99, 235, 0.05);
}

.interactive-player-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--quantum-blue), var(--parity-gold), var(--instant-green));
}

/* ==========================================
   Simulation Screen (Adaptive Light & Dark)
   ========================================== */
.player-screen {
  background: #060913;
  border: 1px solid #1E293B;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  min-height: 270px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.8);
  transition: var(--transition-smooth);
}

[data-theme="light"] .player-screen {
  background: linear-gradient(135deg, #F8FAFC, #EFF6FF);
  border: 1px solid #BFDBFE;
  box-shadow: inset 0 2px 8px rgba(37, 99, 235, 0.04), 0 4px 16px rgba(0, 0, 0, 0.02);
}

/* Simulation Screen Elements */
.sim-grid-wrap {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 1.25rem 0;
  flex-wrap: wrap;
  gap: 1rem;
}

.sim-party-box {
  text-align: center;
}

.sim-flag {
  font-size: 2.4rem;
  line-height: 1;
}

.sim-party-title-alg {
  font-weight: 800;
  color: #93C5FD;
  font-size: 1.05rem;
  margin-top: 0.35rem;
}

[data-theme="light"] .sim-party-title-alg {
  color: #1E40AF;
}

.sim-party-title-sa {
  font-weight: 800;
  color: #6EE7B7;
  font-size: 1.05rem;
  margin-top: 0.35rem;
}

[data-theme="light"] .sim-party-title-sa {
  color: #065F46;
}

.sim-cargo-val-alg {
  color: #60A5FA;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 1.2rem;
  margin-top: 0.25rem;
  direction: ltr;
}

[data-theme="light"] .sim-cargo-val-alg {
  color: #2563EB;
}

.sim-cargo-val-sa {
  color: #34D399;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 1.2rem;
  margin-top: 0.25rem;
  direction: ltr;
}

[data-theme="light"] .sim-cargo-val-sa {
  color: #059669;
}

.sim-hsm-tag {
  font-size: 0.78rem;
  color: #34D399;
  font-weight: 700;
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .sim-hsm-tag {
  color: #047857;
  background: #ECFDF5;
  border-color: #A7F3D0;
}

.sim-net-icon {
  font-size: 2.2rem;
  color: #3B82F6;
  animation: pulseGreen 1.5s infinite;
}

[data-theme="light"] .sim-net-icon {
  color: #2563EB;
}

/* Step 2 in Simulation Screen */
.sim-shield-icon {
  font-size: 2.75rem;
  color: #34D399;
  margin-bottom: 0.5rem;
}

[data-theme="light"] .sim-shield-icon {
  color: #059669;
}

.sim-balance-title {
  font-weight: 900;
  font-size: 1.25rem;
  color: #34D399;
}

[data-theme="light"] .sim-balance-title {
  color: #047857;
}

.sim-desc-text {
  color: #E2E8F0;
  font-size: 0.92rem;
  margin-top: 0.45rem;
  max-width: 600px;
  margin-inline: auto;
  font-weight: 600;
  line-height: 1.6;
}

[data-theme="light"] .sim-desc-text {
  color: #334155;
}

/* Step 3 in Simulation Screen */
.sim-step3-math {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.4rem 0;
  direction: ltr;
  color: #FBBF24;
}

[data-theme="light"] .sim-step3-math {
  color: #B45309;
}

.sim-step3-math .katex {
  font-size: 1.6rem;
}

/* Step 4 in Simulation Screen */
.sim-stamp-icon {
  font-size: 2.5rem;
  color: #FBBF24;
  margin-bottom: 0.35rem;
}

[data-theme="light"] .sim-stamp-icon {
  color: #D97706;
}

.sim-step4-title {
  font-weight: 900;
  font-size: 1.25rem;
  color: #F9FAFB;
}

[data-theme="light"] .sim-step4-title {
  color: #0F172A;
}

.sim-settle-speed {
  color: #34D399;
  font-weight: 900;
  margin-top: 0.35rem;
  font-size: 1rem;
}

[data-theme="light"] .sim-settle-speed {
  color: #059669;
}

.sim-hash-text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #94A3B8;
  margin-top: 0.35rem;
  direction: ltr;
}

[data-theme="light"] .sim-hash-text {
  color: #64748B;
}

/* Terminal Log Stream */
.terminal-stream {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #34D399;
  background: rgba(0, 0, 0, 0.85);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-xs);
  border-left: 3px solid #10B981;
  direction: ltr;
  text-align: left;
  margin-top: 1rem;
  line-height: 1.5;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.7);
  overflow-x: auto;
  font-weight: 700;
  transition: var(--transition-smooth);
}

[data-theme="light"] .terminal-stream {
  background: #F1F5F9;
  color: #065F46;
  border: 1px solid #CBD5E1;
  border-left: 4px solid #059669;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Player Controls */
.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-glass);
  flex-wrap: wrap;
  gap: 0.85rem;
}

[data-theme="light"] .player-controls {
  border-top-color: #E2E8F0;
}

.step-nav-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.step-pill-btn {
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

[data-theme="light"] .step-pill-btn {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #334155;
}

.step-pill-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-glass-hover);
  transform: translateY(-1px);
}

.step-pill-btn.active {
  background: linear-gradient(135deg, #2563EB, #1D4ED8) !important;
  color: #FFFFFF !important;
  border-color: #1D4ED8 !important;
  box-shadow: 0 0 14px var(--quantum-glow);
  font-weight: 900;
}

.architecture-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

/* Center card 4 in the 2nd row on Desktop only */
@media (min-width: 1024px) {
  .architecture-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .architecture-grid .card-step-4 {
    grid-column: 2;
  }
}

@media (max-width: 1023px) and (min-width: 769px) {
  .architecture-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .architecture-grid .card-step-4 {
    grid-column: span 2;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .architecture-grid {
    grid-template-columns: 1fr;
  }
  .architecture-grid .card-step-4 {
    grid-column: auto;
    max-width: 100%;
    margin: 0;
  }
}

.tech-spec-section {
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.table-scroll-hint {
  display: none;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: var(--quantum-blue-light);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

[data-theme="light"] .table-scroll-hint {
  color: #1D4ED8;
}

.tech-spec-table-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  margin-top: 0.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .tech-spec-table-scroll-wrapper {
  background: #FFFFFF;
  border-color: #CBD5E1;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

.tech-spec-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  border: none;
  margin-top: 0;
  transition: var(--transition-smooth);
}

.tech-spec-table th,
.tech-spec-table td {
  padding: 0.95rem 1.25rem;
  text-align: right;
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.88rem;
  vertical-align: middle;
}

.tech-spec-table th:nth-child(1),
.tech-spec-table td:nth-child(1) {
  min-width: 180px;
  white-space: nowrap;
}

.tech-spec-table th:nth-child(2),
.tech-spec-table td:nth-child(2) {
  min-width: 190px;
  white-space: nowrap;
}

.tech-spec-table th:nth-child(3),
.tech-spec-table td:nth-child(3) {
  min-width: 240px;
  white-space: normal;
  line-height: 1.45;
}

[data-theme="light"] .tech-spec-table th,
[data-theme="light"] .tech-spec-table td {
  border-bottom-color: #E2E8F0;
}

.tech-spec-table th {
  background: rgba(59, 130, 246, 0.1);
  color: var(--text-primary);
  font-weight: 800;
}

[data-theme="light"] .tech-spec-table th {
  background: #EFF6FF;
  color: #1E40AF;
  font-weight: 900;
}

.tech-spec-table td {
  color: var(--text-secondary);
}

[data-theme="light"] .tech-spec-table td {
  color: #334155;
}

.tech-spec-table tr:last-child td {
  border-bottom: none;
}

.tech-spec-table code {
  font-family: var(--font-mono);
  background: rgba(59, 130, 246, 0.12);
  color: var(--quantum-blue-light);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  direction: ltr;
  display: inline-block;
}

[data-theme="light"] .tech-spec-table code {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

@media (max-width: 768px) {
  .player-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .step-nav-pills {
    justify-content: center;
  }
  .player-screen {
    min-height: 240px;
    padding: 1rem;
  }
}

/* Responsive Simulator Controls & Mobile Dropdown */
.desktop-sim-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mobile-sim-dropdown-wrap {
  display: none;
  position: relative;
  width: 100%;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.player-nav-btns {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .interactive-player-card {
    padding: 1.25rem 1rem;
  }
  .desktop-sim-pills {
    display: none !important;
  }
  .mobile-sim-dropdown-wrap {
    display: block !important;
  }
  .player-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .player-nav-btns {
    justify-content: center;
    width: 100%;
  }
  .player-nav-btns button {
    flex: 1;
    text-align: center;
  }
  .sim-grid-wrap {
    flex-direction: column;
    gap: 1.25rem;
  }
  .sim-net-icon {
    transform: rotate(90deg);
    margin: 0.25rem 0;
  }
  .terminal-stream {
    font-size: 0.74rem;
    padding: 0.65rem 0.75rem;
    word-break: break-word;
  }
  .sim-hash-text {
    font-size: 0.72rem;
    word-break: break-all;
  }
  .sim-step4-title {
    font-size: 1.05rem;
  }
}

/* ==========================================================================
   Patent & Thermodynamic Science Showcase Card
   ========================================================================== */
.how-patent-section {
  margin-bottom: 2.75rem;
}

.how-patent-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(20, 15, 38, 0.95));
  border: 1.5px solid rgba(192, 132, 252, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(168, 85, 247, 0.15);
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .how-patent-card {
  background: linear-gradient(135deg, #FAF5FF, #FFFFFF);
  border-color: #D8B4FE;
  box-shadow: 0 10px 30px rgba(126, 34, 206, 0.06);
}

.how-patent-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.how-patent-pillar {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.15rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition-bounce);
}

[data-theme="light"] .how-patent-pillar {
  background: #FFFFFF;
  border-color: #E2E8F0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.how-patent-pillar:hover {
  transform: translateY(-4px);
  border-color: var(--quantum-blue);
}

.pillar-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.pillar-head i {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.pillar-head h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.35;
}

.pillar-text {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

.how-math-box {
  background: #060913;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-xs);
  padding: 0.6rem 0.75rem;
  margin-top: 0.75rem;
  text-align: center;
}

[data-theme="light"] .how-math-box {
  background: #EFF6FF;
  border-color: #BFDBFE;
}

.how-formula-gex {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 900;
  color: var(--quantum-blue-light);
  direction: ltr;
  display: inline-block;
}

[data-theme="light"] .how-formula-gex {
  color: #1D4ED8;
}

@media (max-width: 960px) {
  .how-patent-grid {
    grid-template-columns: 1fr;
  }
}

