/* ============================================================
   BIBLE.CSS — Solution Study Styles
   PenzePOiNT Tech Spec 001 Interactive Edition
   ============================================================ */

/* ---- Layout ---- */
.bible-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  min-height: 80vh;
  align-items: start;
}
@media (max-width: 900px) {
  .bible-layout { grid-template-columns: 1fr; }
  .bible-toc { display: flex; flex-wrap: wrap; gap: 8px; }
}

.bible-toc {
  position: sticky;
  top: 100px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 20px;
}

.toc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  transition: all 0.2s;
  margin-bottom: 2px;
}
.toc-item:hover { background: rgba(255,255,255,0.05); color: var(--text-main); }
.toc-item.active { background: var(--emerald-soft); color: var(--emerald); font-weight: 800; }

/* ---- Content ---- */
.bible-content-wrapper { min-width: 0; }

.bible-progress-nav {
  height: 3px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  margin-bottom: 32px;
  overflow: hidden;
}
.bible-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--accent));
  border-radius: 2px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px var(--emerald-glow);
}

.bible-prose h3 {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 12px;
  color: var(--text-main);
  letter-spacing: -0.5px;
}
.bible-prose h4 {
  font-size: 16px;
  font-weight: 800;
  margin: 28px 0 12px;
  color: var(--emerald);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.bible-prose p { color: var(--slate); line-height: 1.7; margin-bottom: 16px; font-size: 15px; }
.bible-prose strong { color: var(--text-main); }
.bible-prose code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--emerald);
}

/* ---- Module Badge ---- */
.module-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--emerald-soft);
  color: var(--emerald);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

/* ---- Architecture Diagram ---- */
.arch-diagram {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 40px 24px;
  margin: 24px 0;
  overflow-x: auto;
}
.arch-layers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 700px;
  margin: 0 auto;
}
.arch-layer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
}
.arch-layer:hover { border-color: var(--emerald); background: var(--emerald-soft); transform: translateX(4px); }
.arch-layer.selected { border-color: var(--emerald); background: var(--emerald-soft); box-shadow: 0 0 20px var(--emerald-glow); }
.arch-layer .layer-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.arch-layer .layer-name { font-weight: 800; font-size: 14px; color: var(--text-main); }
.arch-layer .layer-tech { font-size: 11px; color: var(--slate); font-family: var(--font-mono); margin-top: 2px; }
.arch-layer .layer-cost { margin-left: auto; font-size: 11px; color: var(--slate); font-family: var(--font-mono); }

.arch-connector {
  display: flex;
  justify-content: center;
  color: var(--slate);
  opacity: 0.4;
  font-size: 18px;
}

.layer-detail-panel {
  background: rgba(16,185,129,0.05);
  border: 1px solid var(--emerald);
  border-radius: 16px;
  padding: 20px;
  margin-top: 16px;
  animation: fadeIn 0.3s ease;
}

/* ---- NFR Table ---- */
.nfr-table-wrap { overflow-x: auto; margin: 20px 0; }
.nfr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nfr-table th { padding: 12px 16px; background: rgba(255,255,255,0.04); color: var(--slate); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; text-align: left; }
.nfr-table td { padding: 12px 16px; border-top: 1px solid var(--border-glass); color: var(--text-main); }
.nfr-table tr:hover td { background: rgba(255,255,255,0.02); }
.nfr-table .val-pilot { color: var(--warning); font-family: var(--font-mono); font-weight: 700; }
.nfr-table .val-enterprise { color: var(--emerald); font-family: var(--font-mono); font-weight: 700; }

/* ---- DB Schema ---- */
.entity-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.entity-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.entity-card:hover { border-color: var(--accent); background: rgba(59,130,246,0.05); }
.entity-card.selected { border-color: var(--accent); background: rgba(59,130,246,0.08); box-shadow: 0 0 20px rgba(59,130,246,0.15); }
.entity-name { font-family: var(--font-mono); font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.entity-type { font-size: 11px; color: var(--slate); margin-bottom: 10px; }
.entity-fields { display: flex; flex-direction: column; gap: 4px; }
.entity-field { font-size: 11px; font-family: var(--font-mono); color: var(--slate); display: flex; justify-content: space-between; }
.entity-field span:last-child { color: var(--accent); }

/* ---- API Sandbox ---- */
.api-sandbox {
  background: #0a0a12;
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  overflow: hidden;
  margin: 20px 0;
}
.api-sandbox-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border-glass);
}
.api-sandbox-dots { display: flex; gap: 6px; }
.api-sandbox-dots span { width: 10px; height: 10px; border-radius: 50%; }
.api-method-select {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-glass);
  overflow-x: auto;
}
.api-method-btn {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
  font-family: var(--font-mono);
  border: 1px solid var(--border-glass);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  color: var(--slate);
}
.api-method-btn.active, .api-method-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-main); }
.api-method-btn.method-get { border-color: #10b981; }
.api-method-btn.method-get.active { background: rgba(16,185,129,0.15); color: var(--emerald); }
.api-method-btn.method-post { border-color: #3b82f6; }
.api-method-btn.method-post.active { background: rgba(59,130,246,0.15); color: var(--accent); }
.api-sandbox-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 200px;
}
@media (max-width: 700px) { .api-sandbox-body { grid-template-columns: 1fr; } }
.api-sandbox-input { padding: 16px; border-right: 1px solid var(--border-glass); font-family: var(--font-mono); font-size: 12px; color: var(--slate); white-space: pre; overflow-x: auto; }
.api-sandbox-output { padding: 16px; font-family: var(--font-mono); font-size: 12px; min-height: 180px; }
.api-run-btn { margin-left: auto; }

/* ---- Pension Engine Sliders ---- */
.engine-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}
@media (max-width: 700px) { .engine-panel { grid-template-columns: 1fr; } }

