/* ─── Mindflow Docs ──────────────────────────────────────────────────────────── */

:root {
  --primary: #6D28D9;
  --primary-hover: #5B21B6;

  --text: #111827;
  --text-secondary: #374151;
  --text-muted: #6B7280;

  --bg: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --bg-code: #1F2937;

  --border: #E5E7EB;
  --border-strong: #D1D5DB;

  --sidebar-width: 240px;
  --header-height: 52px;

  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Fira Code', 'Courier New', monospace;
}

/* ─── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.65; font-size: 15px; overflow-x: hidden; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button { cursor: pointer; font-family: var(--font); }
ul, ol { padding-left: 1.4rem; }
li { margin-bottom: 4px; }

/* ─── Sidebar ────────────────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
}
.sidebar-logo:hover { text-decoration: none; color: var(--primary); }

.sidebar-logo-img {
  width: 30px; height: 30px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 7px;
}

.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.sidebar-logo-accent { color: var(--primary); }

.sidebar-tagline {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  margin-top: 5px;
  margin-bottom: 0;
}

/* kept for fallback / topbar M icon */
.sidebar-logo-icon {
  width: 30px; height: 30px;
  background: var(--primary);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px; font-weight: 800;
  flex-shrink: 0;
}

.sidebar-nav { padding: 12px 8px 20px; flex: 1; overflow-y: auto; }

.sidebar-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 12px 8px 4px;
  display: block;
}

.nav-link {
  display: block;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 13.5px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
  margin-bottom: 1px;
}
.nav-link:hover { background: var(--border); color: var(--text); text-decoration: none; }
.nav-link.active { background: rgba(109,40,217,0.09); color: var(--primary); font-weight: 600; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ─── Topbar ─────────────────────────────────────────────────────────────────── */
#topbar {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  z-index: 100;
}
.topbar-title { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.topbar-home { margin-left: auto; text-decoration: none; display: flex; align-items: center; }
.topbar-home:hover { opacity: 0.7; }
.topbar-logo-img { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; }

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.main-wrapper { margin-left: var(--sidebar-width); min-height: 100vh; }

.content { padding: 36px 48px 80px; }

/* ─── Page header ────────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.breadcrumb { font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--primary); }
.page-intro { font-size: 15px; color: var(--text-muted); line-height: 1.6; margin-top: 6px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ─── Hero ────────────────────────────────────────────────────────────────────── */
.hero {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  padding: 40px 40px 36px;
  margin-bottom: 36px;
}
.hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(109,40,217,0.08);
  border: 1px solid rgba(109,40,217,0.18);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
  letter-spacing: 0.3px;
}
.hero-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.hero-logo { width: 56px; height: 56px; object-fit: contain; border-radius: 14px; flex-shrink: 0; }
.hero-title { font-size: 32px; font-weight: 800; color: var(--text); line-height: 1.1; margin-bottom: 2px; }
.hero-title span { color: var(--primary); }
.hero-tagline { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: 1.2px; text-transform: uppercase; margin: 0; }
.hero-subtitle { font-size: 15px; color: var(--text-secondary); line-height: 1.7; max-width: 600px; margin-bottom: 24px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600;
  padding: 8px 20px; border-radius: 6px;
  text-decoration: none; border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); color: white; }
.btn-outline { background: white; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--bg-secondary); }

