:root {
  --primary: #003FFE;
  --dark: #0f172a;
  --light: #f8fafc;
  --border: #e5e7eb;
}

/* RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  font-family: Inter, system-ui, sans-serif;
  background: var(--light);
  color: var(--dark);
  scroll-behavior: smooth;
}

img, iframe, table, pre {
  max-width: 100%;
  height: auto;
  display: block;
}

/* HEADER */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #003FFE;
  color: white;
  z-index: 1000;
  transition: all 0.3s ease;
}

.header-large {
  padding: 48px 24px;
}

.header-compact {
  padding: 12px 24px;
  display: none;
}

header.compact .header-large {
  display: none;
}

header.compact .header-compact {
  display: block;
}

header h1 {
  margin: 0;
  font-size: 36px;
}

header p {
  max-width: 800px;
  opacity: 0.95;
}

/* CONTAINER */
.container {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 200px 24px 32px 324px; /* top = header+spacing, left = sidebar width + margin */
  gap: 32px;
  width: 100%;
  transition: padding 0.3s ease;
}

/* SIDEBAR */
aside {
  position: fixed;
  top: 200px; /* header-large height */
  left: 24px;
  width: 320px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  transition: top 0.3s ease, max-height 0.3s ease;
}

header.compact ~ .container aside {
  top: 100px; /* compact header height */
  max-height: calc(100vh - 140px);
}

aside h3 {
  margin-top: 0;
}

aside ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

aside li {
  margin: 20px 0;
}

aside a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 500;
  display: block;
}

aside a:hover {
  color: var(--primary);
}

/* MAIN CONTENT */
main {
  flex: 1;
  min-width: 0;
}

main section {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  margin-bottom: 32px;
  overflow-wrap: break-word;
}

/* TYPOGRAPHY */
h2 {
  border-left: 4px solid var(--primary);
  padding-left: 12px;
}

code {
  background: #f1f5f9;
  padding: 4px 6px;
  border-radius: 6px;
  font-family: monospace;
  word-break: break-word;
}

/* CODE BLOCK */
pre {
  background: #020617;
  color: #e5e7eb;
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 32px;
  font-size: 14px;
  color: #475569;
}

/* SCROLL BUTTON */
#scrollTopBtn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 65px;
  height: 65px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  z-index: 999;
}

#scrollTopBtn svg {
  position: absolute;
  width: 65px;
  height: 65px;
  transform: rotate(-90deg);
}

#progressText {
  position: relative;
  font-size: 14px;
}

/* RESPONSIVE IMAGES / IFRAME */
main img,
main .gap img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 12px;
  margin: 16px 0;
  object-fit: contain;
}

main iframe {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  margin: 16px 0;
}

/* MOBILE RESPONSIVE */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
    padding: 180px 12px 32px 12px;
  }

  aside {
    position: relative;
    width: 100%;
    top: 0;
    max-height: unset;
    margin-bottom: 24px;
  }

  .header-large {
    padding: 32px 16px;
  }

  header h1 {
    font-size: 28px;
  }

  main section {
    padding: 20px;
  }
}

/* ============ PLACEHOLDER HIGHLIGHTING (installation docs) ============ */
/* Highlights any path/value the buyer MUST replace with their own server-specific info */
.placeholder {
  background: #FFF3CD;
  border: 1px dashed #E0A800;
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 600;
  color: #7A5B00;
}
.placeholder-note {
  margin-top: 8px;
  padding: 10px 14px;
  background: #E7F3FF;
  border-left: 5px solid #1E88E5;
  border-radius: 6px;
  font-size: 14px;
  color: #0D3B66;
}
.placeholder-legend {
  margin: 20px 0;
  padding: 16px 20px;
  background: #F5F5F5;
  border: 1px solid #DDD;
  border-radius: 8px;
}
.placeholder-legend h4 { margin: 0 0 8px; color: #333; }
.placeholder-legend table { width: 100%; border-collapse: collapse; font-size: 14px; }
.placeholder-legend td, .placeholder-legend th { padding: 6px 10px; border-bottom: 1px solid #E0E0E0; text-align: left; }