/* -------------------------------------------
   Global text spacing
-------------------------------------------- */
p {
  margin-bottom: 1.5em;
}

.md-typeset ol > li {
  margin-bottom: 1.5em;
}

/* -------------------------------------------
   Tables – center first column
-------------------------------------------- */
.md-typeset table td:first-child,
.md-typeset table th:first-child {
  text-align: center;
  vertical-align: middle;
}

/* -------------------------------------------
   Floating PDF button
-------------------------------------------- */
.pdf-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 100px;
  height: 100px;
  background: #f44336;
  color: white;
  border-radius: 50%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pdf-float:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.pdf-float svg {
  width: 60px;
  height: 60px;
  fill: white;
}

/* -------------------------------------------
   Floating "Return to Top" button
-------------------------------------------- */
.top-button {
  position: fixed;
  bottom: 4rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: #0078d4;
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 50px;
  font-size: 1.5rem;
  text-decoration: none;
  z-index: 1000;
  box-shadow: 0 6px 12px rgba(0,0,0,0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
  opacity: 0.7;
}

.top-button:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);
  opacity: 1;
}

@media (max-width: 768px) {
  .top-button {
    bottom: 3rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    line-height: 40px;
    font-size: 1.2rem;
  }
  .pdf-float {
    width: 80px;
    height: 80px;
    bottom: 1.5rem;
    right: 1.5rem;
  }
  .pdf-float svg {
    width: 48px;
    height: 48px;
  }
}

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

/* -------------------------------------------
   Footer fixes
-------------------------------------------- */

/* Hide the Material brand */
.md-footer__brand {
  display: none !important;
}

/* Hide "Made with Material for MkDocs" */
.md-copyright {
  display: none !important;
}

/* Make footer span full width */
.md-footer-meta__inner {
  max-width: none;
  display: flex;
  align-items: center;
}

/* Dark mode for copyright */
[data-md-color-scheme="slate"] .md-footer-meta__inner::before {
  color: rgb(255, 255, 255);
}

/* Push social icons (PDF) all the way right */
.md-footer__social {
  margin-left: auto;
  padding-right: 1.5rem; /* controls distance from screen edge */
}

/* PDF icon sizing + hover */
.md-footer .md-social__link[title*="PDF"] svg {
  width: 2.6rem;
  height: 2.6rem;
  transition: transform 0.2s ease;
}

.md-footer .md-social__link[title*="PDF"]:hover svg {
  transform: scale(1.15);
}

/* Insert custom copyright with PNG logo */
.md-footer-meta__inner::before {
  content: "© HP Tuners 2026 | ISO 9001 : 2015 Certified Company";
  display: flex;
  align-items: center;

  padding-left: 36px; /* space for logo */
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.6;

  background-repeat: no-repeat;
  background-position: left center;
  background-size: 22px 22px;

  color: rgb(255, 255, 255);
}

/* -------------------------------------------
   Header — match Microsoft Learn colours
   exactly in both light and dark mode
-------------------------------------------- */

