/* ============================================================
   NextNote Documentation — style.css
   Dark default / Light mode toggle
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,300;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ── Tokens ── */
:root {
  --accent:        #FF5E00;
  --accent-dim:    #cc4b00;
  --accent-glow:   rgba(255,94,0,0.18);
  --green:         #34C759;
  --orange:        #FF6B35;
  --red:           #FF3B30;

  /* dark (default) */
  --bg:            #0d0f12;
  --bg-panel:      #13161b;
  --bg-card:       #1a1e26;
  --bg-hover:      #212735;
  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.15);
  --text-primary:  #f0f2f5;
  --text-secondary:#8b93a4;
  --text-muted:    #535c6d;
  --sidebar-width: 260px;
  --header-height: 60px;
  --content-max:   820px;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow:        0 4px 24px rgba(0,0,0,0.5);
  --shadow-card:   0 2px 12px rgba(0,0,0,0.4);
  --font-body:     'DM Sans', sans-serif;
  --font-mono:     'DM Mono', monospace;
  --transition:    0.18s ease;
}

/* ── Light Mode ── */
body.light-mode {
  --bg:            #f4f6f9;
  --bg-panel:      #ffffff;
  --bg-card:       #ffffff;
  --bg-hover:      #eef1f6;
  --border:        rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.15);
  --text-primary:  #111318;
  --text-secondary:#4a5568;
  --text-muted:    #9aa3b0;
  --shadow:        0 4px 24px rgba(0,0,0,0.1);
  --shadow-card:   0 2px 12px rgba(0,0,0,0.08);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.65;
  transition: background var(--transition), color var(--transition);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; border-radius: var(--radius); display: block; }

/* ── Header ── */
.doc-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  z-index: 100;
  backdrop-filter: blur(10px);
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo-img {
  height: 28px;
  width: auto;
}
.header-logo-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.header-logo-text span {
  color: var(--accent);
}
.header-divider {
  width: 1px;
  height: 20px;
  background: var(--border-strong);
  flex-shrink: 0;
}
.header-section-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.header-search {
  flex: 1;
  max-width: 340px;
  margin-left: auto;
}
.search-wrap {
  position: relative;
}
.search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
#search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px 6px 34px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
#search-input::placeholder { color: var(--text-muted); }
#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
  z-index: 200;
}
.search-results.visible { display: block; }
.search-result-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: background var(--transition);
  text-decoration: none;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-hover); }
.search-result-item .result-section {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.search-result-item mark {
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 2px;
}
.search-no-results {
  padding: 16px 14px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Theme toggle */
.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-body);
  transition: border-color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon-dark { display: flex; }
.theme-toggle .icon-light { display: none; }
body.light-mode .theme-toggle .icon-dark { display: none; }
body.light-mode .theme-toggle .icon-light { display: flex; }

/* ── Layout Shell ── */
.doc-shell {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}

/* ── Sidebar ── */
.doc-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 20px 0 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.doc-sidebar::-webkit-scrollbar { width: 4px; }
.doc-sidebar::-webkit-scrollbar-track { background: transparent; }
.doc-sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

.nav-group { margin-bottom: 6px; }
.nav-group-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 14px 18px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 18px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 400;
  border-left: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  cursor: pointer;
}
.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  text-decoration: none;
}
.nav-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-glow);
  font-weight: 500;
}
.nav-item.active svg { opacity: 1; }
.nav-sub-item {
  padding-left: 42px;
  font-size: 0.82rem;
}

/* ── Main Content ── */
.doc-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
}
.doc-content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 36px 40px 80px;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); transition: color var(--transition); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb-sep { opacity: 0.4; }
.breadcrumb-current { color: var(--text-secondary); }

/* ── Page Header ── */
.page-hero {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.page-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(74,144,226,0.3);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.page-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.page-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.6;
  max-width: 600px;
}

/* ── Typography ── */
h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 36px 0 14px;
}
h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 24px 0 10px;
}
h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 20px 0 8px;
}
p { color: var(--text-secondary); margin-bottom: 16px; }
p:last-child { margin-bottom: 0; }
ul, ol {
  color: var(--text-secondary);
  padding-left: 20px;
  margin-bottom: 16px;
}
li { margin-bottom: 6px; }
code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  color: var(--accent);
}
strong { color: var(--text-primary); font-weight: 600; }

/* ── Screenshot Placeholder ── */
.screenshot {
  background: transparent;
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 24px 0;
  box-shadow: none;
}
.screenshot-bar {
  background: var(--bg-hover);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}
