/* ═══════════════════════════════════════════
   CICD — Documentation Page Styles
   ═══════════════════════════════════════════ */

.docs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  padding-top: 5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ─── Sidebar ─── */
.docs-sidebar {
  position: sticky;
  top: 5rem;
  height: calc(100vh - 5rem);
  overflow-y: auto;
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar-section {
  margin-bottom: 1.5rem;
}
.sidebar-title {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
}
.sidebar-link {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  font-weight: 500;
  border-left: 2px solid transparent;
}
.sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}
.sidebar-link.active {
  color: var(--sakura);
  background: var(--sakura-glow);
  border-left-color: var(--sakura);
}
.sidebar-link.sub {
  padding-left: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─── Content ─── */
.docs-content {
  padding: 2rem 3rem 6rem;
  max-width: 900px;
  min-width: 0;
  overflow-wrap: break-word;
}
.docs-content h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text-primary), var(--sakura));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.docs-content h2 {
  font-size: 1.8rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.docs-content h3 {
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.docs-content h4 {
  font-size: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--sakura);
}
.docs-content p {
  margin-bottom: 1rem;
}
.docs-content ul, .docs-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}
.docs-content li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}
.docs-content pre {
  margin-bottom: 1.5rem;
}
.docs-content table {
  margin-bottom: 1.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* ─── Callout Boxes ─── */
.callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border-left: 3px solid;
  font-size: 0.9rem;
}
.callout-title {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.callout-tip {
  background: rgba(74,222,128,0.06);
  border-color: var(--green);
}
.callout-tip .callout-title { color: var(--green); }
.callout-warn {
  background: rgba(251,191,36,0.06);
  border-color: var(--amber);
}
.callout-warn .callout-title { color: var(--amber); }
.callout-info {
  background: rgba(103,232,249,0.06);
  border-color: var(--cyan);
}
.callout-info .callout-title { color: var(--cyan); }
.callout-danger {
  background: rgba(251,113,133,0.06);
  border-color: var(--rose);
}
.callout-danger .callout-title { color: var(--rose); }

/* ─── Code tabs ─── */
.code-tabs {
  margin-bottom: 1.5rem;
}
.code-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.code-tab-btn {
  padding: 0.6rem 1.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-family: var(--font-heading);
}
.code-tab-btn:hover { color: var(--text-secondary); }
.code-tab-btn.active {
  color: var(--sakura);
  border-bottom-color: var(--sakura);
}
.code-tab-content { display: none; }
.code-tab-content.active { display: block; }
.code-tab-content pre {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: 0;
}

/* ─── Tier diagram ─── */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.tier-card {
  padding: 1.5rem;
  text-align: center;
}
.tier-num {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 0.25rem;
}
.tier-card h4 { margin-bottom: 0.5rem; font-size: 0.9rem; }
.tier-card p { font-size: 0.8rem; }

/* ─── Step blocks ─── */
.step {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: start;
}
.step-num {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--sakura-glow);
  color: var(--sakura);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* ─── Accordion / FAQ ─── */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq-q {
  padding: 1rem 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.02);
  transition: background 0.2s;
  font-size: 0.95rem;
}
.faq-q:hover { background: rgba(255,255,255,0.04); }
.faq-q .arrow {
  transition: transform 0.3s;
  color: var(--text-muted);
}
.faq-item.open .faq-q .arrow { transform: rotate(180deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1);
}
.faq-item.open .faq-a { max-height: 500px; }
.faq-a-inner {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ─── Mobile ─── */
.show-mobile { display: none !important; }

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); }
  .docs-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    height: 100vh;
    z-index: 200;
    background: var(--bg-deep);
    border-right: 1px solid var(--border);
    transition: left 0.3s;
    padding-top: 5rem;
  }
  .docs-sidebar.open { left: 0; }
  .docs-content { padding: 1.5rem 1rem; }
  .docs-content h1 { font-size: 1.8rem; }
  .docs-content h2 { font-size: 1.4rem; margin-top: 2rem; }
  .docs-content h3 { font-size: 1.15rem; }
  .tier-grid { grid-template-columns: minmax(0, 1fr); }
  .step { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .step-num { width: 2rem; height: 2rem; font-size: 0.8rem; }
  .show-mobile { display: block !important; }
  .hide-mobile { display: none !important; }
  #sidebar-overlay.active { display: block !important; }
  
  /* Ensure code and tables are responsive */
  pre { padding: 1rem; font-size: 0.8rem; }
  table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ─── Terminal Mockup ─── */
.terminal-mock {
  background: #020205;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 1.5rem 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 100%;
}
.terminal-header {
  background: rgba(255,255,255,0.03);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.terminal-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
}
.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }
.terminal-title {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 0.5rem;
}
.terminal-body {
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  padding: 1.25rem !important;
  font-size: 0.8rem !important;
  line-height: 1.5 !important;
  color: #a3e635; /* lime green code print */
  overflow-x: auto;
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 900px) {
  .terminal-body {
    font-size: 0.7rem !important;
    padding: 0.75rem !important;
  }
}

