/* BC Simple Theme - Based on sample_page.html styling

   Zachowuje strukturę MkDocs Material, stosuje styl wizualny:
   - Kolor główny: #0078d4 (Microsoft blue)
   - Czcionka: Segoe UI
   - Czyste, proste formatowanie
*/

:root {
  /* Business Central Teal palette */
  --primary: #006064;
  --primary-light: #008080;
  --primary-dark: #004d40;
  --text-dark: #333;
  --text-body: #444;
  --text-muted: #666;
  --bg-light: #f5f5f5;
  --bg-code: #f0f0f0;
  --border: #e0e0e0;
  --note-bg: #e0f2f1;

  /* Material overrides */
  --md-primary-fg-color: #006064;
  --md-accent-fg-color: #00838f;
  --md-typeset-a-color: #00838f;
}

/* ================================================
   TYPOGRAPHY - Segoe UI, sizes from sample_page
   ================================================ */

body,
.md-typeset {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-body);
}

.md-typeset h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
  margin: 0 0 20px 0;
}

.md-typeset h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 30px 0 15px 0;
}

.md-typeset h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 25px 0 10px 0;
}

.md-typeset h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 20px 0 8px 0;
}

.md-typeset p {
  margin-bottom: 16px;
}

.md-typeset ul,
.md-typeset ol {
  margin-bottom: 16px;
}

.md-typeset li {
  margin-bottom: 4px;
}

/* ================================================
   LINKS
   ================================================ */

.md-typeset a {
  color: var(--primary);
  text-decoration: none;
}

.md-typeset a:hover {
  text-decoration: underline;
}

/* ================================================
   CODE - from sample_page
   ================================================ */

.md-typeset code {
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: Consolas, monospace;
  font-size: 14px;
  color: var(--text-dark);
  border: none;
}

.md-typeset pre {
  background: #2d2d2d;
  border-radius: 4px;
  padding: 16px;
  margin: 16px 0;
}

.md-typeset pre code {
  background: transparent;
  padding: 0;
  color: #ccc;
  font-size: 14px;
}

/* ================================================
   ADMONITIONS - note style from sample_page
   ================================================ */

.md-typeset .admonition,
.md-typeset details {
  background: var(--note-bg);
  border: none;
  border-left: 4px solid var(--primary);
  border-radius: 0;
  padding: 12px 16px;
  margin: 20px 0;
  box-shadow: none;
  font-size: 16px;
}

.md-typeset .admonition-title,
.md-typeset summary {
  background: transparent !important;
  border: none;
  padding: 0;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-dark);
}

.md-typeset .admonition-title::before,
.md-typeset summary::before {
  display: none;
}

/* Tip - green */
.md-typeset .admonition.tip {
  background: #e8f5e9;
  border-left-color: #2e7d32;
}

/* Warning - amber */
.md-typeset .admonition.warning {
  background: #fff8e1;
  border-left-color: #ff8f00;
}

/* ================================================
   HEADER - no logo, clean
   ================================================ */

.md-header__button.md-logo {
  display: none;
}

/* ================================================
   TABLES
   ================================================ */

.md-typeset table:not([class]) {
  border: 1px solid var(--border);
  border-collapse: collapse;
  font-size: 15px;
  margin: 16px 0;
}

.md-typeset table:not([class]) th {
  background: var(--bg-light);
  color: var(--text-dark);
  font-weight: 600;
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.md-typeset table:not([class]) td {
  padding: 8px 12px;
  border: 1px solid var(--border);
}

/* ================================================
   CONTENT AREA - dynamiczna szerokość z marginesami
   ================================================ */

.md-grid {
  max-width: none;
  margin: 0 4%;  /* marginesy po bokach */
}

.md-main__inner {
  max-width: none;
}

.md-content {
  background: white;
  padding-bottom: 40px;
}

.md-content__inner {
  padding: 20px 40px;
  max-width: none;
  width: 100%;
}

/* Szersze menu lewe (nawigacja) */
.md-sidebar--primary {
  width: 14rem;  /* domyślnie ~12rem */
}

/* Szersze menu prawe (spis treści) */
.md-sidebar--secondary {
  width: 14rem;  /* domyślnie ~12rem */
}

/* ================================================
   SIDEBAR - clean, readable
   ================================================ */

.md-sidebar {
  font-size: 14px;
}

.md-nav__link {
  color: var(--text-body);
}

.md-nav__link:hover {
  color: var(--primary);
}

.md-nav__link--active {
  color: var(--primary);
  font-weight: 600;
}

.md-nav__item--active > .md-nav__link {
  color: var(--primary);
}

/* ================================================
   HEADER
   ================================================ */

.md-header {
  background: var(--primary);
}

.md-tabs {
  background: var(--primary);
}

/* ================================================
   FOOTER - navision.pl branding (sticky)
   ================================================ */

.md-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--md-default-bg-color, #fff);
  border-top: 1px solid var(--border);
}