.screenshot-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.screenshot-dot.red   { background: #FF5F57; }
.screenshot-dot.amber { background: #FFBD2E; }
.screenshot-dot.green { background: #28C840; }
.screenshot-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 6px;
  font-family: var(--font-mono);
}
.screenshot-body {
  padding: 0;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: transparent;
}
.screenshot-body img {
  width: 100%;
  height: auto;
  border-radius: 0;
  display: block;
  background: transparent;
}
.screenshot-placeholder {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 40px;
  text-align: center;
}
.screenshot-placeholder svg { opacity: 0.3; }
.screenshot-caption {
  padding: 10px 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  font-style: italic;
}

/* ── Cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow); }
.card-icon { font-size: 1.5rem; margin-bottom: 10px; }
.card-title { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); margin-bottom: 5px; }
.card-desc { font-size: 0.82rem; color: var(--text-secondary); }

/* ── Callouts ── */
.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin: 20px 0;
  border: 1px solid;
  font-size: 0.9rem;
}
.callout-icon { flex-shrink: 0; font-size: 1rem; line-height: 1.5; }
.callout-body { color: var(--text-secondary); }
.callout-body strong { color: var(--text-primary); }
.callout.tip    { background: rgba(255,94,0,0.08); border-color: rgba(255,94,0,0.25); }
.callout.note   { background: rgba(52,199,89,0.08);  border-color: rgba(52,199,89,0.25); }
.callout.warn   { background: rgba(255,107,53,0.08); border-color: rgba(255,107,53,0.25); }
.callout.danger { background: rgba(255,59,48,0.08);  border-color: rgba(255,59,48,0.25); }

/* ── Steps ── */
.steps { counter-reset: step; margin: 20px 0; }
.step {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: none; }
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.step-body { flex: 1; }
.step-title { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); margin-bottom: 5px; }
.step-desc { font-size: 0.875rem; color: var(--text-secondary); }

/* ── Feature Row ── */
.feature-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.feature-row:last-child { border-bottom: none; }
.feature-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 1rem;
}
.feature-label { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.feature-desc  { font-size: 0.84rem; color: var(--text-secondary); }

/* ── Toolbar anatomy ── */
.toolbar-doc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
}
.toolbar-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-family: var(--font-body);
  cursor: default;
}
.toolbar-btn svg { color: var(--text-primary); }
.toolbar-btn.active-btn {
  background: var(--accent-glow);
  border-color: rgba(255,94,0,0.4);
  color: var(--accent);
}
.toolbar-btn.active-btn svg { color: var(--accent); }
.toolbar-legend { margin-top: 14px; }
.legend-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
}
.legend-item:last-child { border-bottom: none; }
.legend-key {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.legend-val { color: var(--text-secondary); line-height: 1.5; }

/* ── Badge / pill ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}
.badge.mac  { background: rgba(52,199,89,0.12);  color: #34C759; border: 1px solid rgba(52,199,89,0.3); }
.badge.win  { background: rgba(74,144,226,0.12); color: #4A90E2; border: 1px solid rgba(74,144,226,0.3); }
.badge.both { background: rgba(255,107,53,0.12); color: #FF6B35; border: 1px solid rgba(255,107,53,0.3); }

/* ── Table ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 20px 0;
}
th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-strong);
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

/* ── Footer nav ── */
.page-footer {
  margin-top: 60px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.footer-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  flex: 1;
  max-width: 260px;
}
.footer-nav-link:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow); text-decoration: none; }
.footer-nav-link.next { text-align: right; margin-left: auto; }
.footer-nav-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; }
.footer-nav-title { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); }

/* ── Scrollbar ── */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* ── Responsive ── */
@media (max-width: 820px) {
  .doc-sidebar { transform: translateX(-100%); transition: transform 0.25s ease; z-index: 90; }
  .doc-sidebar.open { transform: translateX(0); }
  .doc-main { margin-left: 0; }
  .doc-content { padding: 24px 20px 60px; }
  .page-title { font-size: 1.5rem; }
  .mobile-menu-btn { display: flex !important; }
  .page-footer { flex-direction: column; }
  .footer-nav-link { max-width: 100%; }
}
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  margin-right: 4px;
}

/* ── Logo theme toggle ── */
.logo-light { display: none; }
.logo-dark { display: block; }
body.light-mode .logo-light { display: block; }
body.light-mode .logo-dark { display: none; }

/* ── Misc ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}
.text-muted { color: var(--text-muted); font-size: 0.875rem; }
.mono { font-family: var(--font-mono); }
.inline-icon { vertical-align: -3px; margin: 0 2px; }