/* ─── Code Tabs ─── */
.code-tabs {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 1.5rem 0;
}
.code-tab-nav {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.code-tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.code-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}
.code-tab-btn.active {
  color: var(--sakura);
  border-bottom-color: var(--sakura);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 500;
}
.code-tab-content {
  display: none;
  padding: 0;
}
.code-tab-content.active {
  display: block;
}
.code-tab-content pre {
  margin: 0;
  border: none;
  border-radius: 0;
}

/* ─── File Block Components ─── */
.file-block {
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}
.file-block:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.file-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
}
.file-icon {
  font-size: 0.9rem;
}
.file-name {
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.file-lang {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.file-block pre {
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 1.25rem !important;
}

/* ─── Branded Cherry Blossom Syntax Highlighting Theme (via Highlight.js) ─── */
pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 0;
  background: transparent;
  color: #e4e4e7;
}

.hljs-comment,
.hljs-quote {
  color: var(--text-muted);
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-addition {
  color: var(--cyan);
  font-weight: 600;
}

.hljs-number,
.hljs-string,
.hljs-meta .hljs-string,
.hljs-type,
.hljs-symbol,
.hljs-bullet,
.hljs-class,
.hljs-function {
  color: var(--sakura-light);
}

.hljs-title,
.hljs-section,
.hljs-name,
.hljs-attr {
  color: var(--sakura);
}

.hljs-variable,
.hljs-template-variable,
.hljs-attribute {
  color: var(--amber);
}

.hljs-built_in,
.hljs-selector-attr,
.hljs-selector-id,
.hljs-selector-class {
  color: var(--cyan-dim);
}

.hljs-doctag,
.hljs-type,
.hljs-meta {
  color: var(--rose);
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: bold;
}

/* ─── Global Terminal Look for Code Blocks ─── */
pre:not(.terminal-body):not(.file-block pre):not(.gen-preview pre):not(.gen-output pre):not(.way-card pre) {
  background: #020205 !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
  position: relative !important;
  padding-top: 2.5rem !important; /* Make room for the terminal bar */
  overflow: hidden !important;
}

pre:not(.terminal-body):not(.file-block pre):not(.gen-preview pre):not(.gen-output pre):not(.way-card pre)::before {
  content: "● ● ●" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 1.75rem !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border-bottom: 1px solid var(--border) !important;
  color: #ff5f56 !important; /* Red dot */
  font-size: 0.65rem !important;
  font-family: Arial, sans-serif !important;
  padding-left: 0.75rem !important;
  line-height: 1.75rem !important;
  letter-spacing: 0.15em !important;
  text-shadow: 0.75rem 0 0 #ffbd2e, 1.5rem 0 0 #27c93f !important; /* Yellow & Green dots */
}

/* Exclude file block pre-elements since they have their own explorer bar */
.file-block pre {
  padding-top: 1.25rem !important;
}
.file-block pre::before {
  display: none !important;
}