.md-footer-meta {
  background: var(--md-default-bg-color, #fff);
  padding: 4px 20px;
}

.md-footer-meta__inner {
  justify-content: flex-end;
}

.md-copyright {
  color: #555;
  font-size: 13px;
  text-align: right;
}

.md-copyright__highlight {
  color: #555;
}

.md-copyright a {
  color: #555 !important;
  font-weight: 600;
}

.md-copyright a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Dark mode footer */
[data-md-color-scheme="slate"] .md-footer {
  background: var(--md-default-bg-color);
  border-top: 1px solid #333;
}

[data-md-color-scheme="slate"] .md-footer-meta {
  background: var(--md-default-bg-color);
}

[data-md-color-scheme="slate"] .md-copyright {
  color: #bbb;
}

[data-md-color-scheme="slate"] .md-copyright__highlight {
  color: #bbb;
}

[data-md-color-scheme="slate"] .md-copyright a {
  color: #bbb !important;
}

[data-md-color-scheme="slate"] .md-copyright a:hover {
  color: #4db6ac;
}

/* ================================================
   ATTRIBUTION (from sample_page)
   ================================================ */

.md-typeset blockquote {
  font-size: 13px;
  color: #555;
  background: #f8f8f8;
  border: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 12px;
  margin: 0 0 20px 0;
}

.md-typeset blockquote a {
  color: var(--primary);
}

/* ================================================
   DARK MODE - BC Teal
   ================================================ */

[data-md-color-scheme="slate"] {
  --md-default-bg-color: #1a1a1a;
  --md-default-fg-color: #e0e0e0;
  --md-primary-fg-color: #00897b;
  --md-accent-fg-color: #4db6ac;
}

[data-md-color-scheme="slate"] .md-typeset {
  color: #ccc;
}

[data-md-color-scheme="slate"] .md-typeset h1 {
  color: #4db6ac;
  border-bottom-color: #4db6ac;
}

[data-md-color-scheme="slate"] .md-typeset h2,
[data-md-color-scheme="slate"] .md-typeset h3,
[data-md-color-scheme="slate"] .md-typeset h4 {
  color: #e0e0e0;
}

[data-md-color-scheme="slate"] .md-typeset a {
  color: #4db6ac;
}

[data-md-color-scheme="slate"] .md-typeset code {
  background: #333;
  color: #e0e0e0;
}

[data-md-color-scheme="slate"] .md-typeset .admonition {
  background: rgba(0, 128, 128, 0.15);
}

[data-md-color-scheme="slate"] .md-content {
  background: #1a1a1a;
}

[data-md-color-scheme="slate"] .md-nav__link {
  color: #bbb;
}

[data-md-color-scheme="slate"] .md-nav__link:hover,
[data-md-color-scheme="slate"] .md-nav__link--active {
  color: #4db6ac;
}

/* Dark mode admonitions - enhanced */
[data-md-color-scheme="slate"] .md-typeset .admonition,
[data-md-color-scheme="slate"] .md-typeset details {
  background: #263238 !important;
  border-left-color: #4db6ac !important;
}

[data-md-color-scheme="slate"] .md-typeset .admonition-title,
[data-md-color-scheme="slate"] .md-typeset summary {
  color: #4db6ac !important;
}

[data-md-color-scheme="slate"] .md-typeset .admonition p,
[data-md-color-scheme="slate"] .md-typeset details p {
  color: #e0e0e0 !important;
}

/* Tip - green in dark mode */
[data-md-color-scheme="slate"] .md-typeset .admonition.tip {
  background: #1b3d1f !important;
  border-left-color: #66bb6a !important;
}

[data-md-color-scheme="slate"] .md-typeset .admonition.tip .admonition-title {
  color: #66bb6a !important;
}

/* Warning - amber in dark mode */
[data-md-color-scheme="slate"] .md-typeset .admonition.warning {
  background: #3d3015 !important;
  border-left-color: #ffb74d !important;
}

[data-md-color-scheme="slate"] .md-typeset .admonition.warning .admonition-title {
  color: #ffb74d !important;
}

/* Important - red in dark mode */
[data-md-color-scheme="slate"] .md-typeset .admonition.important {
  background: #3d1515 !important;
  border-left-color: #ef5350 !important;
}

[data-md-color-scheme="slate"] .md-typeset .admonition.important .admonition-title {
  color: #ef5350 !important;
}


/* Dark mode tables */
[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background: #2d2d2d;
  color: #e0e0e0;
  border-color: #444;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) td {
  border-color: #444;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) {
  border-color: #444;
}

/* ================================================
   SIDEBAR SCROLLING FIX
   ================================================ */

/* Remove max-height restriction on nav list */
.md-sidebar__scrollwrap {
  max-height: calc(100vh - 4.8rem) !important;
  overflow-y: auto !important;
}

/* Allow nav items to expand fully */
.md-nav__list {
  max-height: none !important;
}

/* Fix nested nav scrolling */
.md-nav--primary .md-nav__list {
  max-height: none !important;
}

.md-nav--lifted > .md-nav__list {
  max-height: none !important;
}

/* Ensure expandable sections work */
.md-nav__item--nested > .md-nav {
  max-height: none !important;
  overflow: visible !important;
}

/* Force search icon visibility */
.md-search {
  display: block !important;
}

.md-header__button[for="__search"] {
  display: inline-block !important;
  visibility: visible !important;
}

.md-search__icon {
  display: block !important;
}

/* Remove left padding for admonition title (no icon) */
.md-typeset .admonition-title,
.md-typeset details summary {
  padding-left: 0 !important;
}

/* Align admonition title with content */
.md-typeset .admonition-title,
.md-typeset details summary {
  padding-left: 16px !important;
}
