:root {
  --bg: #f6f7fb;
  --sidebar-bg: #111827;
  --sidebar-hover: #1f2937;
  --sidebar-active: #2563eb;
  --text: #1f2937;
  --muted: #6b7280;
  --card: #ffffff;
  --border: #e5e7eb;
  --accent: #2563eb;
  --hero-start: #2563eb;
  --hero-end: #1e40af;
  --code-bg: #f3f4f6;
  --code-text: #111827;
  --tag-bg: #dbeafe;
  --tag-text: #1e40af;
  --topbar-bg: #ffffff;
}

body[data-theme="dark"] {
  --bg: #0f172a;
  --sidebar-bg: #020617;
  --sidebar-hover: #1e293b;
  --sidebar-active: #3b82f6;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --card: #111827;
  --border: #334155;
  --accent: #3b82f6;
  --hero-start: #1e3a8a;
  --hero-end: #0f172a;
  --code-bg: #020617;
  --code-text: #e5e7eb;
  --tag-bg: #1e3a8a;
  --tag-text: #dbeafe;
  --topbar-bg: #111827;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.25s ease, color 0.25s ease;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  color: white;
  padding: 24px 18px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  transition: transform 0.3s ease, background 0.25s ease;
  z-index: 1000;
}

.sidebar h1 {
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.sidebar p {
  font-size: 0.9rem;
  color: #cbd5e1;
  margin-bottom: 22px;
}

.search-box {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  outline: none;
  margin-bottom: 14px;
  font-size: 0.95rem;
  background: #ffffff;
  color: #111827;
}

body[data-theme="dark"] .search-box {
  background: #1e293b;
  color: #e5e7eb;
}

body[data-theme="dark"] .search-box::placeholder {
  color: #94a3b8;
}

.theme-toggle {
  background: transparent;
  color: #e5e7eb;
  border: 1px solid #374151;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  width: 100%;
  margin-bottom: 18px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  background: var(--sidebar-hover);
  border-color: #6b7280;
}

.menu {
  list-style: none;
}

.menu li {
  margin-bottom: 8px;
}

.menu a {
  display: block;
  color: #e5e7eb;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
  font-size: 0.95rem;
}

.menu a:hover {
  background: var(--sidebar-hover);
  color: white;
}

.menu a.active {
  background: var(--sidebar-active);
  color: white;
  font-weight: bold;
}

/* Main content */
.content {
  margin-left: 280px;
  padding: 36px;
  width: calc(100% - 280px);
}

.topbar {
  display: none;
  background: var(--topbar-bg);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  position: sticky;
  top: 0;
  z-index: 900;
  transition: background 0.25s ease, color 0.25s ease;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.topbar .theme-toggle {
  width: auto;
  margin-bottom: 0;
  color: var(--text);
  border-color: var(--border);
  padding: 10px 12px;
  white-space: nowrap;
}

.menu-button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}

.hero {
  background: linear-gradient(135deg, var(--hero-start), var(--hero-end));
  color: white;
  padding: 36px;
  border-radius: 16px;
  margin-bottom: 28px;
  transition: background 0.25s ease;
}

.hero h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.hero p {
  color: #dbeafe;
  max-width: 760px;
}

.guide {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.guide h2 {
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.guide h3 {
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

.guide p {
  margin-bottom: 12px;
  color: var(--text);
}

.guide ul {
  margin-left: 20px;
  margin-bottom: 12px;
}

.guide code {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.9rem;
}

.guide pre {
  background: #f3f4f6;
  color: #111827;
  padding: 16px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 14px 0;
}

body[data-theme="dark"] .guide pre {
  background: #020617;
  border: 1px solid var(--border);
}

.tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.overlay {
  display: none;
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .content {
    margin-left: 0;
    width: 100%;
    padding: 22px;
  }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .overlay.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(100, 100, 100, 0.45);
    z-index: 950;
  }

  .hero {
    padding: 26px;
  }

  .hero h2 {
    font-size: 1.6rem;
  }
}

@media (max-width: 520px) {
  .content {
    padding: 16px;
  }

  .guide {
    padding: 20px;
  }

  .sidebar {
    width: 82%;
  }

  .topbar .theme-toggle {
    font-size: 0.9rem;
    padding: 9px 10px;
  }

  .menu-button {
    padding: 9px 11px;
  }
}

.center-image {
  text-align: left;
  margin: 24px 0;
}

.center-image img {
  max-width: 80%;
  height: auto;
  border-radius: 8px;
}

.big-image {
  width: 90%;
  max-width: 900px;
  height: auto;
}

.video-wrapper {
  max-width: 900px;
  margin: 24px auto;
  aspect-ratio: 16 / 9;
}

.video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
}

.ports-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 1.5rem 0;
  }

  .ports-table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
    font-size: 0.95rem;
    background-color: #ffffff;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    overflow: hidden;
  }

  .ports-table thead {
    background-color: #1f2937;
    color: #ffffff;
  }

  .ports-table th,
  .ports-table td {
    padding: 0.9rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #e5e7eb;
  }

  .ports-table th {
    font-weight: 600;
    white-space: nowrap;
  }

  .ports-table tbody tr:nth-child(even) {
    background-color: #f9fafb;
  }

  .ports-table tbody tr:hover {
    background-color: #eef2ff;
  }

  .ports-table code {
    background-color: #f3f4f6;
    color: #111827;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .tool-name {
    font-weight: 600;
    color: #111827;
  }

  .port-badge {
    display: inline-block;
    background-color: #e0f2fe;
    color: #075985;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.1rem 0;
    white-space: nowrap;
  }

   .supporting-services {
      max-width: 1100px;
      margin: 0 auto;
      padding: 2rem 1rem;
      font-family: Arial, Helvetica, sans-serif;
      line-height: 1.6;
      color: #1f2937;
    }

    .supporting-services h2,
    .supporting-services h3 {
      color: #111827;
      margin-top: 2rem;
      margin-bottom: 0.8rem;
    }

    .supporting-services p {
      margin-bottom: 1rem;
    }

    .supporting-services code {
      background-color: #f3f4f6;
      color: #111827;
      padding: 0.15rem 0.35rem;
      border-radius: 4px;
      font-size: 0.92em;
    }

    .supporting-services pre {
      background-color: #111827;
      color: #e5e7eb;
      padding: 1rem;
      border-radius: 10px;
      overflow-x: auto;
      border: 1px solid #374151;
      margin: 1rem 0 1.5rem 0;
    }

    .supporting-services pre code {
      background: transparent;
      color: inherit;
      padding: 0;
      border-radius: 0;
      font-size: 0.9rem;
      white-space: pre;
    }

    .service-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 0.75rem;
      padding: 0;
      list-style: none;
      margin: 1.2rem 0;
    }

    .service-list li {
      background-color: #f9fafb;
      border: 1px solid #e5e7eb;
      border-left: 4px solid #2563eb;
      border-radius: 8px;
      padding: 0.8rem 1rem;
      font-weight: 600;
    }

    .pipeline {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.6rem;
      margin: 1.5rem 0;
      padding: 1rem;
      background-color: #f8fafc;
      border: 1px solid #e5e7eb;
      border-radius: 10px;
    }

    .pipeline-step {
      background-color: #ffffff;
      border: 1px solid #d1d5db;
      border-radius: 999px;
      padding: 0.45rem 0.8rem;
      font-weight: 600;
      white-space: nowrap;
    }

    .pipeline-arrow {
      color: #6b7280;
      font-weight: 700;
    }

    .ports-table-wrapper {
      width: 100%;
      overflow-x: auto;
      margin: 1.5rem 0;
      border-radius: 12px;
      border: 1px solid #d1d5db;
    }

    .ports-table {
      width: 100%;
      min-width: 900px;
      border-collapse: collapse;
      background-color: #ffffff;
      font-size: 0.95rem;
    }

    .ports-table thead {
      background-color: #111827;
      color: #ffffff;
    }

    .ports-table th,
    .ports-table td {
      padding: 0.9rem 1rem;
      text-align: left;
      vertical-align: top;
      border-bottom: 1px solid #e5e7eb;
    }

    .ports-table th {
      font-weight: 700;
      white-space: nowrap;
    }

    .ports-table tbody tr:nth-child(even) {
      background-color: #f9fafb;
    }

    .ports-table tbody tr:hover {
      background-color: #eef2ff;
    }

    .tool-name {
      font-weight: 700;
      color: #111827;
    }

    .port-badge {
      display: inline-block;
      background-color: #dbeafe;
      color: #1e40af;
      padding: 0.2rem 0.55rem;
      border-radius: 999px;
      font-size: 0.85rem;
      font-weight: 700;
      margin: 0.12rem 0;
      white-space: nowrap;
    }

    .optional-badge {
      background-color: #fef3c7;
      color: #92400e;
    }

    .note {
      background-color: #fffbeb;
      border: 1px solid #facc15;
      border-left: 5px solid #f59e0b;
      border-radius: 8px;
      padding: 1rem;
      margin: 1rem 0;
    }

    .source-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #2185d0;
  border-radius: 8px;
  background: #2185d0;
  color: #ffffff;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.source-download-button::before {
  content: "</>";
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.source-download-button:hover,
.source-download-button:focus-visible {
  background: #1769aa;
  border-color: #1769aa;
  color: #ffffff;
  transform: translateY(-1px);
}

.source-download-button:focus-visible {
  outline: 3px solid rgba(33, 133, 208, 0.35);
  outline-offset: 3px;
}
