/* BuildBotsBetter Guided Build — Onboarding an AI Agent */
:root {
  --bg-primary: #0a0f1d;
  --bg-secondary: #111827;
  --bg-surface: #1f2937;
  --bg-card: #182234;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(61, 139, 253, 0.4);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */
.build-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.75rem 1.5rem;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: #fff;
}

.course-badge {
  font-size: 0.75rem;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.run-later-btn {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.run-later-btn:hover {
  background: var(--border);
  text-decoration: none;
}

/* Progress bar */
.progress-bar-container {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  width: 100%;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 7%;
  transition: width 0.3s ease;
}

/* Main Layout */
.layout-container {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.75rem;
}

@media (max-width: 900px) {
  .layout-container {
    grid-template-columns: 1fr;
  }
  .sidebar-nav {
    display: none;
  }
}

/* Sidebar navigation */
.sidebar-nav {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  height: fit-content;
}

.nav-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-item-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.nav-item-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-item-btn.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
  font-weight: 600;
}

.nav-item-btn.completed .step-dot {
  background: var(--success);
  border-color: var(--success);
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--text-dim);
  flex-shrink: 0;
}

/* Content Area */
.content-area {
  min-width: 0;
}

.step-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.step-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.step-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.lesson-tag {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.step-counter {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.step-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

/* Bot Coach Box */
.bot-coach-card {
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.bot-avatar {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.bot-content {
  flex: 1;
}

.bot-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.bot-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
}

.bot-role {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.bot-bubble {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.5;
}

/* Action Section */
.action-box {
  background: var(--bg-surface);
  border-left: 4px solid var(--accent);
  padding: 1.25rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1.5rem;
}

.action-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.action-instruction {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.75rem;
}

/* Code Blocks */
.code-wrapper {
  position: relative;
  margin: 1rem 0;
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-dim);
}

pre {
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.5;
  color: #e6edf3;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Checkpoints */
.checkpoint-card {
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.checkpoint-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--success);
  font-weight: 600;
  font-size: 0.9rem;
}

.checkpoint-desc {
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.checkpoint-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.verify-btn {
  background: var(--success);
  color: #064e3b;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.verify-btn:hover {
  opacity: 0.9;
}

.verify-status {
  font-size: 0.85rem;
  font-weight: 500;
}

.verify-status.passed {
  color: var(--success);
}

/* Troubleshooting accordion */
.troubleshooting-details {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
}

.troubleshooting-summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.troubleshooting-summary:hover {
  color: var(--text-main);
}

.troubleshooting-content {
  padding: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

/* Navigation footer */
.step-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.nav-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.nav-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.nav-btn.primary:hover {
  background: var(--accent-hover);
}

/* Run Later View (#run) */
.run-later-view {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem;
  display: none;
}

.run-later-view.active {
  display: block;
}

.run-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
}

.run-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.run-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.run-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
}

.run-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Build Bot Better Section */
.bbb-safety-alert {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  padding: 1.25rem;
  margin-top: 2rem;
}

.bbb-safety-alert h4 {
  color: #f87171;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

/* Step FAQs Accordion Section */
.step-faq-drawer {
  margin-top: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.step-faq-heading {
  font-size: 0.95rem;
  font-weight: 600;
  color: #93c5fd;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.faq-accordion-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.6rem 0;
}

.faq-accordion-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.faq-question {
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.faq-question:hover {
  color: #60a5fa;
}

.faq-answer {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--accent);
  line-height: 1.5;
}

/* Ask Orbit Floating Action Button & Panel */
.ask-orbit-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: 0.65rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ask-orbit-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.6);
}

.ask-orbit-panel {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 120px);
  background: var(--bg-secondary);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

.orbit-panel-header {
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.orbit-panel-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.orbit-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.3rem;
}

.orbit-close-btn:hover {
  color: #fff;
}

.orbit-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.orbit-msg {
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.45;
  max-width: 90%;
}

.orbit-msg.bot {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  align-self: flex-start;
}

.orbit-msg.user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
}

.orbit-quick-qs {
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.quick-q-btn {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  border-radius: 9999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  text-align: left;
}

.quick-q-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #fff;
}

.orbit-input-box {
  padding: 0.65rem 0.75rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
}

.orbit-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  color: #fff;
  font-size: 0.85rem;
  font-family: inherit;
}

.orbit-input:focus {
  border-color: var(--accent);
  outline: none;
}

.orbit-send-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.orbit-send-btn:hover {
  background: var(--accent-hover);
}


/* Checkpoint Green Checkmark on Menu Items (Right-aligned) */
.nav-item a,
.step-nav-item,
.step-nav-btn,
.nav-item-btn,
.nav-link {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  position: relative !important;
}

.nav-item.completed a::after,
.step-nav-item.completed::after,
.step-nav-btn.completed::after,
.nav-item-btn.completed::after,
.nav-link.completed::after {
  content: " \2713" !important;
  margin-left: auto !important;
  color: #22c55e !important;
  font-weight: 800 !important;
  font-size: 1.15rem !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
}