/* Light mode: white, same as MS Learn */
[data-md-color-scheme="default"] .md-header {
  background-color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Light mode: keep text/icons dark and visible */
[data-md-color-scheme="default"] .md-header__title,
[data-md-color-scheme="default"] .md-header .md-icon {
  color: #1b1b1b !important;
}

/* Dark mode: #1b1b1b matches MS Learn's dark page background exactly */
[data-md-color-scheme="slate"] .md-header {
  background-color: #1b1b1b !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* -------------------------------------------
   Dark mode — match MS Learn background #1b1b1b
   across the entire site
-------------------------------------------- */
[data-md-color-scheme="slate"] {
  --md-default-bg-color:        #1b1b1b;  /* main content area */
  --md-default-bg-color--light: #1f1f1f;  /* subtle variation */
  --md-default-bg-color--lighter: #242424;
  --md-default-bg-color--lightest: #2b2b2b;
}

/* Sidebar backgrounds */
[data-md-color-scheme="slate"] .md-sidebar {
  background-color: #1b1b1b;
}

[data-md-color-scheme="slate"] .md-sidebar__scrollwrap {
  background-color: #1b1b1b;
}

/* Nav/sidebar inner panel */
[data-md-color-scheme="slate"] .md-nav {
  background-color: #1b1b1b;
}

/* Footer */
[data-md-color-scheme="slate"] .md-footer {
  background-color: #1b1b1b;
}

[data-md-color-scheme="slate"] .md-footer-meta {
  background-color: #111111;
}

/* -------------------------------------------
   Search bar — match header in both modes
-------------------------------------------- */

/* Light mode — white to match header */
[data-md-color-scheme="default"] .md-search__form {
  background-color: #ffffff !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 4px;
}

[data-md-color-scheme="default"] .md-search__input,
[data-md-color-scheme="default"] .md-search__input::placeholder {
  color: #616161 !important;
  -webkit-text-fill-color: #616161 !important;
}

[data-md-color-scheme="default"] .md-search__icon,
[data-md-color-scheme="default"] .md-search__icon.md-icon {
  color: #616161 !important;
}

/* Dark mode — #1b1b1b to match header */
[data-md-color-scheme="slate"] .md-search__form {
  background-color: #1b1b1b !important;
  border: 1px solid #404040 !important;
  border-radius: 4px;
}

[data-md-color-scheme="slate"] .md-search__input,
[data-md-color-scheme="slate"] .md-search__input::placeholder {
  color: #a0a0a0 !important;
  -webkit-text-fill-color: #a0a0a0 !important;
}

[data-md-color-scheme="slate"] .md-search__icon,
[data-md-color-scheme="slate"] .md-search__icon.md-icon {
  color: #a0a0a0 !important;
}

/* -------------------------------------------
   Header — add | separator between logo and title
-------------------------------------------- */
.md-header__button.md-logo {
  padding-right: 0 !important;
  margin-right: -12px !important;
}

.md-header__title::before {
  content: "|";
  margin: 0 8px 0 0 !important;
  opacity: 0.4;
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1;  
}

/* -------------------------------------------
   Header — logo | title on one line
-------------------------------------------- */
.md-header__inner {
  display: flex;
  align-items: left;
}

.md-header__title {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.md-header__title::before {
  content: "|";
  margin: 0 10px;
  opacity: 0.4;
  font-weight: 300;
}

/* -------------------------------------------
   Focus mode — hide header and sidebars
-------------------------------------------- */
body.focus-mode .md-header,
body.focus-mode .md-tabs,
body.focus-mode .md-sidebar {
  display: none !important;
}

body.focus-mode .md-main {
  margin-top: 0 !important;
}

body.focus-mode .md-content {
  max-width: 100% !important;
}

/* -------------------------------------------
   Focus mode — keep exit button visible
-------------------------------------------- */
body.focus-mode .md-header {
  display: flex !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

body.focus-mode .md-header__inner > *:not(#focus-mode-btn) {
  display: none !important;
}

body.focus-mode #focus-mode-btn {
  margin-left: auto;
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.15) !important;
  opacity: 1 !important;
  border-radius: 4px;
}

/* -------------------------------------------
   Footer — HP Tuners blue in both modes
-------------------------------------------- */
.md-footer {
  background-color: #0078d4 !important;
}

.md-footer-meta {
  background-color: #005a9e !important;
}

/* -------------------------------------------
   Focus mode button — dark text in light mode
-------------------------------------------- */
[data-md-color-scheme="default"] #focus-mode-btn {
  color: #1b1b1b !important;
}

[data-md-color-scheme="default"] #focus-mode-btn svg {
  stroke: #1b1b1b !important;
}

/* Hide Material's default SVG breadcrumb separator */
.md-path__item .md-icon {
  display: none !important;
}

/* -------------------------------------------
   Breadcrumb — MS Learn style
-------------------------------------------- */
.md-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  padding: 8px 0 16px 0;
  margin-top: -8px;
}

.md-path__item {
  display: flex;
  align-items: center;
  color: #616161;
}

.md-path__item a {
  color: #0078d4;
  text-decoration: none;
}

.md-path__item a:hover {
  text-decoration: underline;
}

/* The › separator between items */
.md-path__item + .md-path__item::before {
  content: "›";
  margin: 0 4px;
  color: #616161;
}

/* Dark mode */
[data-md-color-scheme="slate"] .md-path__item {
  color: #a0a0a0;
}

[data-md-color-scheme="slate"] .md-path__item a {
  color: #4db8ff;
}

[data-md-color-scheme="slate"] .md-path__item + .md-path__item::before {
  color: #a0a0a0;
}

/* -------------------------------------------
   TOC — rename "Table of contents" label
-------------------------------------------- */
.md-nav--secondary .md-nav__title {
  visibility: hidden;
  position: relative;
}

.md-nav--secondary .md-nav__title::after {
  content: "In this section";
  visibility: visible;
  position: absolute;
  left: 0;
}

/* -------------------------------------------
   Left nav — move expand arrow to the left
-------------------------------------------- */
.md-nav__item--nested > .md-nav__link {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.md-nav__item--nested > .md-nav__link .md-nav__icon {
  margin-right: 8px;
  margin-left: 0;
}

/* -------------------------------------------
   Left nav — left align all items
-------------------------------------------- */
.md-nav__link {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  padding-left: 8px !important;
}

.md-nav__icon {
  order: -1 !important;
  margin-right: 8px !important;
  margin-left: 0 !important;
  flex-shrink: 0;
}

/* Reset indentation for nested items */
.md-nav__item--nested .md-nav .md-nav__link {
  padding-left: 24px !important;
}

.md-nav__item--nested .md-nav .md-nav__item--nested .md-nav .md-nav__link {
  padding-left: 40px !important;
}

/* -------------------------------------------
   Left nav — filter search bar
-------------------------------------------- */
#nav-search-wrapper {
  padding: 12px 8px;
  border-bottom: 1px solid var(--ms-border, #e0e0e0);
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: inherit;
}

#nav-search-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  outline: none;
  background-color: #ffffff;
  color: #1b1b1b;
  transition: border-color 0.2s ease;
}

