/* ==========================================================================
   Muslim.GenericRepository 10.0.1 — Professional Documentation Design System
   Modern Developer Experience | UI/UX Redesign
   ========================================================================== */

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

/* --- Design Tokens --- */
:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  /* Color Palette - Light Theme */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-secondary: #f1f5f9;
  --bg-subtle: #f8fafc;
  --bg-hover: #f1f5f9;
  --bg-active: #e2e8f0;

  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #6366f1;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-faint: #94a3b8;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: rgba(79, 70, 229, 0.08);
  --primary-border: rgba(79, 70, 229, 0.2);

  --accent-cyan: #0284c7;
  --accent-cyan-light: rgba(2, 132, 199, 0.08);
  --accent-emerald: #059669;
  --accent-emerald-light: rgba(5, 150, 105, 0.08);
  --accent-amber: #d97706;
  --accent-amber-light: rgba(217, 119, 6, 0.08);
  --accent-rose: #e11d48;
  --accent-rose-light: rgba(225, 29, 72, 0.08);
  --accent-purple: #7c3aed;
  --accent-purple-light: rgba(124, 58, 237, 0.08);

  --code-bg: #0d1117;
  --code-header-bg: #161b22;
  --code-text: #e6edf3;
  --code-border: #30363d;

  --sidebar-width: 290px;
  --toc-width: 240px;
  --header-height: 4.25rem;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Tokens */
body[data-theme='dark'] {
  --bg-page: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #162032;
  --bg-surface-secondary: #1a2436;
  --bg-subtle: #0f1623;
  --bg-hover: #1e293b;
  --bg-active: #27354a;

  --border-subtle: #1e293b;
  --border-strong: #334155;
  --border-focus: #818cf8;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-faint: #64748b;

  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-light: rgba(99, 102, 241, 0.15);
  --primary-border: rgba(99, 102, 241, 0.3);

  --accent-cyan: #38bdf8;
  --accent-cyan-light: rgba(56, 189, 248, 0.15);
  --accent-emerald: #34d399;
  --accent-emerald-light: rgba(52, 211, 153, 0.15);
  --accent-amber: #fbbf24;
  --accent-amber-light: rgba(251, 191, 36, 0.15);
  --accent-rose: #fb7185;
  --accent-rose-light: rgba(251, 113, 133, 0.15);
  --accent-purple: #c084fc;
  --accent-purple-light: rgba(192, 132, 252, 0.15);

  --code-bg: #0a0d14;
  --code-header-bg: #121824;
  --code-text: #f0f6fc;
  --code-border: #232d3f;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

/* --- Base & Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1.5rem);
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.65;
  font-size: 0.965rem;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Ambient glow effect at top */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 20%;
  width: 60%;
  height: 380px;
  background: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.08) 0%, rgba(56, 189, 248, 0.04) 50%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

/* Reading Progress Bar */
#readingProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #38bdf8, #10b981);
  z-index: 100;
  transition: width 0.1s ease-out;
}

/* --- Top Navigation Bar --- */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 2rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

body[data-theme='dark'] .top-bar {
  background: rgba(11, 15, 25, 0.85);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
  flex-shrink: 0;
}

.brand-logo svg {
  width: 1.4rem;
  height: 1.4rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

.brand-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.version-pill .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  animation: pulse-ring 2s infinite ease-in-out;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Search Trigger Button */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 2.4rem;
  padding: 0 1rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.search-trigger:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.search-trigger svg {
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
}

.search-trigger kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  box-shadow: 0 1px 1px rgba(0,0,0,0.06);
}

/* Nav links in header */
.header-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.3rem;
  padding: 0 0.85rem;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.header-link-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.header-link-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
}

/* --- Layout Framework --- */
.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--toc-width);
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* --- Left Sidebar Navigation --- */
.sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 1.75rem 1.25rem 3rem 1.75rem;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.sidebar-search-box {
  position: relative;
  margin-bottom: 1.5rem;
}

.sidebar-search-input {
  width: 100%;
  height: 2.3rem;
  padding: 0 0.8rem 0 2.2rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.sidebar-search-input:focus {
  border-color: var(--border-focus);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.sidebar-search-box svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.95rem;
  height: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
}

.sidebar-group {
  margin-bottom: 1.6rem;
}

.sidebar-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}

.sidebar-group-count {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  background: var(--bg-surface-secondary);
  color: var(--text-faint);
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius-full);
}

.sidebar-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.sidebar-nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  transform: translateX(2px);
}

.sidebar-nav-link.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
}

.sidebar-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.sidebar-nav-link .nav-pill {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--bg-surface-secondary);
  color: var(--text-muted);
}

