:root {
  /* Theme default overrides */
  --border-radius: 0.5rem;
  --font-size: 13px;

  /* Main background colors */
  --body-background: #2b2b2b;
  --body-font-color: #cecece;

  /* Sidebar colors */
  --gray-100: #1e1e1e;
  --gray-200: #2b2b2b;
  --gray-300: #3a3a3a;
  --gray-400: #4a4a4a;
  --gray-500: #808080;
  --gray-600: #38383c;

  /* Accent colors - blue theme */
  --color-link: #008dff;

  /* Header and navigation */
  --header-background: #27282b;

  /* Content area */
  --body-min-width: 20rem;
  --container-max-width: 80rem;

  --icon-filter: brightness(0) invert(0.5);
}

/* Global font styling */
.markdown {
  line-height: 1.846;
}

/* Desktop Header Bar */
.desktop-header-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  background-color: var(--header-background);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-left: 25px;
  padding-right: 25px;
}

.header-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}

.header-left-section {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.header-logo {
  flex-shrink: 0;
}

.header-logo-left {
  order: 1;
  margin-top: 12px;
  max-width: 200px;
}

.header-logo-right {
  display: none;
  align-items: center;
  order: 3;
}

/* Account Dropdown Menu */
.account-dropdown {
  display: none;
  align-items: center;
  position: relative;
  gap: 10px;
  order: 4;
  cursor: pointer;
}

.account-dropdown__avatar-wrapper {
  display: flex;
  position: relative;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  font-size: 6px;
  border-radius: 8px;
  overflow: hidden;
}

.account-dropdown__avatar-wrapper img {
  display: none;
  width: 100%;
  height: 100%;
}

.account-dropdown__avatar-wrapper svg {
  display: none;
  width: 70%;
  height: 70%;
  fill: #fff;
}

@media screen and (max-width: 767px) {
  .account-dropdown__avatar-wrapper {
    width: 28px;
    height: 28px;
    border-radius: 4px;
  }
}

.account-dropdown__icon {
  border: none;
  background-color: transparent;
  width: 15px;
  height: 15px;
  padding: 0;
}

.account-dropdown__menu {
  display: block;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 300px;
  background: #12161c;
  color: #f5f5f5;
  border: 1px solid #222;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 10;
  font-family: "Open Sans", sans-serif;
  transition-property: transform, opacity;
  transition-duration: 150ms;
  transition-timing-function: ease;
  pointer-events: none;
  transform-origin: left top;
  opacity: 0;
  transform: scale(1);
  overflow: hidden;
}

.account-dropdown.dropdown--open .account-dropdown__menu {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.account-dropdown__menu .menu-header {
  display: flex;
  flex-direction: column;
  padding: 17px 20px;
  gap: 9px;
  background-color: #17181a;
}

.account-dropdown__menu .account-info {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.account-dropdown__menu .account-info__details {
  display: flex;
  flex-direction: row;
  gap: 9px;
  align-items: center;
}

.account-dropdown__menu .account-info__avatar-wrapper {
  display: flex;
  position: relative;
  width: 40px;
  height: 40px;
  font-size: 6px;
  border-radius: 8px;
  overflow: hidden;
}

.account-dropdown__menu .account-info__avatar img {
  display: none;
  width: 100%;
  height: 100%;
}

.account-dropdown__menu .account-info__avatar svg {
  display: none;
  width: 70%;
  height: 70%;
  fill: #fff;
}

.account-dropdown__menu .account-info__text {
  display: flex;
  flex-direction: column;
  align-items: start;
}

.account-dropdown__menu .account-info__name {
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  line-clamp: 1;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  line-height: 18px;
  max-width: 300px;
  word-break: break-all;
}

.account-dropdown__menu .account-info__plan {
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  word-break: break-word;
  font-size: 11px;
  font-weight: 400;
  line-height: 15px;
  color: rgb(146, 146, 146);
}

.account-dropdown__menu .account-info__email {
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  word-break: break-word;
  font-size: 11px;
  font-weight: 400;
  line-height: 15px;
  color: rgb(146, 146, 146);
  flex: 0 0 auto;
  text-align: center;
}

.account-dropdown__menu .account-info__storage-badge {
  display: none;
  color: #fff;
  border: 1px solid transparent;
  -webkit-tap-highlight-color: transparent;
  line-height: 18px;
  text-decoration: none;
  padding: 0px 4.5px;
  -webkit-box-align: center;
  align-items: center;
  -webkit-box-pack: center;
  justify-content: center;
  width: auto;
  text-transform: uppercase;
  border-radius: 5px;
  letter-spacing: 0.25px;
  text-overflow: ellipsis;
  overflow: hidden;
  box-sizing: border-box;
  -webkit-box-flex: 0;
  flex-grow: 0;
  cursor: pointer;
  height: 28px;
  min-width: 52px;
  font-size: 16px;
  background-color: rgb(55, 56, 60);
  font-weight: 600;
}

.account-dropdown__menu .storage-info {
  display: none;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.account-dropdown__menu .storage-info__meter-wrapper {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.2);
  width: 100%;
  height: 4px;
}

.account-dropdown__menu .storage-info__meter {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  position: absolute;
  top: 0px;
  bottom: 0px;
  left: 0px;
  height: 100%;
  display: flex;
  -webkit-box-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  align-items: center;
  background-color: rgb(49, 152, 252);
  transition: width 100ms linear;
  animation: auto ease 0s 1 normal none running none;
  background-size: 20px 20px;
  background-image: none;
}

.account-dropdown__menu .storage-info__details {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
}

.account-dropdown__menu .storage-info__used {
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  word-break: break-word;
  box-sizing: border-box;
  -webkit-box-flex: 0;
  flex-grow: 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 15px;
  color: rgb(146, 146, 146);
}

.account-dropdown__menu .storage-info__available {
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  word-break: break-word;
  box-sizing: border-box;
  -webkit-box-flex: 0;
  flex-grow: 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 15px;
  color: white !important;
}

.account-dropdown__menu .account-info__plan {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-decoration: none;
  text-decoration: none;
  text-transform: capitalize;
  word-break: break-word;
  font-size: 11px;
  font-weight: 400;
  line-height: 15px;
  color: #929292;
}

.account-dropdown__menu .menu-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 12px 15px 14px 15px;
  background-color: #22262a;
}

.account-dropdown__menu .menu-section {
  display: flex;
  flex-direction: column;
  gap: 0px;
  padding: 5px 10px;
  background-color: rgba(23, 24, 26, 0.5);
}

.account-dropdown__menu .menu-item {
  display: flex;
  align-items: center;
  padding: 5px;
  text-decoration: none;
  background-color: transparent;
  border: 0;
  gap: 10px;
  outline: 0;
}

.account-dropdown__menu .menu-item:hover {
  background-color: rgb(23, 24, 26);
}

.account-dropdown__menu .menu-item__icon {
  width: 30px;
  height: 30px;
}

.account-dropdown__menu .menu-item__text {
  -webkit-tap-highlight-color: transparent;
  color: #fff;
  -webkit-text-decoration: none;
  text-decoration: none;
  font-weight: 600;
  box-sizing: border-box;
  -webkit-box-flex: 0;
  -webkit-flex-grow: 0;
  -ms-flex-positive: 0;
  flex-grow: 0;
  font-size: 13px;
  line-height: 18px;
  word-break: break-all;
}

@media screen and (max-width: 960px) {
  .account-dropdown__avatar-wrapper {
    width: 28px;
    height: 28px;
  }
}

.header-app-icons {
  display: flex;
  flex-flow: row;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 0;
  flex-grow: 0;
  order: 2;
  position: absolute;
}

@media screen and (max-width: 767px) {
  .header-app-icons {
    display: none;
  }
}

.header-app-icon {
  flex-grow: 0;
}

.header-app-icon figure {
  margin: 0;
}

.header-app-icon img {
  object-fit: cover;
  display: block;
}

.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  margin-right: 0.5rem;
  cursor: pointer;
}

.mobile-menu-toggle .book-icon {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

@media (max-width: 767px) {
  .header-logo-right {
    display: none;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    margin-left: -24px;
  }
}

.header-logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header-logo img {
  max-height: 40px;
  width: auto;
}

.header-search {
  order: 2;
  flex: 1;
  max-width: 600px;
}

/* Adjust book-search positioning for header */
.header-search .book-search {
  margin: 0;
}

/* Position search results as dropdown in header */
.book-search-input-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.header-search #book-search-results {
  position: absolute;
  z-index: 300;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  width: 100%;
  list-style: none;
  margin: 10px 0 0;
  padding: 0 20px;
  background-color: var(--header-background);
}

#book-search-results li {
  display: flex;
  flex-direction: column;
  padding: 10px 0 0;
  font-size: 14px;
}

