/**
 * ScrapeForge Pro Master Stylesheet (Baseline-UI Anti-AI Slop Standards)
 * Clean spatial density, high-contrast dark theme, crisp amber/orange borders,
 * Geist/Inter + JetBrains Mono typography.
 */

:root {
  --bg-app: #090502;
  --bg-surface: #120a05;
  --bg-card: #1c0e06;
  --bg-card-hover: #261308;
  --bg-sidebar: #0a0502;
  --border-color: #2e160a;
  --border-subtle: #241107;
  --text-main: #fef3c7;
  --text-muted: #d97706;
  --text-dim: #92400e;
  --accent-orange: #ea580c;
  --accent-orange-bright: #f97316;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-crimson: #ef4444;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.font-mono { font-family: var(--font-mono); }
.text-orange { color: var(--accent-orange-bright) !important; }
.text-amber { color: var(--accent-amber) !important; }
.text-emerald { color: var(--accent-emerald) !important; }
.text-crimson { color: var(--accent-crimson) !important; }
.font-bold { font-weight: 700; }

.app-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.app-sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  height: 100vh;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.brand-section {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.brand-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.brand-logo-wrap {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.brand-logo-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-orange-bright);
  background: rgba(249, 115, 22, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 2px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 11px;
  color: #a8a29e;
  line-height: 1.4;
}

.sidebar-nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-top: 12px;
  margin-bottom: 6px;
  padding-left: 6px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #a8a29e;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.nav-tab.active {
  background: rgba(234, 88, 12, 0.15);
  border-color: rgba(234, 88, 12, 0.4);
  color: #ffffff;
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.nav-text {
  flex: 1;
}

.nav-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #a8a29e;
}

.sidebar-card {
  background: rgba(234, 88, 12, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  margin-top: auto;
  margin-bottom: 12px;
}

.sidebar-card-title {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--accent-orange-bright);
  margin-bottom: 4px;
}

.sidebar-card-desc {
  font-size: 11px;
  color: #a8a29e;
  line-height: 1.4;
  margin-bottom: 8px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-orange-bright);
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.6);
}

/* Main Workspace */
.app-main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: var(--bg-app);
  overflow: hidden;
}

.top-telemetry-bar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.telemetry-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.telemetry-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 600;
}

.telemetry-value {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.telemetry-divider {
  width: 1px;
  height: 28px;
  background: var(--border-color);
}

.telemetry-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* View Switcher Bar */
.view-switcher-bar {
  background: #150b05;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 24px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  overflow-x: auto;
}

.view-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #a8a29e;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.view-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.view-btn.active {
  background: var(--bg-card);
  border-color: var(--accent-orange-bright);
  color: #ffffff;
}

.content-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* Grids & Cards */
.view-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.section-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.section-desc {
  font-size: 12px;
  color: #a8a29e;
  margin-top: 2px;
}

.card-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.card-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.card-grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.input-group, .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  color: #a8a29e;
}

.form-input, .form-select {
  background: #110702;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 12px;
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-orange-bright);
}

.panel-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-header {
  background: #180d05;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.panel-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #a8a29e;
}

.tag-green { background: rgba(16, 185, 129, 0.15); color: #10b981; }

.code-textarea {
  background: #0d0602;
  color: #fef3c7;
  border: none;
  padding: 14px;
  font-size: 12px;
  line-height: 1.5;
  height: 240px;
  resize: vertical;
  outline: none;
}

.code-output {
  background: #0d0602;
  color: #fef3c7;
  padding: 14px;
  font-size: 12px;
  line-height: 1.5;
  height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-card-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dim);
}

.metric-card-value {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

.metric-card-sub {
  font-size: 10.5px;
  color: #a8a29e;
}

/* Tables */
.table-container-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.table-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  background: #180d05;
}

.table-card-header h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.data-table th {
  background: #180d05;
  color: #a8a29e;
  padding: 10px 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

/* Buttons */
.btn-orange {
  background: var(--accent-orange);
  color: #ffffff;
  border: 1px solid #c2410c;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-orange:hover {
  background: var(--accent-orange-bright);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #572b14;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 10.5px;
}

.badge-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-active { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid #10b981; }
.badge-pending { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid #f59e0b; }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.hidden, .hidden {
  display: none !important;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #180d05;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.modal-close {
  background: transparent;
  border: none;
  color: #a8a29e;
  font-size: 22px;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* =========================================================================
 * DOCUMENTATION & INTERACTIVE FAQ ACCORDION STYLES
 * ========================================================================= */
.doc-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.doc-search-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.doc-search-input {
  flex: 1;
  background: #110702;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 13px;
  outline: none;
}

.doc-search-input:focus {
  border-color: var(--accent-orange-bright);
}

.doc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.doc-card-header {
  background: #180d05;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.doc-card-header h3 {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  line-height: 1.6;
  font-size: 13px;
  color: #e5e5e5;
}

.widget-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.widget-guide-card {
  background: #150a04;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.widget-guide-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-orange-bright);
  display: flex;
  align-items: center;
  gap: 6px;
}

.widget-guide-desc {
  font-size: 12px;
  color: #a8a29e;
  line-height: 1.45;
}

.widget-guide-action {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 10px;
  border-radius: 4px;
  border-left: 3px solid var(--accent-orange);
  color: #fef3c7;
}

/* FAQ Accordion Styles */
.faq-accordion-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: #140a04;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.faq-item:hover {
  border-color: #572b14;
}

.faq-summary {
  padding: 14px 18px;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  list-style: none;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: "＋";
  font-size: 16px;
  color: var(--accent-orange-bright);
  font-weight: bold;
  transition: transform 0.2s ease;
}

details[open] .faq-summary::after {
  content: "－";
  color: var(--accent-amber);
}

details[open] .faq-summary {
  background: #1c0e06;
  border-bottom: 1px solid var(--border-color);
}

.faq-content {
  padding: 16px 18px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #d1d5db;
  background: #0f0703;
}

.faq-content strong {
  color: #ffffff;
}

.faq-content code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: rgba(249, 115, 22, 0.12);
  color: var(--accent-orange-bright);
  padding: 2px 6px;
  border-radius: 4px;
}

