/**
 * Psiphon Official Landing Page - Specialized Components
 * Components:
 * 1. Post-Quantum Cryptography Simulator (Kyber-1024 vs RSA vs ECC)
 * 2. Trans-Pacific Submarine Cable BBRv3 Oscilloscope
 * 3. 4K/8K Dolby Vision & IPv6 Benchmark Testbed
 * 4. News Center Dynamic Engine (Filter, Paginator, Article Expander)
 * 5. Help Docs Step Nav & Code Snippets
 * 6. Go Redirect Terminal HUD
 */

/* -------------------------------------------------------------
 * 1. Post-Quantum Cryptography Simulator
 * ----------------------------------------------------------- */
.quantum-simulator-card {
  background: var(--bg-card);
  border: 1px solid var(--cobalt-border);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: hidden;
}

.simulator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.sim-algo-selector {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.sim-algo-btn {
  background: transparent;
  border: none;
  color: var(--text-sub);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sim-algo-btn.active {
  background: linear-gradient(135deg, var(--cobalt-primary), #0099ff);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 119, 255, 0.5);
}

.sim-algo-btn.active.amber {
  background: linear-gradient(135deg, #ff8800, #ffbb00);
  color: #000000;
  box-shadow: 0 2px 10px rgba(255, 170, 0, 0.5);
}

.sim-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cobalt-glow);
}

.sim-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.sim-metric-group {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.metric-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.metric-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
}

.metric-label {
  color: var(--text-sub);
}

.metric-value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #ffffff;
}

.progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s ease;
}

.progress-fill.blue {
  background: linear-gradient(90deg, #0066ff, #00d2ff);
  box-shadow: 0 0 10px #00d2ff;
}

.progress-fill.amber {
  background: linear-gradient(90deg, #ff8800, #ffbb00);
  box-shadow: 0 0 10px #ffbb00;
}

.progress-fill.red {
  background: linear-gradient(90deg, #ef4444, #f87171);
  box-shadow: 0 0 10px #ef4444;
}

.quantum-defense-hud {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hud-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  font-weight: 700;
}

.hud-defense-level {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.level-badge {
  font-size: 2.2rem;
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--cobalt-glow);
}

.level-desc {
  font-size: 0.95rem;
  color: var(--text-sub);
}

.sim-slider-wrap {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-bottom: 0.5rem;
}

.sim-slider {
  width: 100%;
  accent-color: var(--cobalt-glow);
  cursor: pointer;
}

/* -------------------------------------------------------------
 * 2. Submarine Cable & BBRv3 Oscilloscope
 * ----------------------------------------------------------- */
.cable-scope-container {
  background: var(--bg-card);
  border: 1px solid var(--cobalt-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.cable-routes-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.route-pill-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  color: var(--text-sub);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.route-pill-btn:hover {
  border-color: var(--cobalt-glow);
  color: #ffffff;
}

.route-pill-btn.active {
  background: var(--cobalt-dim);
  border-color: var(--cobalt-glow);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.25);
}

.cable-canvas-wrap {
  position: relative;
  width: 100%;
  height: 280px;
  background: #020306;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 210, 255, 0.2);
  overflow: hidden;
}

#cableOscilloscopeCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-overlay-grid {
  position: absolute;
  top: 1rem;
  left: 1.2rem;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cobalt-glow);
  background: rgba(5, 7, 11, 0.75);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 210, 255, 0.2);
}

.cable-telemetry-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  margin-top: 1.5rem;
  padding: 1.2rem;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.telemetry-cell {
  text-align: center;
}

.telemetry-val {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #ffffff;
}

.telemetry-val.blue { color: var(--cobalt-glow); }
.telemetry-val.gold { color: var(--amber-glow); }
.telemetry-val.green { color: #10b981; }

.telemetry-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* -------------------------------------------------------------
 * 3. 4K/8K & IPv6 Benchmark Testbed
 * ----------------------------------------------------------- */
.benchmark-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  margin-top: 2rem;
}

.benchmark-runner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.benchmark-result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.benchmark-box {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  position: relative;
  transition: all var(--transition-normal);
}

.benchmark-box.tested {
  border-color: var(--cobalt-border);
  box-shadow: 0 4px 20px rgba(0, 119, 255, 0.15);
}

.bench-score {
  font-size: 2.2rem;
  font-family: var(--font-mono);
  font-weight: 800;
  color: #ffffff;
  margin: 0.6rem 0;
}

.bench-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.bench-badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* -------------------------------------------------------------
 * 4. News Center (news.html)
 * ----------------------------------------------------------- */
.news-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
  justify-content: center;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-sub);
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--cobalt-glow);
  color: #ffffff;
}