/* ─── Stat strip ─────────────────────────────────────────────────────────────── */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 36px;
}
.stat-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px 16px;
  text-align: center;
}
.stat-value { font-size: 24px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ─── Section ────────────────────────────────────────────────────────────────── */
.section { margin-bottom: 36px; }
.section-title { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.section-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

h2 { font-size: 19px; font-weight: 700; color: var(--text); margin: 28px 0 10px; }
h2:first-child { margin-top: 0; }
h3 { font-size: 15px; font-weight: 700; color: var(--text); margin: 20px 0 6px; }
h4 { font-size: 13px; font-weight: 700; color: var(--text); margin: 14px 0 4px; text-transform: uppercase; letter-spacing: 0.4px; }
p { color: var(--text-secondary); font-size: 14.5px; line-height: 1.7; margin-bottom: 12px; }
p:last-child { margin-bottom: 0; }

/* ─── Feature grid ───────────────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 28px;
}
a.feature-card, .feature-card {
  background: var(--bg);
  padding: 20px;
  display: block;
  text-decoration: none;
  color: var(--text);
  transition: background 0.1s;
}
a.feature-card:hover { background: var(--bg-secondary); text-decoration: none; }
.feature-icon { font-size: 20px; margin-bottom: 10px; }
.feature-card h3 { font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 6px; text-transform: none; letter-spacing: 0; }
.feature-card p { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 0; }
.feature-link { font-size: 12.5px; color: var(--primary); margin-top: 10px; display: inline-block; font-weight: 600; }

/* ─── Info cards ─────────────────────────────────────────────────────────────── */
.info-cards { display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 24px; }
.info-card { display: flex; align-items: flex-start; gap: 14px; background: var(--bg); padding: 18px 20px; }
.info-card-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.info-card h4 { font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 3px; text-transform: none; letter-spacing: 0; }
.info-card p { font-size: 13.5px; color: var(--text-muted); margin: 0; }

/* ─── Callouts ───────────────────────────────────────────────────────────────── */
.callout { padding: 12px 16px; border-left: 3px solid; border-radius: 0 5px 5px 0; margin: 16px 0; font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; background: var(--bg-secondary); }
.callout strong { font-weight: 700; color: var(--text); }
.callout a { color: var(--primary); }
.callout-tip     { border-color: var(--primary); }
.callout-info    { border-color: #2563EB; }
.callout-warning { border-color: #D97706; }
.callout-danger  { border-color: #DC2626; }

/* ─── Tags ───────────────────────────────────────────────────────────────────── */
.tag { display: inline-block; padding: 2px 9px; border-radius: 4px; font-size: 11.5px; font-weight: 600; border: 1px solid; }
.tag-purple { color: var(--primary);  background: rgba(109,40,217,0.07); border-color: rgba(109,40,217,0.2); }
.tag-blue   { color: #2563EB;         background: rgba(37,99,235,0.07);  border-color: rgba(37,99,235,0.2); }
.tag-green  { color: #16A34A;         background: rgba(22,163,74,0.07);  border-color: rgba(22,163,74,0.2); }
.tag-red    { color: #DC2626;         background: rgba(220,38,38,0.07);  border-color: rgba(220,38,38,0.2); }
.tag-gray   { color: #4B5563;         background: rgba(75,85,99,0.07);   border-color: rgba(75,85,99,0.2); }

/* ─── Check list ─────────────────────────────────────────────────────────────── */
.check-list { list-style: none; padding: 0; margin: 0 0 16px; }
.check-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--text-secondary); padding: 4px 0; }
.check-list li::before { content: '✓'; color: #16A34A; font-weight: 700; flex-shrink: 0; margin-top: 1px; font-size: 13px; }
.check-list-cross li::before { content: '✕'; color: #DC2626; }

/* ─── Step list ──────────────────────────────────────────────────────────────── */
.step-list { margin: 12px 0 24px; }
.step-item { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.step-item:last-child { border-bottom: none; }
.step-number { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; min-width: 28px; background: var(--primary); color: white; border-radius: 50%; font-size: 12px; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.step-content h4 { font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 4px; text-transform: none; letter-spacing: 0; }
.step-content p { font-size: 13.5px; color: var(--text-secondary); margin: 0; }
.step-content .callout { margin-top: 10px; }
.step-content .tag-list { margin-top: 8px; }

/* ─── Table ──────────────────────────────────────────────────────────────────── */
.doc-table-wrapper { overflow-x: auto; margin: 12px 0 24px; border: 1px solid var(--border); border-radius: 7px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.doc-table th { background: var(--bg-secondary); color: var(--text); font-weight: 700; padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.doc-table td { padding: 9px 14px; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: top; }
.doc-table tr:last-child td { border-bottom: none; }
.doc-table tr:nth-child(even) td { background: var(--bg-secondary); }

/* ─── Doc nav ────────────────────────────────────────────────────────────────── */
.doc-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); gap: 10px; }

/* ─── Code ───────────────────────────────────────────────────────────────────── */
code { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 12.5px; font-family: var(--mono); color: #7C3AED; }
pre { background: var(--bg-code); border-radius: 6px; padding: 18px 20px; overflow-x: auto; margin: 14px 0; position: relative; }
pre code { background: none; border: none; padding: 0; color: #E2E8F0; font-size: 13px; line-height: 1.65; }

/* ─── Overlay ────────────────────────────────────────────────────────────────── */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 150; }
.overlay.visible { display: block; }

/* ─── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */

/* ── Large tablet ── */
@media (max-width: 900px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 24px 28px 60px; }
  .hero { padding: 28px 28px 24px; }
}

/* ── Tablet / mobile ── */
@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .content { padding: 20px 20px 60px; }
  .hamburger { display: flex; }

  /* topbar title truncation */
  .topbar-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .hero { padding: 24px 20px; }
  .hero-title { font-size: 24px; }
  .hero-subtitle { font-size: 14px; max-width: 100%; }

  h2 { font-size: 17px; margin: 22px 0 8px; }
  h3 { font-size: 14px; }

  .feature-grid { grid-template-columns: 1fr; }

  .info-card { flex-direction: column; gap: 8px; }

  .doc-nav { flex-direction: column; align-items: stretch; }
  .doc-nav .btn { text-align: center; justify-content: center; }

  pre { padding: 14px 16px; overflow-x: auto; }
  pre code { font-size: 12.5px; }
}

/* ── Small mobile ── */
@media (max-width: 480px) {
  .content { padding: 16px 16px 60px; }

  .hero { padding: 20px 16px; }
  .hero-brand { gap: 10px; }
  .hero-logo { width: 44px; height: 44px; }
  .hero-title { font-size: 22px; }
  .hero-tagline { font-size: 11px; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { text-align: center; justify-content: center; }

  .page-header h1 { font-size: 22px; }
  h2 { font-size: 16px; }
  h3 { font-size: 13.5px; }
  h4 { font-size: 12.5px; }

  .stat-strip { grid-template-columns: 1fr 1fr; }

  .step-item { gap: 10px; }
  .step-number { width: 24px; height: 24px; min-width: 24px; font-size: 11px; }

  .doc-table th, .doc-table td { padding: 7px 10px; font-size: 12.5px; }

  .callout { font-size: 13px; padding: 10px 13px; }

  .tag { font-size: 11px; padding: 2px 7px; }

  code { font-size: 12px; }

  .check-list li { font-size: 13px; }
  p { font-size: 14px; }
}

/* ── Extra small ── */
@media (max-width: 360px) {
  .content { padding: 12px 12px 60px; }
  .hero { padding: 18px 12px; }
  .hero-title { font-size: 19px; }
  .page-header h1 { font-size: 19px; }
  h2 { font-size: 15px; }
  .stat-strip { grid-template-columns: 1fr; }
  #topbar { padding: 0 14px; }
}