.sidebar-nav-link.active .nav-pill {
  background: var(--primary);
  color: #fff;
}

/* --- Main Content Area --- */
.content-wrapper {
  padding: 2.5rem 3.5rem 6rem;
  max-width: 960px;
  min-width: 0;
}

/* Hero Section */
.hero-banner {
  background: linear-gradient(145deg, var(--bg-surface) 0%, var(--bg-subtle) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  color: var(--text-primary);
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, #4f46e5 20%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 1.75rem;
  max-width: 720px;
}

.hero-quick-install {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--code-border);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  max-width: fit-content;
  box-shadow: var(--shadow-sm);
}

.hero-quick-install .cmd-prompt {
  color: #38bdf8;
  user-select: none;
}

.hero-quick-install code {
  color: #f1f5f9;
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
}

.hero-quick-install button {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}

.hero-quick-install button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.hero-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.hero-feature-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.hero-feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.hero-feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.hero-feature-icon.primary { background: var(--primary-light); color: var(--primary); }
.hero-feature-icon.cyan { background: var(--accent-cyan-light); color: var(--accent-cyan); }
.hero-feature-icon.emerald { background: var(--accent-emerald-light); color: var(--accent-emerald); }
.hero-feature-icon.purple { background: var(--accent-purple-light); color: var(--accent-purple); }

.hero-feature-text h4 {
  margin: 0 0 0.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hero-feature-text p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --- Documentation Section Cards --- */
.doc-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.doc-section:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.doc-section-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.doc-section-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.doc-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.05em;
}

.doc-section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-anchor {
  color: var(--text-faint);
  text-decoration: none;
  font-weight: 400;
  opacity: 0;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.doc-section:hover .section-anchor {
  opacity: 1;
}

.section-anchor:hover {
  color: var(--primary);
}

.doc-section p {
  color: var(--text-secondary);
  font-size: 0.98rem;
  margin: 0 0 1.25rem;
  line-height: 1.7;
}

.doc-section p:last-child {
  margin-bottom: 0;
}

/* --- API Method Cards --- */
.method-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.75rem 0;
  transition: all var(--transition-fast);
}

.method-card:hover {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.method-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.method-card h3 {
  font-size: 1.05rem;
  font-family: var(--font-mono);
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  word-break: break-all;
}

.method-card h3.plain {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 700;
}

.method-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-async { background: var(--accent-cyan-light); color: var(--accent-cyan); border: 1px solid rgba(56, 189, 248, 0.25); }
.badge-sync { background: var(--bg-surface-secondary); color: var(--text-muted); border: 1px solid var(--border-subtle); }
.badge-bulk { background: var(--accent-purple-light); color: var(--accent-purple); border: 1px solid rgba(192, 132, 252, 0.25); }
.badge-dto { background: var(--accent-emerald-light); color: var(--accent-emerald); border: 1px solid rgba(52, 211, 153, 0.25); }
.badge-write { background: var(--accent-rose-light); color: var(--accent-rose); border: 1px solid rgba(251, 113, 133, 0.25); }
.badge-new { background: var(--accent-amber-light); color: var(--accent-amber); border: 1px solid rgba(251, 191, 36, 0.25); }

/* --- Code Blocks with Modern Mac / VS Code Style --- */
.code-block-wrapper {
  margin: 1.25rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--code-border);
  box-shadow: var(--shadow-sm);
  background: var(--code-bg);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: var(--code-header-bg);
  border-bottom: 1px solid var(--code-border);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: #8b949e;
}

.code-lang-tag {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.code-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  background: transparent;
  color: #8b949e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f0f6fc;
  border-color: rgba(255, 255, 255, 0.2);
}

.code-copy-btn.copied {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

pre {
  margin: 0;
  padding: 1.15rem 1.25rem;
  background: var(--code-bg);
  color: var(--code-text);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  tab-size: 4;
}

pre code {
  font-family: inherit;
  font-size: inherit;
  display: block;
  white-space: pre;
}

/* Inline code style */
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-surface-secondary);
  color: var(--primary);
  border: 1px solid var(--border-subtle);
}

