/* EZLaunch Docs — Design System */

:root {
  --primary: #6366F1;
  --dark: #1E1B4B;
  --gray: #6B7280;
  --light-bg: #F8F8FC;
  --white: #FFFFFF;
  --sidebar-width: 260px;
  --topbar-height: 40px;
  --code-bg: #0F0E17;
  --text: #1E1B4B;
  --border: #E5E7EB;
  --sidebar-muted: #CBD5E1;
  --sidebar-header: #A5B4FC;
}

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

html {
  scroll-behavior: smooth;
  font-size: 17px;
}

body {
  font-family: 'Urbanist', system-ui, sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
  overflow-x: hidden;
}

/* Top bar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: var(--dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 200;
}

.topbar a {
  color: var(--sidebar-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}

.topbar a:hover {
  color: var(--white);
}

.version-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--sidebar-header);
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  position: fixed;
  top: calc(var(--topbar-height) + 12px);
  left: 12px;
  z-index: 250;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--dark);
  color: var(--white);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(30, 27, 75, 0.3);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  position: relative;
  transition: background 0.2s;
}

.menu-toggle span::before,
.menu-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s;
}

.menu-toggle span::before {
  top: -6px;
}

.menu-toggle span::after {
  top: 6px;
}

.menu-toggle[aria-expanded="true"] span {
  background: transparent;
}

.menu-toggle[aria-expanded="true"] span::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span::after {
  top: 0;
  transform: rotate(-45deg);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--topbar-height);
  background: rgba(15, 14, 23, 0.5);
  z-index: 140;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.sidebar-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--topbar-height));
  background: var(--dark);
  color: var(--white);
  overflow-y: auto;
  z-index: 150;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

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

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 16px;
}

.sidebar-brand img {
  height: 28px;
  width: auto;
}

.sidebar-brand .docs-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--sidebar-header);
  letter-spacing: 0.5px;
}

.search-wrap {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 80px 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--white);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.search-input:focus {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(255, 255, 255, 0.12);
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  letter-spacing: 0.02em;
}

/* Nav */
.sidebar-nav {
  padding: 12px 0 24px;
  flex: 1;
}

.nav-group {
  margin-bottom: 4px;
}

.nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--sidebar-header);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  text-align: left;
}

.nav-group-toggle:hover {
  color: var(--white);
}

.nav-group-toggle .chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
  opacity: 0.7;
}

.nav-group.collapsed .nav-group-toggle .chevron {
  transform: rotate(-90deg);
}

.nav-group.collapsed .nav-links {
  display: none;
}

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

.nav-links a {
  display: block;
  padding: 8px 20px 8px 23px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sidebar-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.nav-links a:hover {
  color: var(--white);
}

.nav-links a.active {
  color: var(--white);
  background: rgba(99, 102, 241, 0.15);
  border-left-color: var(--primary);
}

/* Main content */
.main {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  min-height: calc(100vh - var(--topbar-height));
  background: var(--white);
}

.content {
  max-width: 800px;
  padding: 60px;
}

.content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--light-bg);
  letter-spacing: -0.02em;
}

.content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark);
  margin-top: 3rem;
  margin-bottom: 1rem;
  scroll-margin-top: calc(var(--topbar-height) + 24px);
  letter-spacing: -0.01em;
}

.content h2:first-of-type {
  margin-top: 0;
}

.content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: calc(var(--topbar-height) + 24px);
}

.content p {
  font-size: 1.05rem;
  color: var(--gray);
  margin-bottom: 1rem;
}

