/* ========================================
   Steam Manifest Downloader — Documentation
   Additional styles for the docs layout
   ======================================== */

/* --- Page Entrance Animations --- */
@keyframes docsFadeSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes docsFadeSlideRight {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* --- Docs Layout --- */
.docs-layout {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 100px 24px 80px;
  gap: 40px;
}

/* --- Sidebar --- */
.docs-sidebar {
  position: sticky;
  top: 80px;
  width: 260px;
  min-width: 260px;
  height: fit-content;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 20px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(88,166,255,0.2) transparent;
  animation: docsFadeSlideRight 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.05s both;
}

.docs-sidebar::-webkit-scrollbar {
  width: 4px;
}

.docs-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
  background: rgba(88,166,255,0.2);
  border-radius: 2px;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 16px;
  margin-bottom: 8px;
}

.sidebar-links {
  list-style: none;
}

.sidebar-links li a {
  display: block;
  padding: 7px 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  transition: all var(--transition);
  line-height: 1.5;
}

.sidebar-links li a:hover {
  color: var(--text);
  background: rgba(88,166,255,0.04);
}

.sidebar-links li a.active {
  color: var(--blue);
  border-left-color: var(--blue);
  background: rgba(88,166,255,0.06);
}

.sidebar-links li.sub a {
  padding-left: 32px;
  font-size: 0.82rem;
}

/* --- Docs Content --- */
.docs-content {
  flex: 1;
  min-width: 0;
  animation: docsFadeSlideUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both;
}

/* --- Doc Section Card --- */
.doc-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  backdrop-filter: blur(8px);
  margin-bottom: 32px;
  transition: border-color var(--transition);
}

.doc-section:hover {
  border-color: var(--border-hover);
}

.doc-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.doc-section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--text);
}

.doc-section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--blue);
}

.doc-section p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 14px;
}

.doc-section p:last-child {
  margin-bottom: 0;
}

.doc-section ul,
.doc-section ol {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 14px;
  padding-left: 24px;
}

.doc-section li {
  margin-bottom: 6px;
}

.doc-section li strong {
  color: var(--text);
}

.doc-section a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(88,166,255,0.3);
  text-underline-offset: 2px;
}

.doc-section a:hover {
  text-decoration-color: var(--blue);
}

/* --- Section Tag inside doc --- */
.doc-tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 100px;
  background: var(--gradient-bg);
  border: 1px solid var(--border);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* --- Dividers inside sections --- */
.doc-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* --- Code Blocks --- */
.code-block {
  position: relative;
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0 20px;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(22, 27, 34, 0.6);
  border-bottom: 1px solid var(--border);
}

.code-block-lang {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-block-copy {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
}

.code-block-copy:hover {
  background: rgba(88,166,255,0.1);
  color: var(--blue);
  border-color: var(--border-hover);
}

.code-block pre {
  padding: 16px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(88,166,255,0.15) transparent;
}

.code-block pre::-webkit-scrollbar {
  height: 4px;
}

.code-block pre::-webkit-scrollbar-thumb {
  background: rgba(88,166,255,0.15);
  border-radius: 2px;
}

.code-block code {
  font-family: 'Consolas', 'Monaco', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
}

/* Syntax colours */
.code-fn { color: #79c0ff; }
.code-str { color: #a5d6ff; }
.code-num { color: #f2cc60; }
.code-kw { color: #ff7b72; }
.code-cm { color: #8b949e; }
.code-key { color: #d2a8ff; }

/* --- Inline code --- */
.doc-section code:not([class]) {
  background: rgba(88,166,255,0.08);
  border: 1px solid rgba(88,166,255,0.12);
  border-radius: 5px;
  padding: 2px 7px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.84rem;
  color: var(--blue);
}

/* --- Info / Warning / Tip boxes --- */
.doc-callout {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 16px 0 20px;
  border: 1px solid;
}

.doc-callout-icon {
  font-size: 1.2rem;
  line-height: 1.5;
  flex-shrink: 0;
}

.doc-callout p {
  margin: 0;
  font-size: 0.9rem;
}

.doc-callout.info {
  background: rgba(88,166,255,0.06);
  border-color: rgba(88,166,255,0.2);
}

.doc-callout.info .doc-callout-icon { color: var(--blue); }

.doc-callout.warning {
  background: rgba(210,168,15,0.06);
  border-color: rgba(210,168,15,0.2);
}

.doc-callout.warning .doc-callout-icon { color: #d2a80f; }

.doc-callout.tip {
  background: rgba(63,185,80,0.06);
  border-color: rgba(63,185,80,0.2);
}

.doc-callout.tip .doc-callout-icon { color: var(--green); }

.doc-callout.danger {
  background: rgba(248,81,73,0.06);
  border-color: rgba(248,81,73,0.2);
}

.doc-callout.danger .doc-callout-icon { color: #f85149; }

/* --- FAQ --- */
.faq-item {
  padding: 16px 20px;
  background: rgba(13, 17, 23, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: border-color var(--transition);
}

.faq-item:hover {
  border-color: var(--border-hover);
}

.faq-item .faq-q {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.faq-item .faq-q::before {
  content: 'Q';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 5px;
  background: rgba(88,166,255,0.1);
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 700;
}

.faq-item .faq-a {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  padding-left: 30px;
}

.faq-item .faq-a code {
  background: rgba(88,166,255,0.08);
  border: 1px solid rgba(88,166,255,0.12);
  border-radius: 5px;
  padding: 2px 7px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.82rem;
  color: var(--blue);
}

/* --- Mobile Sidebar Toggle --- */
.docs-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gradient);
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(88,166,255,0.3);
  transition: all var(--transition);
  align-items: center;
  justify-content: center;
}

.docs-sidebar-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 32px rgba(88,166,255,0.4);
}

.docs-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--transition);
}

.docs-sidebar-overlay.show {
  opacity: 1;
}

/* --- Responsive Docs --- */
@media (max-width: 900px) {
  .docs-layout {
    padding-top: 80px;
  }

  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    min-width: 280px;
    max-height: 100vh;
    background: rgba(13, 17, 23, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    z-index: 160;
    padding: 80px 0 24px;
    transform: translateX(-100%);
    transition: transform var(--transition);
    animation: none;
  }

  .docs-sidebar.open {
    transform: translateX(0);
  }

  .docs-sidebar-toggle {
    display: flex;
  }

  .docs-sidebar-overlay.show {
    display: block;
  }

  .doc-section {
    padding: 28px 20px;
  }

  .doc-section h2 {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .docs-layout {
    padding: 70px 12px 60px;
  }

  .doc-section {
    padding: 22px 16px;
    border-radius: var(--radius);
  }

  .doc-section h2 {
    font-size: 1.15rem;
  }

  .code-block pre {
    padding: 12px;
  }

  .code-block code {
    font-size: 0.78rem;
  }
}
