/**
 * 0xCyberLiTech · CLT1 — ARCHITECTURE : SCHÉMAS ET PIPELINES DE FLUX
 * Règle 14.7 · Architecture modulaire pure <= 300L · Zéro Dette
 */

/* ==============================================================================
   7. INTERACTIVE ARCHITECTURAL SCHEMAS & FLOW DIAGRAMS (L'INGÉNIERIE SOUVERAINE)
   ============================================================================== */
.arch-diagram-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid var(--border-card);
  border-radius: 28px;
  padding: 40px;
  box-shadow: var(--shadow-elevated), var(--shadow-luminous-cyan);
  margin: 36px 0 70px 0;
  position: relative;
  overflow: hidden;
}

.arch-tabs-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--border-card);
  margin-bottom: 34px;
  overflow-x: auto;
  scrollbar-width: none;
}

.arch-tab-btn {
  flex: 1 0 auto;
  min-width: 170px;
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--speed-smooth);
  white-space: nowrap;
}

.arch-tab-btn:hover {
  color: var(--text-headline);
  background: rgba(255, 255, 255, 0.6);
}

.arch-tab-btn.is-active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 195, 255, 0.3);
}

.arch-view-pane { display: none; }
.arch-view-pane.is-active { display: block; animation: fadeInPane 0.35s ease; }

@keyframes fadeInPane {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Linear & Directed Flow Pipeline */
.arch-flow-pipeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  position: relative;
  margin-bottom: 32px;
  align-items: stretch;
}
@media (max-width: 767px) {
  .arch-flow-pipeline { grid-template-columns: 1fr; gap: 14px; }
}

.arch-flow-node {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 20px 16px 18px 16px;
  box-shadow: var(--shadow-card);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  box-sizing: border-box;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

@media (min-width: 1101px) {
  .arch-flow-node:not(:last-child)::after {
    content: '→';
    position: absolute;
    right: -13px;
    top: 24px;
    width: 22px;
    height: 22px;
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    z-index: 4;
    box-shadow: var(--shadow-soft);
    pointer-events: none;
    line-height: 1;
  }
}

.arch-flow-node:hover {
  transform: translateY(-3px);
  border-color: var(--border-card-hover);
  box-shadow: var(--shadow-card-hover);
}

.arch-node-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.arch-node-icon { width: 36px; height: 36px; min-width: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.arch-node-icon.cyan { background: var(--accent-cyan-soft); color: var(--accent-cyan); }
.arch-node-icon.indigo { background: var(--accent-indigo-soft); color: var(--accent-indigo); }
.arch-node-icon.emerald { background: var(--accent-emerald-soft); color: var(--accent-emerald); }
.arch-node-icon.purple { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.arch-node-icon.amber { background: var(--accent-amber-soft); color: var(--accent-amber); }

.arch-node-port {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: #0f172a;
  white-space: nowrap;
}

.arch-flow-node > div:nth-child(2) { display: flex; flex-direction: column; flex: 1; }
.arch-node-stage-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  white-space: nowrap;
}
.arch-node-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-headline);
  margin-bottom: 8px;
  line-height: 1.3;
  min-height: 48px;
  display: flex;
  align-items: flex-start;
}
.arch-node-desc {
  font-size: 0.82rem;
  color: var(--text-body);
  line-height: 1.55;
  margin-bottom: 14px;
  min-height: 62px;
  flex: 1;
}
.arch-node-tags {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  box-sizing: border-box;
}
.arch-tag-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #0f172a;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Real Technical Code & Architecture Box */
.arch-code-blueprint {
  background: #0b1329;
  border: 1px solid #1e293b;
  border-radius: 18px;
  padding: 24px;
  margin-top: 24px;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.arch-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.arch-code-title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 8px;
}
.arch-code-content {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #e2e8f0;
  line-height: 1.65;
  margin: 0;
  white-space: pre;
  overflow-x: auto;
}

/* Deterministic Arbitrage Split Visual Box */
.arbitrage-split-box {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.04) 0%, rgba(99, 102, 241, 0.04) 100%);
  border: 1.5px solid rgba(0, 195, 255, 0.25);
  border-radius: 20px;
  padding: 30px;
  margin: 28px 0;
}
.split-branch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}
@media (max-width: 860px) {
  .split-branch-grid { grid-template-columns: 1fr; }
}
.split-branch-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: all var(--speed-smooth);
}
.split-branch-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08); }
.split-branch-card p { flex: 1; }
.split-branch-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.split-branch-footer.emerald { color: #166534; }
.split-branch-footer.amber { color: #92400e; }
.split-branch-footer.indigo { color: #3730a3; }
.branch-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 12px;
  align-self: flex-start;
}
.branch-badge.emerald { background: #dcfce7; color: #166534; }
.branch-badge.amber { background: #fef3c7; color: #92400e; }
.branch-badge.indigo { background: #e0e7ff; color: #3730a3; }