#book-search-results li small {
  margin-top: 4px;
}

/* Language switcher styling */
.book-languages {
  position: absolute;
  right: 2rem;
  top: 2rem;
}

@media screen and (max-width: 767px) {
  .book-languages {
    top: 1.7rem;
  }
}

.book-languages input.toggle:checked + label + ul {
  background-color: rgb(39, 40, 43);
  border-radius: 4px;
  padding: 0.5rem;
}
.book-languages label > img:last-child {
  height: 24px;
  width: 24px;
}
.book-menu input.toggle:checked + label > img:last-child {
  filter: invert(1);
}

.book-languages a > .book-icon {
  display: none;
}

.book-languages ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.5rem;
}

.book-languages li {
  display: inline-block;
}

.book-languages a {
  color: #b0b0b0 !important;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.book-languages a:hover {
  background-color: var(--gray-300) !important;
  color: #ffffff !important;
}

.book-languages li.active a {
  background-color: var(--color-link) !important;
  color: #ffffff !important;
}

/* Full-width container layout */
.container {
  max-width: 100% !important;
  width: 100vw !important;
  margin: 0 !important;
  padding: 0 !important;
}

main.container.flex {
  min-height: calc(100vh - 60px);
  max-width: 100%;
  width: 100%;
}

/* Force dark theme */
body {
  background-color: var(--body-background) !important;
  color: var(--body-font-color) !important;
}

