/* Kscope Brand Theme for Docsify */

/* Import brand fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@500;600;700;800&display=swap');

/* Brand color variables */
:root {
  --theme-color: #292C68;
  --theme-color-hover: #494FB3;
  --theme-color-light: #EEF2FF;
  --brand-purple: #7F56D9;
  --brand-royal-blue: #3A62C9;
  --text-primary: #1D2939;
  --text-secondary: #344054;
  --text-body: #475467;
  --text-muted: #667085;
  --border-color: #D0D5DD;
  --bg-light: #F9FAFB;
  --bg-ghost: #EEF2FF;
}

/* Global typography */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* Headings use Montserrat */
.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4,
.markdown-section h5,
.markdown-section h6 {
  font-family: 'Montserrat', 'Inter', sans-serif;
  color: var(--theme-color);
  font-weight: 700;
}

.markdown-section h1 {
  font-size: 1.8rem;
  font-weight: 800;
  border-bottom: 2px solid var(--bg-ghost);
  padding-bottom: 0.4em;
}

.markdown-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.markdown-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Body text */
.markdown-section p,
.markdown-section li {
  color: var(--text-body);
  font-size: 15px;
  line-height: 1.7;
}

/* Links in brand blue */
.markdown-section a,
a {
  color: var(--brand-royal-blue);
}

.markdown-section a:hover,
a:hover {
  color: var(--theme-color-hover);
}

/* Sidebar */
.sidebar {
  background: var(--theme-color);
  color: #fff;
}

.sidebar .sidebar-nav {
  padding-top: 12px;
}

.sidebar ul li a {
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.sidebar ul li a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.sidebar ul li.active > a {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 600;
}

/* Sidebar search */
.sidebar .search input {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
}

.sidebar .search input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.sidebar .search .matching-post {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* App name / logo in sidebar */
.app-name-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 12px 8px;
  text-decoration: none !important;
}

.sidebar-brand-logo {
  width: 120px;
  height: auto;
}

/* Nav icons in sidebar */
.sidebar ul li a img.nav-icon {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: middle;
  filter: brightness(0) invert(1);
  opacity: 0.75;
}

.sidebar ul li a .material-symbols-outlined {
  font-size: 18px;
  margin-right: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  color: rgba(255, 255, 255, 0.7);
}

/* Code blocks */
.markdown-section code {
  background: var(--bg-ghost);
  color: var(--theme-color);
  border-radius: 4px;
  font-size: 0.88em;
  padding: 2px 6px;
}

.markdown-section pre {
  background: #1D2939;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.markdown-section pre code {
  background: transparent;
  color: #E5E7EB;
}

/* Tables */
.markdown-section table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}

.markdown-section table th {
  background: var(--bg-ghost);
  color: var(--theme-color);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--theme-color);
  padding: 10px 12px;
}

.markdown-section table td {
  padding: 10px 12px;
  border-bottom: 1px solid #E5E7EB;
  color: var(--text-body);
}

.markdown-section table tr:hover td {
  background: var(--bg-light);
}

/* Blockquotes */
.markdown-section blockquote {
  border-left: 4px solid var(--brand-purple);
  background: var(--bg-ghost);
  color: var(--text-secondary);
  padding: 12px 20px;
  border-radius: 0 8px 8px 0;
  margin: 1em 0;
}

/* Progress bar override */
#progress {
  background: var(--theme-color) !important;
}

/* Pagination */
.docsify-pagination-container .pagination-item-label {
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
}

.docsify-pagination-container .pagination-item-title {
  color: var(--brand-royal-blue);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}

/* Mermaid diagrams */
.mermaid {
  margin: 1.5em 0;
  padding: 24px;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  text-align: center;
  overflow-x: auto;
}

.mermaid svg {
  max-width: 100%;
  height: auto;
}

/* Mermaid node styling */
.mermaid .node rect,
.mermaid .node polygon,
.mermaid .node circle {
  rx: 8;
  ry: 8;
  stroke-width: 1.5px;
}

/* Mermaid subgraph labels */
.mermaid .cluster-label .nodeLabel {
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--theme-color);
}

/* Mermaid edge labels */
.mermaid .edgeLabel {
  font-size: 12px;
  color: var(--text-muted);
  background: #fff;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Mermaid cluster (subgraph) borders */
.mermaid .cluster rect {
  rx: 10 !important;
  ry: 10 !important;
  stroke-width: 1.5px !important;
  stroke-dasharray: 5 5 !important;
}

/* Sidebar footer */
.sidebar-footer,
#mb-footer {
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 11px;
  text-align: center;
  padding: 12px 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 20px;
  background: var(--theme-color);
  position: relative;
  z-index: 1;
}

.sidebar-footer a,
#mb-footer a {
  color: rgba(255, 255, 255, 0.7) !important;
}

/* Cover page */
section.cover {
  background: linear-gradient(135deg, var(--theme-color) 0%, #494FB3 50%, var(--brand-purple) 100%) !important;
  color: #fff;
}

section.cover h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 2.5rem;
  color: #fff;
}

section.cover blockquote {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  padding: 0;
}

section.cover ul {
  text-align: left;
  display: inline-block;
}

section.cover li {
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
}

section.cover .cover-main > p:last-child a {
  border-radius: 8px;
  padding: 10px 28px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s;
}

section.cover .cover-main > p:last-child a:first-child {
  background: #fff;
  color: var(--theme-color);
  border: 2px solid #fff;
}

section.cover .cover-main > p:last-child a:first-child:hover {
  background: transparent;
  color: #fff;
}

section.cover .cover-main > p:last-child a:last-child {
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

section.cover .cover-main > p:last-child a:last-child:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Flexible alerts */
.alert {
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  margin: 1em 0;
}

.alert.callout {
  border-width: 0 0 0 4px;
}

.alert .alert-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.alert.tip {
  border-color: #12B76A;
  background: #ECFDF3;
}

.alert.tip .alert-title {
  color: #027A48;
}

.alert.note {
  border-color: var(--brand-royal-blue);
  background: #EFF8FF;
}

.alert.note .alert-title {
  color: var(--brand-royal-blue);
}

.alert.warning {
  border-color: #F79009;
  background: #FFFAEB;
}

.alert.warning .alert-title {
  color: #B54708;
}

.alert.attention {
  border-color: #F04438;
  background: #FEF3F2;
}

.alert.attention .alert-title {
  color: #B42318;
}

/* Docsify tabs */
.docsify-tabs__tab {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
}

.docsify-tabs__tab--active {
  color: var(--theme-color);
  border-bottom-color: var(--theme-color);
  font-weight: 600;
}

.docsify-tabs__content {
  border: 1px solid var(--border-color);
  border-radius: 0 0 8px 8px;
  padding: 16px 20px;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Images — subtle styling */
.markdown-section img {
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  max-width: 100%;
}

/* Don't apply shadow to logo/icons */
section.cover img,
.sidebar img,
.app-name img {
  border-radius: 0;
  box-shadow: none;
}
