/* ============================================================
   PROJECT PAGE ENHANCEMENTS
   Lightbox, TOC Sidebar, Tabbed Docs, Stepper, Copy-to-Clipboard,
   Difficulty Badge, Cost Estimate, Reading Time, Prerequisites
   ============================================================ */

/* ---- Reading Time & Difficulty Badges in Hero ---- */
.project-meta-enhancements {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.meta-badge.reading-time {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.meta-badge.difficulty-beginner {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.meta-badge.difficulty-intermediate {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.meta-badge.difficulty-advanced {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.meta-badge.cost-estimate {
  background: rgba(20, 184, 166, 0.15);
  border: 1px solid rgba(20, 184, 166, 0.35);
  color: #5eead4;
}

/* ---- TOC Sidebar ---- */
.project-layout-wrapper {
  position: relative;
}

.toc-sidebar {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  padding: 12px 8px;
  backdrop-filter: blur(12px);
  min-width: 44px;
}

.toc-sidebar a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  color: rgba(148, 163, 184, 0.7);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s ease;
  overflow: hidden;
  max-width: 36px;
}

.toc-sidebar a i {
  font-size: 0.85rem;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.toc-sidebar a span {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: all 0.25s ease;
}

.toc-sidebar:hover a {
  max-width: 180px;
}

.toc-sidebar:hover a span {
  opacity: 1;
  max-width: 140px;
}

.toc-sidebar a:hover,
.toc-sidebar a.active {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.toc-sidebar a.active {
  border-left: 2px solid #6366f1;
}

@media (max-width: 1280px) {
  .toc-sidebar {
    display: none;
  }
}

/* ---- Architecture Lightbox ---- */
.arch-lightbox-trigger {
  cursor: zoom-in;
  position: relative;
  display: block;
  transition: transform 0.2s ease;
}

.arch-lightbox-trigger::after {
  content: '\f065';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(99, 102, 241, 0.85);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.arch-lightbox-trigger:hover::after {
  opacity: 1;
}

.arch-lightbox-trigger:hover {
  transform: scale(1.005);
}

#arch-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

#arch-lightbox.open {
  display: flex;
}

#arch-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 80px rgba(99, 102, 241, 0.25);
  object-fit: contain;
}

#arch-lightbox .lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  background: rgba(99, 102, 241, 0.3);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#arch-lightbox .lightbox-close:hover {
  background: rgba(99, 102, 241, 0.6);
}

/* ---- Tabbed Documentation ---- */
.doc-tabs-container {
  margin-top: 0;
}

.doc-tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.doc-tab-btn {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(148, 163, 184, 0.7);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: -1px;
  font-family: inherit;
}

.doc-tab-btn:hover {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.08);
  border-radius: 6px 6px 0 0;
}

.doc-tab-btn.active {
  color: #6366f1;
  border-bottom-color: #6366f1;
}

.doc-tab-panel {
  display: none;
}

.doc-tab-panel.active {
  display: block;
  animation: fadeInTab 0.25s ease;
}

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

/* ---- Deployment Stepper ---- */
.deployment-stepper {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 24px 0;
}

.step-item {
  display: flex;
  gap: 20px;
  position: relative;
}

.step-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 44px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, rgba(99, 102, 241, 0.5), rgba(99, 102, 241, 0.1));
}

.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  border: 2px solid rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #a5b4fc;
  position: relative;
  z-index: 1;
  transition: all 0.2s ease;
}

.step-item:hover .step-number {
  background: rgba(99, 102, 241, 0.35);
  border-color: #6366f1;
  color: white;
}

.step-content {
  flex: 1;
  padding-bottom: 28px;
}

.step-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 8px 0 8px;
}

.step-content p {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.8);
  line-height: 1.6;
  margin: 0 0 10px;
}

/* ---- Copy-to-Clipboard Code Blocks ---- */
.code-block-wrapper {
  position: relative;
  margin: 12px 0;
}

.code-block-wrapper pre {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  padding: 14px 48px 14px 16px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.82rem;
  color: #94a3b8;
  overflow-x: auto;
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 5px;
}

.copy-btn:hover {
  background: rgba(99, 102, 241, 0.4);
  color: white;
}

.copy-btn.copied {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

/* ---- Prerequisites Section ---- */
.prerequisites-section {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 16px;
  padding: 28px 32px;
  margin: 24px 0;
}

.prerequisites-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.prerequisites-section h3 i {
  color: #f59e0b;
}

.prereq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.prereq-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 8px;
  font-size: 0.83rem;
  color: #94a3b8;
}

.prereq-item i {
  color: #6366f1;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ---- Cost Estimate Card ---- */
.cost-estimate-card {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.08), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(20, 184, 166, 0.25);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cost-icon {
  font-size: 2rem;
  color: #14b8a6;
}

.cost-details h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 4px;
}

.cost-amount {
  font-size: 1.6rem;
  font-weight: 700;
  color: #5eead4;
  font-family: 'Space Grotesk', sans-serif;
}

.cost-amount span {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.6);
  font-weight: 400;
}

.cost-breakdown {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.cost-item {
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.7);
  display: flex;
  align-items: center;
  gap: 5px;
}

.cost-item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #14b8a6;
  flex-shrink: 0;
}

/* ---- JSON-LD is invisible, no CSS needed ---- */

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .cost-estimate-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .prerequisites-section {
    padding: 20px;
  }
  .doc-tab-btn {
    padding: 8px 14px;
    font-size: 0.82rem;
  }
}

/* ===== Business Context & GRC Grid Layouts ===== */
.bc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.bc-grid > div {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.3s, transform 0.3s;
}

.bc-grid > div:hover {
  border-color: rgba(99,102,241,0.5);
  transform: translateY(-2px);
}

.bc-grid h3 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bc-problem h3::before { content: "⚠"; }
.bc-solution h3::before { content: "✓"; color: #10b981; }
.bc-value h3::before { content: "📈"; }
.bc-risk h3::before { content: "🛡"; }

.bc-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bc-grid ul li {
  padding: 0.4rem 0 0.4rem 1.2rem;
  position: relative;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  line-height: 1.5;
}

.bc-grid ul li:last-child { border-bottom: none; }

.bc-grid ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #6366f1;
  font-size: 0.8rem;
}

.bc-value ul li::before { color: #10b981; content: "↑"; }
.bc-risk ul li::before { color: #f59e0b; content: "✕"; }

/* GRC Grid */
.grc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.grc-grid > div {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.3s, transform 0.3s;
}

.grc-grid > div:hover {
  border-color: rgba(16,185,129,0.5);
  transform: translateY(-2px);
}

.grc-grid h3 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #10b981;
  margin-bottom: 1rem;
}

.grc-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.grc-grid ul li {
  padding: 0.4rem 0 0.4rem 1.2rem;
  position: relative;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.8);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  line-height: 1.5;
}

.grc-grid ul li:last-child { border-bottom: none; }

.grc-grid ul li::before {
  content: "◆";
  position: absolute;
  left: 0;
  color: #10b981;
  font-size: 0.6rem;
  top: 0.6rem;
}

@media (max-width: 768px) {
  .bc-grid, .grc-grid { grid-template-columns: 1fr; }
}