.content ul,
.content ol {
  font-size: 1.05rem;
  color: var(--gray);
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.content li {
  margin-bottom: 0.5rem;
}

.content li strong {
  color: var(--dark);
  font-weight: 600;
}

.content a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

.content a:hover {
  text-decoration: underline;
}

.content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* Checklist */
.checklist {
  list-style: none;
  padding-left: 0;
  margin: 1.25rem 0 1.5rem;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
  border-radius: 8px;
  font-size: 1.05rem;
}

.checklist li.yes {
  background: #EEF2FF;
  color: var(--dark);
}

.checklist li.no {
  background: #FEF2F2;
  color: #991B1B;
}

.checklist .icon {
  font-weight: 700;
  flex-shrink: 0;
  width: 20px;
}

.checklist li.yes .icon {
  color: var(--primary);
}

.checklist li.no .icon {
  color: #EF4444;
}

/* Steps */
.steps {
  list-style: none;
  padding-left: 0;
  counter-reset: step;
  margin: 1.5rem 0;
}

.steps > li {
  position: relative;
  padding-left: 48px;
  margin-bottom: 1.25rem;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  font-size: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.option-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  background: #EEF2FF;
  padding: 4px 10px;
  border-radius: 6px;
  margin: 2rem 0 1rem;
}

/* File trees */
.file-tree {
  background: var(--light-bg);
  border-radius: 10px;
  padding: 20px 24px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.7;
  color: var(--dark);
  margin: 1rem 0 1.5rem;
  overflow-x: auto;
}

.file-tree.correct {
  border-left: 4px solid #22C55E;
}

.file-tree.wrong {
  border-left: 4px solid #EF4444;
}

.file-tree-label {
  font-family: 'Urbanist', sans-serif;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-tree-label.ok {
  color: #16A34A;
}

.file-tree-label.bad {
  color: #DC2626;
}

/* Code blocks */
.code-block {
  position: relative;
  margin: 1.25rem 0 1.5rem;
  border-radius: 10px;
  overflow: hidden;
}

.code-block pre {
  background: var(--code-bg);
  border-radius: 10px;
  padding: 20px;
  padding-right: 56px;
  overflow-x: auto;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #E2E8F0;
}

.code-block code {
  font-family: inherit;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  font-family: 'Urbanist', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #E2E8F0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.copy-btn.copied {
  color: #A5B4FC;
  border-color: var(--primary);
}

/* Syntax highlighting */
.hljs-string,
.code-block .str {
  color: #A5B4FC;
}

.hljs-keyword,
.code-block .kw {
  color: #6366F1;
}

.hljs-comment,
.code-block .cmt {
  color: #4B5563;
}

.hljs-built_in,
.code-block .fn {
  color: #818CF8;
}

/* Inline code */
.content code:not(pre code) {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.9em;
  background: var(--light-bg);
  color: var(--dark);
  padding: 2px 8px;
  border-radius: 5px;
  font-weight: 500;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

table th {
  background: var(--light-bg);
  font-weight: 600;
  color: var(--dark);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

table td {
  padding: 12px 16px;
  color: var(--gray);
  border-bottom: 1px solid var(--border);
}

table tbody tr:nth-child(even) {
  background: #FAFAFE;
}

table tbody tr:last-child td {
  border-bottom: none;
}

/* Callouts */
.callout {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 1.25rem 0;
  font-size: 1.02rem;
  line-height: 1.6;
}

.callout strong {
  font-weight: 700;
}

.callout.note {
  background: #EEF2FF;
  border-left: 4px solid var(--primary);
  color: var(--dark);
}

.callout.warning {
  background: #FEF3C7;
  border-left: 4px solid #F59E0B;
  color: #78350F;
}

.callout p {
  margin: 0;
  color: inherit;
}

.callout p + p {
  margin-top: 0.5rem;
}

/* Footer */
.content-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 15px;
  color: var(--gray);
}

.content-footer a {
  color: var(--primary);
}

/* Mobile */
@media (max-width: 767px) {
  .menu-toggle {
    display: flex;
  }

  .sidebar-overlay {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  }

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

  .main {
    margin-left: 0;
  }

  .content {
    padding: 48px 24px 48px 24px;
    padding-top: 72px;
  }

  .content h1 {
    font-size: 2rem;
  }

  .content h2 {
    font-size: 1.5rem;
  }
}