#nav-search-input:focus {
  border-color: #0078d4;
}

/* Dark mode */
[data-md-color-scheme="slate"] #nav-search-input {
  background-color: #2b2b2b;
  border-color: #404040;
  color: #e8e8e8;
}

[data-md-color-scheme="slate"] #nav-search-input:focus {
  border-color: #0078d4;
}

[data-md-color-scheme="slate"] #nav-search-wrapper {
  border-bottom-color: #404040;
}

/* -------------------------------------------
   Left nav — remove unwanted left spacing
-------------------------------------------- */
.md-sidebar--primary {
  left: 0 !important;
  padding-left: 0 !important;
}

.md-sidebar--primary .md-sidebar__scrollwrap {
  padding-left: 0 !important;
  margin-left: 0 !important;
}

.md-nav--primary {
  padding-left: 0 !important;
  margin-left: 0 !important;
}

.md-nav__list {
  padding-left: 0 !important;
  margin-left: 0 !important;
}

.md-grid {
  max-width: 100% !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
}
/* -------------------------------------------
   Mobile — restore sidebar behaviour
-------------------------------------------- */
@media (max-width: 76.1875em) {
  .md-sidebar--primary {
    left: 0 !important;
    width: 12.1rem !important;
  }

  .md-grid {
    max-width: 100% !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
  }
}

@media (max-width: 59.9375em) {
  .md-sidebar--primary {
    left: -12.1rem !important;
    transition: left 0.25s ease !important;
  }

  .md-sidebar--primary[data-md-state="open"] {
    left: 0 !important;
  }
}

/* -------------------------------------------
   Left nav — remove duplicate section index link
-------------------------------------------- */
.md-nav__item .md-nav__link[href="./"],
.md-nav__item .md-nav__link[href="../VCM_Live/"],
.md-nav__item .md-nav__link[href="../VCM_Scanner/"],
.md-nav__item .md-nav__link[href="../VCM_Editor/"],
.md-nav__item .md-nav__link[href="../VCM_Live/"],
.md-nav__item .md-nav__link[href="../TDN_APP_and_RTD4_User_Guide/"],
.md-nav__item .md-nav__link[href="../TDN_Tuner_Portal_Help_System/"],
.md-nav__item .md-nav__link[href="../Telemetry/"],
.md-nav__item .md-nav__link[href="../GPS/"],
.md-nav__item .md-nav__link[href="../OBDII_Adapter_Cable_(s)_Quick_Start_Guide/"] {
  display: none !important;
}

/* -------------------------------------------
   Heading sizes, weight and boldness
-------------------------------------------- */
.md-typeset h1 {
  font-size: 30px !important;        /* adjust size */
  font-weight: 600 !important;       /* light — like MS Learn */
  line-height: 1.3;
}

.md-typeset h2 {
  font-size: 24px !important;      /* adjust size */
  font-weight: 600 !important;       /* semibold */
  line-height: 1.4;
}

.md-typeset h3 {
  font-size: 20px !important;      /* adjust size */
  font-weight: 600 !important;       /* semibold */
  line-height: 1.4;
}

.md-typeset h4 {
  font-size: 16px !important;        /* adjust size */
  font-weight: 600 !important;       /* semibold */
  line-height: 1.4;
}

/* -------------------------------------------
   Heading colours — match all headers
-------------------------------------------- */
.md-typeset h1 {
  color: var(--md-default-fg-color) !important;
}

body:has(.home-page) .md-footer__inner {
  display: none !important;
}

.md-footer__inner {
  background-color: #0078d4 !important;
}

.md-footer__link .md-footer__title,
.md-footer__link .md-footer__direction,
.md-footer__link svg {
  color: #ffffff !important;
  fill: #ffffff !important;
}

[data-md-color-scheme="slate"] .md-footer__inner {
  background-color: #1b1b1b !important;
}

[data-md-color-scheme="default"] .md-footer__inner {
  background-color: #ffffff !important;
}

[data-md-color-scheme="default"] .md-footer__link .md-footer__title,
[data-md-color-scheme="default"] .md-footer__link .md-footer__direction,
[data-md-color-scheme="default"] .md-footer__link svg {
  color: #1b1b1b !important;
  fill: #1b1b1b !important;
}

[data-md-color-scheme="default"] .md-footer__inner .md-footer__link:hover {
  background-color: #f5f5f5 !important;
}

.md-button--primary {
  background-color: #2680D9 !important;
  border-color: #2680D9 !important;
}

.md-button--primary:hover {
  background-color: #1a6abf !important;
  border-color: #1a6abf !important;
}

.md-nav--primary .md-nav__item .md-nav__item .md-nav__link {
  padding-left: 24px !important;
}

.md-nav--primary .md-nav__item .md-nav__item .md-nav__item .md-nav__link {
  padding-left: 40px !important;
}