.filter-btn.active {
  background: var(--cobalt-dim);
  border-color: var(--cobalt-glow);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.3);
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 960px;
  margin: 0 auto;
}

.news-article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  transition: all var(--transition-normal);
}

.news-article-card:hover {
  border-color: var(--cobalt-border);
  box-shadow: var(--shadow-card);
}

.article-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.article-category {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cobalt-glow);
  background: var(--cobalt-dim);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.article-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.article-title {
  font-size: 1.45rem;
  margin-bottom: 0.9rem;
  color: #ffffff;
}

.article-excerpt {
  color: var(--text-sub);
  line-height: 1.7;
  font-size: 0.98rem;
}

.article-full-content {
  display: none;
  margin-top: 1.4rem;
  padding-top: 1.4rem;
  border-top: 1px dashed var(--border-subtle);
  color: var(--text-sub);
  line-height: 1.8;
  font-size: 0.96rem;
}

.article-full-content.expanded {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.article-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: var(--cobalt-glow);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1.2rem;
  padding: 0.3rem 0;
}

.article-expand-btn:hover {
  color: #60a5fa;
  text-decoration: underline;
}

/* Pagination */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3.5rem;
}

.page-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-sub);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--cobalt-glow);
  color: #ffffff;
}

.page-btn.active {
  background: var(--cobalt-primary);
  border-color: var(--cobalt-glow);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(0, 119, 255, 0.4);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* -------------------------------------------------------------
 * 5. Help Docs & Troubleshooting (help.html)
 * ----------------------------------------------------------- */
.docs-tabs-nav {
  display: flex;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.docs-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.docs-tab-btn.active {
  color: #ffffff;
  background: var(--bg-card);
  border-bottom: 2px solid var(--cobalt-glow);
}

.docs-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.step-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cobalt-primary);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  margin-right: 0.6rem;
}

.code-terminal-block {
  background: #020306;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin: 1rem 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #38bdf8;
  overflow-x: auto;
  position: relative;
}

.code-terminal-block::before {
  content: 'BASH / CONFIG';
  position: absolute;
  top: 0.4rem;
  right: 0.8rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* -------------------------------------------------------------
 * 6. Go Redirect Terminal HUD (go.html)
 * ----------------------------------------------------------- */
.redirect-hud-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.redirect-hud-box {
  background: #080c14;
  border: 1px solid var(--cobalt-glow);
  box-shadow: 0 0 50px rgba(0, 119, 255, 0.35);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  padding: 2.5rem;
  text-align: center;
  position: relative;
}

.redirect-terminal-log {
  background: #020306;
  border: 1px solid rgba(0, 210, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #38bdf8;
  text-align: left;
  height: 160px;
  overflow-y: auto;
  margin: 1.5rem 0;
}

.redirect-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 1.5rem 0;
}

.redirect-progress-inner {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cobalt-glow), var(--amber-glow));
  box-shadow: 0 0 12px var(--cobalt-glow);
  transition: width 1.2s linear;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .sim-grid {
    grid-template-columns: 1fr;
  }
  .cable-telemetry-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .benchmark-result-grid {
    grid-template-columns: 1fr;
  }
}