/* Sidebar styling */
.book-menu {
  display: flex;
  background-color: #222225;
  flex-shrink: 0;
  flex-basis: 25%;
  width: 25%;
  min-width: 16rem;
}

@media screen and (max-width: 56rem) {
  .book-menu {
    visibility: visible !important;
    margin-inline-start: unset !important;
    z-index: 1;
  }
  .book-menu .book-menu-content {
    background-color: #222225;
  }
}

/* Mobile layout for sidebar */
@media screen and (max-width: 767px) {
  .book-menu {
    visibility: hidden;
    margin-inline-start: -16rem !important;
  }
}

.book-menu-content {
  width: 100% !important;
  max-width: none !important;
  position: relative !important;
  padding: 2rem 2rem !important;
}

/* User Guide heading - white and bold */
.book-brand > a:first-child {
  color: #ffffff !important;
  font-weight: bold !important;
}

.book-menu a {
  color: var(--body-font-color);
}

.book-menu ul a[href]:hover,
.book-menu ul a[role="button"]:hover {
  color: white;
  opacity: 1;
}

.book-menu a.active {
  background-color: transparent !important;
  color: #ffffff !important;
}

/* Left sidebar menu topics styling */
.book-menu-topics label {
  cursor: pointer;
}

.book-menu-topics li.activeLink {
  background-color: #154777;
  border-radius: 4px;
  font-weight: bold;
}

.book-menu-topics ul a {
  padding: 0.5rem 0;
}

.book-menu-topics ul li label {
  padding-left: 1rem;
}

.book-menu-topics ul ul li {
  padding-inline-start: 1rem;
}

.book-menu-topics li > label > a {
  /* color: #ffffff; */
  font-weight: 600;
}

/* Make parent menu items bold and white when active or when child is active */
.book-menu ul li > ul li > a.active {
  color: #ffffff !important;
}

.book-menu ul li:has(> ul li > a.active) > a {
  font-weight: bold !important;
  color: #ffffff !important;
}

.book-menu ul li > a.active {
  font-weight: bold !important;
  color: #ffffff !important;
}

/* Caret colors - default is #5a5a5b, white when parent is selected */
.book-languages label > img:last-child,
.book-menu-topics label > .book-icon,
.book-menu-topics label > img:last-child {
  width: 24px;
  height: 24px;
}

.book-menu-topics li.active > label .book-icon,
.book-menu-topics li.active > label img,
.book-menu-topics li:has(> ul li > a.active) > label .book-icon,
.book-menu-topics li:has(> ul li > a.active) > label img,
.book-menu-topics input:checked + label .book-icon,
.book-menu-topics input:checked + label img {
  filter: invert(1);
}

.book-menu input:checked + label a {
  color: white;
}

.book-menu-topics > ul > li {
  border-top: 1px solid #37383a;
  padding: 10px 0;
}

