/* ===== Design System — Valoryx AI Knowledge Base ===== */
:root {
  --heading:     #124265;
  --accent:      #1d7fc2;
  --accent-dark: #155d91;
  --accent-glow: rgba(29,127,194,0.35);
  --body:        #444444;
  --muted:       #6b7b8d;
  --light:       #f6fafd;
  --navy:        #0c1e2e;
  --navy-light:  #122d42;
  --navy-deep:   #080f18;
  --border:      #e2e8f0;
  --success:     #059652;
  --danger:      #df1529;
  --warning:     #f59e0b;
}

/* ===== Base ===== */
* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { font-family: 'DM Sans', system-ui, sans-serif; font-size: 15px; line-height: 1.7; color: var(--body); background: #ffffff; margin: 0; }
::selection { background: rgba(29,127,194,0.15); color: var(--heading); }
h1, h2, h3, h4, h5, h6 { font-family: 'Plus Jakarta Sans', sans-serif; color: var(--heading); }
a { transition: color 0.2s ease; }

/* ===== Header ===== */
.site-header { transition: border-color 0.3s ease, background-color 0.3s ease; border-bottom: 1px solid transparent; }
.site-header.scrolled { border-bottom-color: #e8ecf0; background: rgba(255,255,255,0.95) !important; }

/* Mobile menu */
.mobile-overlay { opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.mobile-overlay.active { opacity: 1; pointer-events: auto; }
.mobile-panel { transform: translateX(100%); transition: transform 0.3s ease; }
.mobile-panel.active { transform: translateX(0); }

/* ===== Sidebar ===== */
.sidebar-link { position: relative; }
.sidebar-link.active { color: var(--accent) !important; background: rgba(29,127,194,0.06); font-weight: 600; }
.sidebar-link.active::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; background: var(--accent); border-radius: 2px; }
.sidebar-section-title.active { color: var(--accent) !important; }

/* ===== Article Body Typography ===== */
.article-body { max-width: none; }
.article-body h1 { font-size: 1.875rem; font-weight: 800; margin: 2.5rem 0 1rem; letter-spacing: -0.02em; line-height: 1.25; }
.article-body h2 { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 0.75rem; letter-spacing: -0.01em; padding-bottom: 0.5rem; border-bottom: 2px solid #f0f4f8; }
.article-body h3 { font-size: 1.25rem; font-weight: 700; margin: 1.75rem 0 0.5rem; }
.article-body h4 { font-size: 1.1rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.article-body p { margin: 0 0 1rem; }
.article-body a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(29,127,194,0.3); }
.article-body a:hover { color: var(--accent-dark); border-bottom-color: var(--accent); }
.article-body ul, .article-body ol { margin: 0 0 1rem; padding-left: 1.5rem; }
.article-body li { margin-bottom: 0.35rem; }
.article-body li > ul, .article-body li > ol { margin-top: 0.35rem; margin-bottom: 0; }
.article-body strong { color: var(--heading); font-weight: 600; }
.article-body hr { border: none; border-top: 2px solid #f0f4f8; margin: 2rem 0; }
.article-body img { max-width: 100%; border-radius: 8px; margin: 1rem 0; }
.article-body blockquote { margin: 1.5rem 0; padding: 1rem 1.25rem; border-left: 4px solid var(--accent); background: rgba(29,127,194,0.04); border-radius: 0 6px 6px 0; }
.article-body blockquote p:last-child { margin-bottom: 0; }

/* Tables */
.article-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 14px; }
.article-body thead th { background: var(--heading); color: #fff; font-weight: 600; text-align: left; padding: 10px 14px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; letter-spacing: 0.02em; }
.article-body thead th:first-child { border-radius: 6px 0 0 0; }
.article-body thead th:last-child { border-radius: 0 6px 0 0; }
.article-body tbody td { padding: 10px 14px; border-bottom: 1px solid #f0f4f8; }
.article-body tbody tr:nth-child(even) { background: #f8fbfe; }
.article-body tbody tr:hover { background: #edf4fa; }

/* Code blocks */
.article-body code { font-family: 'JetBrains Mono', monospace; font-size: 0.875em; }
.article-body :not(pre) > code { background: rgba(29,127,194,0.08); color: var(--accent-dark); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.85em; }
.article-body pre { position: relative; margin: 1.5rem 0; border-radius: 8px; overflow: hidden; }
.article-body pre code { display: block; padding: 1.25rem 1.5rem; overflow-x: auto; background: #0d1117; color: #c9d1d9; font-size: 13px; line-height: 1.6; border-radius: 8px; }
.copy-btn { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,0.1); color: #8b949e; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 4px 10px; font-size: 12px; font-family: 'DM Sans', sans-serif; cursor: pointer; opacity: 0; transition: opacity 0.2s, background 0.2s; }
.article-body pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(255,255,255,0.2); color: #e6edf3; }
.copy-btn.copied { background: rgba(5,150,82,0.3); color: #3fb950; }

/* ===== Callout Shortcode ===== */
.callout { margin: 1.5rem 0; padding: 1rem 1.25rem; border-radius: 8px; border-left: 4px solid; }
.callout p:last-child { margin-bottom: 0; }
.callout-info { border-color: var(--accent); background: rgba(29,127,194,0.05); }
.callout-info .callout-icon { color: var(--accent); }
.callout-warning { border-color: var(--warning); background: rgba(245,158,11,0.06); }
.callout-warning .callout-icon { color: var(--warning); }
.callout-success { border-color: var(--success); background: rgba(5,150,82,0.05); }
.callout-success .callout-icon { color: var(--success); }
.callout-danger { border-color: var(--danger); background: rgba(223,21,41,0.05); }
.callout-danger .callout-icon { color: var(--danger); }

/* ===== Cards Shortcode ===== */
.cards-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 1rem; margin: 1.5rem 0; }
@media (min-width: 640px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
.doc-card { display: block; padding: 1.25rem 1.5rem; border: 1px solid var(--border); border-radius: 8px; text-decoration: none !important; color: var(--body); transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.doc-card:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.08); border-color: var(--accent); }
.doc-card h3 { font-size: 1rem; font-weight: 700; color: var(--heading); margin: 0 0 0.5rem; }
.doc-card p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.6; }

/* ===== Tabs Shortcode ===== */
.tabs-container { margin: 1.5rem 0; }
.tabs-nav { display: flex; gap: 0; background: #f0f4f8; border-radius: 10px; padding: 4px; margin-bottom: 0; overflow-x: auto; }
.tab-btn { padding: 8px 16px; font-size: 13px; font-weight: 500; font-family: 'Plus Jakarta Sans', sans-serif; color: var(--muted); border: none; background: transparent; border-radius: 7px; cursor: pointer; transition: all 0.2s ease; white-space: nowrap; }
.tab-btn:hover { color: var(--heading); }
.tab-btn.active { background: #ffffff; color: var(--accent); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.tab-panel { display: none; padding: 1.25rem 0 0; }
.tab-panel.active { display: block; }

/* ===== Steps Shortcode ===== */
.steps-container { margin: 1.5rem 0; position: relative; padding-left: 2.5rem; }
.steps-container::before { content: ''; position: absolute; left: 15px; top: 0; bottom: 0; width: 2px; background: #e8ecf0; }
.step-item { position: relative; margin-bottom: 1.5rem; }
.step-item:last-child { margin-bottom: 0; }
.step-number { position: absolute; left: -2.5rem; top: 0; width: 30px; height: 30px; background: var(--accent); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; font-family: 'Plus Jakarta Sans', sans-serif; z-index: 1; }
.step-item h4 { margin-top: 0.15rem; margin-bottom: 0.5rem; }

/* ===== Accordion Shortcode ===== */
.accordion-container { margin: 1.5rem 0; }
.accordion-item { border: 1px solid rgba(68,68,68,0.15); border-radius: 5px; margin-bottom: 8px; overflow: hidden; transition: border-color 0.2s ease; }
.accordion-item:hover { border-color: rgba(29,127,194,0.4); }
.accordion-item summary { padding: 14px 18px; font-weight: 600; font-size: 15px; color: var(--heading); cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; transition: background 0.2s ease, color 0.2s ease; }
.accordion-item summary::-webkit-details-marker { display: none; }
.accordion-item summary::after { content: '+'; font-size: 18px; color: var(--muted); transition: transform 0.2s ease; }
.accordion-item[open] summary { background: var(--accent); color: #fff; box-shadow: 0 5px 25px rgba(29,127,194,0.28); }
.accordion-item[open] summary::after { content: '\2212'; color: #fff; }
.accordion-item .accordion-body { padding: 14px 18px; }

/* ===== Hero (Homepage) ===== */
.hero-section { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 50%, var(--heading) 100%); }

/* ===== Prev/Next Navigation ===== */
.page-nav { border-top: 2px solid #f0f4f8; }
.page-nav a { transition: color 0.2s ease, transform 0.15s ease; }
.page-nav a:hover { transform: translateX(2px); }
.page-nav a.prev:hover { transform: translateX(-2px); }

/* ===== Mermaid ===== */
.mermaid { margin: 1.5rem 0; text-align: center; }
.mermaid svg { max-width: 100%; height: auto; }

/* ===== Print ===== */
@media print {
  .site-header, .sidebar-nav, .page-nav, .mobile-overlay, .copy-btn { display: none !important; }
  .article-body { max-width: 100%; }
}