/* Syntax Highlighting Tokens */
.token-keyword { color: #f472b6; font-weight: 600; }
.token-type { color: #38bdf8; font-weight: 500; }
.token-string { color: #fde047; }
.token-comment { color: #64748b; font-style: italic; }
.token-method { color: #6ee7b7; }
.token-number { color: #fb923c; }
.token-operator { color: #94a3b8; }
.token-attribute { color: #c084fc; }

/* --- Tabbed Code Panels (Interactive) --- */
.tab-container {
  margin: 1.5rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
}

.tab-nav {
  display: flex;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  padding: 0 0.5rem;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
  background: var(--bg-surface);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.tab-pane .code-block-wrapper {
  margin: 0;
  border: none;
  border-radius: 0;
}

/* --- Callouts & Alerts --- */
.callout {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.15rem 1.35rem;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  color: var(--text-primary);
  font-size: 0.94rem;
  line-height: 1.6;
}

.callout.warn {
  border-left-color: var(--accent-amber);
  background: var(--accent-amber-light);
}

.callout.info {
  border-left-color: var(--accent-cyan);
  background: var(--accent-cyan-light);
}

.callout.danger {
  border-left-color: var(--accent-rose);
  background: var(--accent-rose-light);
}

.callout-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
}

.callout.warn .callout-icon { color: var(--accent-amber); }
.callout.info .callout-icon { color: var(--accent-cyan); }
.callout.danger .callout-icon { color: var(--accent-rose); }
.callout:not(.warn):not(.info):not(.danger) .callout-icon { color: var(--primary); }

.callout-content {
  flex: 1;
}

.callout-content p {
  margin: 0;
}

/* --- Tables & Data Grids --- */
.table-wrap {
  margin: 1.5rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

thead {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

th {
  padding: 0.85rem 1.15rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

td {
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  line-height: 1.5;
}

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

tbody tr:hover {
  background: var(--bg-hover);
}

td code {
  font-size: 0.85em;
}

/* --- Changelog Modern Card (What's New) --- */
.changelog-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.25rem 0;
  background: var(--bg-subtle);
}

.changelog-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.85rem;
}

.changelog-badge-tag.fixed { background: var(--accent-amber-light); color: var(--accent-amber); border: 1px solid rgba(217, 119, 6, 0.2); }
.changelog-badge-tag.added { background: var(--accent-emerald-light); color: var(--accent-emerald); border: 1px solid rgba(5, 150, 105, 0.2); }
.changelog-badge-tag.interface { background: var(--accent-cyan-light); color: var(--accent-cyan); border: 1px solid rgba(2, 132, 199, 0.2); }

/* --- Packages Grid (Related Packages) --- */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.15rem;
  margin-top: 1.5rem;
}

.package-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.package-card:hover {
  background: var(--bg-surface);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.package-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.package-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.package-card-footer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.package-card:hover .package-card-footer {
  color: var(--primary);
}

/* --- Right On-Page Table of Contents --- */
.toc-sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 2.5rem 1.5rem 2rem 1rem;
  font-size: 0.82rem;
}

.toc-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toc-link {
  color: var(--text-muted);
  text-decoration: none;
  display: block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  line-height: 1.4;
  transition: all var(--transition-fast);
}

.toc-link:hover {
  color: var(--text-primary);
}

.toc-link.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
}

.toc-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.toc-action-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.toc-action-btn svg {
  width: 0.95rem;
  height: 0.95rem;
}

/* --- Search Command Palette (Ctrl+K Modal) --- */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.search-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.search-modal {
  width: 100%;
  max-width: 620px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(-10px) scale(0.98);
  transition: transform var(--transition-fast);
}

.search-modal-backdrop.open .search-modal {
  transform: translateY(0) scale(1);
}

.search-modal-header {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.75rem;
}

.search-modal-header svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-muted);
}

.search-modal-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: var(--text-primary);
  outline: none;
}

.search-modal-close-kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.search-results-list {
  max-height: 420px;
  overflow-y: auto;
  padding: 0.75rem;
  margin: 0;
  list-style: none;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.search-result-item:hover,
.search-result-item.selected {
  background: var(--primary-light);
  color: var(--primary);
}

.search-result-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.search-result-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.search-result-category {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.25rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-modal-footer-keys {
  display: flex;
  gap: 0.85rem;
}

.search-empty-state {
  padding: 2.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --- Floating Back to Top Button --- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all var(--transition-normal);
  z-index: 30;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 25px rgba(79, 70, 229, 0.45);
}

.back-to-top svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* --- Responsive Media Queries --- */
@media (max-width: 1200px) {
  .docs-layout {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }
  .toc-sidebar {
    display: none;
  }
}

@media (max-width: 860px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 320px;
    height: calc(100vh - var(--header-height));
    z-index: 50;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-xl);
  }

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

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
  }

  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .content-wrapper {
    padding: 1.5rem 1.25rem 4rem;
  }

  .hero-banner {
    padding: 2rem 1.5rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .doc-section {
    padding: 1.5rem;
  }

  .top-bar {
    padding: 0 1rem;
  }

  .search-trigger kbd {
    display: none;
  }
}