/* Header styling */
.book-header {
  background-color: #1e1e1e !important;
  border-bottom: 1px solid var(--gray-300);
}

.book-brand span {
  color: #ffffff;
  font-size: 24px;
}

@media screen and (max-width: 960px) {
  .book-brand span {
    font-size: 16px;
  }
}

@media screen and (max-width: 767px) {
  .book-brand span {
    font-size: 13px;
  }
}

/* Main content area */
.book-page {
  background-color: #171819 !important;
  color: var(--body-font-color);
  flex-basis: 55%;
  width: 55%;
  min-width: 0;
}

/* Section name styling */
.book-section-name {
  color: var(--gray-500) !important;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: #ffffff !important;
  scroll-margin-top: 80px; /* Account for sticky header + extra padding */
}

/* Links */
a {
  color: var(--color-link);
}

a:hover {
  color: #85c1f5;
}

/* Code blocks */
code {
  background-color: #1e1e1e !important;
  color: #e0e0e0 !important;
}

pre {
  background-color: #1e1e1e !important;
  border: 1px solid var(--gray-300);
}

/* Search box */
.book-search input {
  background-color: #1c1b1f !important;
  color: var(--body-font-color) !important;
  font-size: 16px;
}

@media screen and (max-width: 767px) {
  .book-search input {
    font-size: 11px;
  }
}

.book-search input::placeholder {
  color: var(--gray-500) !important;
}

/* TOC (Table of Contents) sidebar */
.book-toc {
  background-color: var(--gray-200) !important;
  border-left: 1px solid #38383c;
  flex-shrink: 0;
  flex-basis: 20%;
  width: 20%;
}
.book-toc-content {
  top: 60px !important; /* Account for header height */
  bottom: 0;
  padding-top: 1rem !important;
  position: sticky !important;
}

.book-toc nav {
  color: var(--body-font-color);
}

.book-toc a {
  color: var(--body-font-color) !important;
}

.book-toc a:hover {
  color: #ffffff !important;
}

/* Active TOC link when content is in view */
.book-toc a.active {
  color: var(--color-link) !important;
}

/* Additional Resources section */
aside.book-toc {
  background-color: #171819 !important;
}

aside.book-toc h3,
aside.book-toc h4 {
  color: #ffffff !important;
  font-weight: 600 !important;
}

/* TOC heading (Contents) */
.book-toc nav > strong,
.book-toc nav > label {
  color: #ffffff !important;
  font-weight: 600 !important;
}

.book-toc .book-toc-content {
  width: 16rem;
  padding: 2rem 1rem;
  top: 70px;
}

/* Scrollbar styling for dark theme */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #5a5a5a;
}

/* Breadcrumb */
.book-breadcrumb {
  color: var(--gray-500) !important;
}

.book-breadcrumb a {
  color: var(--gray-500) !important;
}

/* Tables */
table {
  border-color: var(--gray-300) !important;
}

th {
  background-color: #1e1e1e !important;
  color: #ffffff !important;
}

td {
  border-color: var(--gray-300) !important;
}

tr:hover {
  background-color: var(--gray-300) !important;
}

/* Blockquotes and hints */
.markdown blockquote {
  border-inline-start: none;
}

.markdown .book-hint.info {
  background-color: rgb(34, 38, 42);
}

.markdown .book-hint.tip {
  background-color: rgba(9, 94, 163, 0.2);

  p:before {
    content: "Tip: ";
    color: #008dff;
    font-weight: 700;
  }
}

.markdown .book-hint.note {
  background-color: rgba(255, 166, 0, 0.2);

  p:before {
    content: "Note: ";
    color: #ffa600;
    font-weight: 700;
  }
}

/* Figures */
.figure-image figcaption {
  margin-top: 0px !important;
  color: var(--gray-500);
}

/* Horizontal rule */
hr {
  border-color: var(--gray-300) !important;
}

/* Navigation buttons (prev/next) */
.book-footer a img {
  filter: brightness(0) saturate(100%) invert(35%) sepia(0%) !important;
}

.skeleton:after {
  content: "";
  position: absolute;
  background-color: var(--gray-500);
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  -webkit-animation: shimmer 1500ms linear infinite;
  animation: shimmer 1500ms linear infinite;
  z-index: 11;
}

@keyframes shimmer {
  0% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}