.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.scenario-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
}
.scenario-card.best { border-color: var(--emerald); background: var(--emerald-soft); }
.scenario-card.worst { border-color: var(--danger); background: rgba(244,63,94,0.05); }
.scenario-label { font-size: 11px; color: var(--slate); margin-bottom: 8px; font-weight: 700; }
.scenario-value { font-size: 22px; font-weight: 900; }
.scenario-diff { font-size: 11px; margin-top: 6px; font-family: var(--font-mono); }

/* ---- IOLDP Pipeline Flow ---- */
.ioldp-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 20px 0;
}
.ioldp-step {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: rgba(255,255,255,0.01);
  margin-bottom: 4px;
  transition: all 0.3s;
  position: relative;
}
.ioldp-step.active { border-color: var(--emerald); background: var(--emerald-soft); }
.ioldp-step.done { border-color: rgba(16,185,129,0.3); }
.ioldp-step-num {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 13px;
  flex-shrink: 0;
  color: var(--slate);
  transition: all 0.3s;
}
.ioldp-step.active .ioldp-step-num { background: var(--emerald); color: #000; }
.ioldp-step.done .ioldp-step-num { background: rgba(16,185,129,0.3); color: var(--emerald); }
.ioldp-step-content { flex: 1; }
.ioldp-step-title { font-weight: 800; font-size: 14px; margin-bottom: 2px; }
.ioldp-step-desc { font-size: 12px; color: var(--slate); }

/* ---- Security Layers ---- */
.sec-layers { display: flex; flex-direction: column; gap: 8px; margin: 20px 0; }
.sec-layer {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: rgba(255,255,255,0.01);
  transition: all 0.2s;
  cursor: default;
}
.sec-layer:hover { background: rgba(255,255,255,0.04); }
.sec-layer-badge {
  font-size: 10px; font-weight: 900;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: var(--slate);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.sec-layer-name { font-weight: 800; font-size: 14px; flex: 1; }
.sec-layer-desc { font-size: 12px; color: var(--slate); }

.rbac-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 0; margin: 20px 0; font-size: 13px; }
.rbac-header { padding: 10px 14px; background: rgba(255,255,255,0.04); font-size: 11px; font-weight: 800; color: var(--slate); text-transform: uppercase; letter-spacing: 1px; }
.rbac-cell { padding: 10px 14px; border-top: 1px solid var(--border-glass); display: flex; align-items: center; }
.rbac-yes { color: var(--emerald); font-size: 16px; }
.rbac-no { color: var(--danger); font-size: 16px; }

/* ---- Infrastructure ---- */
.infra-stack {
  display: flex; flex-direction: column; gap: 10px; margin: 20px 0;
}
.infra-item {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: rgba(255,255,255,0.01);
}
.infra-item .infra-icon { font-size: 20px; }
.infra-item .infra-name { font-weight: 800; font-size: 14px; }
.infra-item .infra-desc { font-size: 12px; color: var(--slate); }
.infra-item .infra-link { font-size: 11px; color: var(--accent); text-decoration: none; font-family: var(--font-mono); }
.infra-item .infra-link:hover { text-decoration: underline; }
.infra-item .infra-phase { font-size: 10px; padding: 3px 8px; border-radius: 4px; background: rgba(255,255,255,0.05); color: var(--slate); font-weight: 800; }
.infra-phase-1 { color: var(--emerald) !important; background: var(--emerald-soft) !important; }
.infra-phase-2 { color: var(--accent) !important; background: rgba(59,130,246,0.1) !important; }

/* ---- Integrations ---- */
.integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.integration-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
}
.integration-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); border-color: var(--accent); }
.integration-logo { font-size: 28px; margin-bottom: 10px; }
.integration-name { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.integration-desc { font-size: 12px; color: var(--slate); line-height: 1.5; }
.integration-status { margin-top: 10px; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 4px; display: inline-block; }
.status-pilot { background: var(--emerald-soft); color: var(--emerald); }
.status-phase2 { background: rgba(59,130,246,0.1); color: var(--accent); }
.status-phase3 { background: rgba(255,255,255,0.05); color: var(--slate); }

/* ---- Testing Pyramid ---- */
.test-pyramid { display: flex; flex-direction: column; gap: 8px; margin: 20px 0; }
.pyramid-tier {
  border-radius: 12px; padding: 16px 20px;
  border: 1px solid var(--border-glass);
  display: flex; align-items: center; gap: 16px;
}
.pyramid-tier:nth-child(1) { background: rgba(244,63,94,0.08); border-color: rgba(244,63,94,0.3); }
.pyramid-tier:nth-child(2) { background: rgba(59,130,246,0.06); border-color: rgba(59,130,246,0.2); }
.pyramid-tier:nth-child(3) { background: rgba(16,185,129,0.06); border-color: rgba(16,185,129,0.2); }
.pyramid-tier-label { font-weight: 800; font-size: 14px; flex: 1; }
.pyramid-tier-count { font-size: 11px; color: var(--slate); font-family: var(--font-mono); }

/* ---- Monitoring / Glossary ---- */
.monitoring-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 20px 0; }
.monitoring-card { background: rgba(255,255,255,0.02); border: 1px solid var(--border-glass); border-radius: 14px; padding: 20px; }
.monitoring-tool { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.monitoring-use { font-size: 12px; color: var(--slate); line-height: 1.5; }

.glossary-list { display: flex; flex-direction: column; gap: 8px; margin: 20px 0; }
.glossary-item { padding: 14px 20px; background: rgba(255,255,255,0.02); border-radius: 10px; border-left: 3px solid var(--emerald); }
.glossary-term { font-weight: 800; font-family: var(--font-mono); color: var(--emerald); margin-bottom: 4px; }
.glossary-def { font-size: 13px; color: var(--slate); }

/* ---- AI Co-pilot Chat ---- */
.ai-copilot-panel {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 8px;
}
.ai-copilot-messages {
  padding: 16px;
  min-height: 200px;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ai-msg { padding: 12px 16px; border-radius: 12px; font-size: 13px; line-height: 1.6; max-width: 90%; }
.ai-msg.user { background: var(--accent); color: #fff; align-self: flex-end; border-radius: 12px 12px 2px 12px; }
.ai-msg.bot { background: rgba(255,255,255,0.04); color: var(--text-main); align-self: flex-start; border-radius: 12px 12px 12px 2px; border: 1px solid var(--border-glass); }
.ai-copilot-input { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border-glass); }
.ai-copilot-input input {
  flex: 1; background: transparent; border: 1px solid var(--border-glass);
  border-radius: 10px; padding: 10px 14px; font-size: 13px;
  color: var(--text-main); outline: none; font-family: var(--font-sans);
}
.ai-copilot-input input:focus { border-color: var(--emerald); }

/* ---- Version history ---- */
.version-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 16px 0; }
.version-table th { padding: 10px 14px; background: rgba(255,255,255,0.04); color: var(--slate); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; text-align: left; }
.version-table td { padding: 10px 14px; border-top: 1px solid var(--border-glass); }
.version-tag { font-family: var(--font-mono); color: var(--accent); font-weight: 700; }

/* ---- Code highlighting ---- */
.code-kw { color: #f43f5e; }
.code-fn { color: #a78bfa; }
.code-str { color: #34d399; }
.code-cm { color: #64748b; font-style: italic; }
.code-num { color: #fb923c; }

/* ---- Misc ---- */
.bible-export-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 24px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  margin-bottom: 24px;
}
.bible-export-bar p { font-size: 13px; color: var(--slate); flex: 1; margin: 0; }

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

/* ---- Chapter 5-12 extras ---- */
.flow-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 24px 0;
}
.flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--slate);
  transition: all 0.4s ease;
  min-width: 80px;
}
.flow-node.active {
  border-color: var(--emerald);
  color: var(--emerald);
  background: rgba(16,185,129,0.1);
  box-shadow: 0 0 20px rgba(16,185,129,0.2);
}
.flow-node svg { width: 24px; height: 24px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.stat-box {
  padding: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  transition: all 0.3s ease;
}
.stat-box:hover { background: rgba(255,255,255,0.06); }
.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate);
  margin-bottom: 8px;
}
.stat-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
