/* Base Styles */
:root {
  --main-nav-height: 60px;
  --scrollbar-width: calc(100vw - 100%);
  overscroll-behavior: none;
}

body,
footer {
  background-color: #fff;
  font-family: "Segoe UI", "Roboto", "Helvetica Neue", "Ubuntu", sans-serif;
  font-size: 14px;
  color: #5c5c5c;
  margin: 0px;
  /* auto wrap for long links or text */
  overflow-wrap: anywhere;
}

/* Header Styles */
.public-page__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh; 
  width: 100%;

  @media screen and (max-width: 768px) {
    height: 100%;
    width: 100%;
    flex-direction: column;
  }
}

.public-page__content__header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-height: var(--main-nav-height);
}

.public-page__content__header--overlay {
  background-color: #fff;
  box-shadow: 0px 4px 2px -2px #0000001A;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 999;
}

.header-logo {
  /* margin-bottom: 8px; */
}

.public-page__content__header-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  padding: 10px;

  @media screen and (max-width: 768px) {
    flex-direction: column;
    align-items: stretch;
  }

  .public-page__content__header-row--left {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
  }
}

.public-page__content__header-row.second-nav {
  padding: 0px;
}

.public-page__content__header__title {
  font-size: 24px;
}

.public-page__content__header__links {
  display: flex;
  gap: 24px;

  @media screen and (max-width: 768px) {
    display: none;
  }

  a {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    text-decoration: none;
    color: #353A44;
    font-size: 14px;
    line-height: 19px;
    letter-spacing: 0em;
    text-align: left;
  }

  a.active,
  a.active:hover {
    color: rgb(84, 105, 212);
    border-bottom: 2px solid rgb(84, 105, 212);
  }

  a:hover {
    color: #000;
  }
}

/* Content Styles */
.public-page__content__body {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--main-nav-height)); 
  scrollbar-width: thin;
  
  @media (max-width: 768px) {
    height: 100%;
    width: 100%;
  }
}

.main_content_page {
  /* padding: 10px; */
  width: 90%;
  margin: 0px 180px;
  margin-top: var(--main-nav-height);
  font-family: inherit;
  line-height: 26px;
  font-weight: 400;
  font-size: 18px;

  @media (max-width: 768px) {
    padding: 10px;
    margin: 0;
    margin-top: 45px;
  }
}



.toc a {
  text-decoration: none;
}

.toc-sidebar{
  margin-top: 30px;
}

.content-main {
  margin-left: 320px;
  @media screen and (max-width: 768px) {
    margin-left: 0;
    padding: 20px;
  }
}

.doc-content {
  max-width: 1200px !important;
  padding: 60px;
  margin: 0 auto;

  @media screen and (max-width: 768px) {
    padding: 5px !important;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  /* Fix responsive img for old doc  */
  span[style*="overflow: hidden"][style*="transform: rotate(0.00rad)"] {
    max-width: 100% !important;
    height: auto !important;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  span[style*="overflow: hidden"] img {
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block;
    transform: none !important;
    -webkit-transform: none !important;
  }
}

.responsive-iframe-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  /* 16:9 ratio (360/640 = 0.5625, then 0.5625 * 100 = 56.25%) */
  overflow: hidden;
}

.responsive-iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* For youtube video iframe not contain .responsive-iframe-container */
@media (max-width: 768px) {
  iframe {
    max-width: 100% !important;
    height: auto !important;
  }
}

.responsive-img-container img {
  max-width: 100% !important;
  height: auto !important;
  object-fit: cover;
  border: none;
}

/* Table Styles */
table {
  border: 1px solid #E8E7E4;
  border-radius: 4px;
  margin: 20px 0;
  border-collapse: collapse;
}

td {
  padding: 10px;
  border: 1px solid #E8E7E4;
}

/* Table of Contents Styles */
.toc-section {
  display: flex;
  flex-direction: column;
  display: none;
   /*padding-left: 24px; 
  margin-top: 10px; */
  margin-left: 16px;
  gap: 3px;
  transition: all 0.3s ease-in-out;
  max-height: 0;
  overflow: hidden;
}

.toc-section.show-toc {
  display: flex;
  max-height: 1000px; /* Adjust based on your content */
}

.toc-link {
  width: 250px;
  line-height: 20px;
  color: #353A44;
  font-family: -apple-system, "system-ui", "Segoe UI", Inter, "Helvetica Neue", Ubuntu, sans-serif;
}

.toc-link-h1 {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0em;
  text-align: left;
  cursor: pointer;
  /* margin-top: 16px; */
  padding-left: 20px;
  padding: 5px;
  display: flex;
  transition: all 0.2s ease-in-out;

  &:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
  }

  .toc-link-text {
    margin-left: 12px;
  }
}

.toc-link-h1.toc-section-title {
  padding-left: 0;

  .toc-link-text {
    margin-left: 10px;
  }
}

.toc-section-title::before {
  content: url(/assets/chevron-right-27c4c335415fcf0c3918826a446e23f98ac504bfe4ffa75bfb2e4a857c520c1f.png);
  display: inline-block;
  transition: transform 0.3s ease-in-out;
}

.toc-link-h2 {
  font-family: Inter;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0em;
  text-align: left;
  padding: 5px;
  transition: all 0.2s ease-in-out;
}

.toc-link-h2:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.toc-link-h1.active-link, .toc-link-h2.active-link {
  display: flex;
  align-items: center;
  font-weight: 400;
  background-color: #F0F0F0;
  border-radius: 4px;
  transition: all 0.2s ease-in-out;
}

.show-toc {
  display: flex;
}

.active-toc::before {
  content: url(/assets/chevron-down-ed3a451a337a812bc312426d4c20de09855078c6c72007b6779f710d8debb44b.png);
  display: inline-block;
  transition: transform 0.3s ease-in-out;
}

/* Footer Styles */


/* Logo and Title Styles */
.public-page__header__logo {
  max-width: 150px;
  max-height: 50px;

  @media screen and (max-width: 500px) {
    max-width: 90px;
  }
}

.title {
  font-size: 24px;
  font-weight: bold;
  margin: 0;
  padding: 0;
}

/* Search Styles */
.search-container {
  position: relative;
  display: flex;
  min-width: 100px;
  margin-left: auto;
  margin-right: 20px;
  @media screen and (max-width: 768px) {
    display: none;
  }
}


#searchBox {
  position: relative;
  background: #FFFFFF;
  border-radius: 5px;
  border: 1px solid #D9D9D9;
  display: flex;
  align-items: center;
  padding: 0 10px;
  max-width: 500px;
  min-width: 300px;
  width: 100%;
  height: 36px;
  outline: none;
}

.search-input {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
  flex: 1;
}

.searchIcon {
  width: 15px;
  height: 15px;
}

#searchInput {
  border: none;
  outline: none;
  width: 100%;
  font-size: 14px;
  color: #353A44;
}

#searchInput::placeholder {
  color: #8A8F98;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #D9D9D9;
  border-radius: 5px;
  margin-top: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 1000;
}

.search-results.active {
  display: block;
}

.search-result-text {
  padding: 10px;
  font-size: 12px;
  color: #8A8F98;
  border-bottom: 1px solid #D9D9D9;
}

#searchResults {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 300px;
  overflow-y: auto;
}

#searchResults li {
  padding: 8px 10px;
  cursor: pointer;
}

#searchResults li:hover {
  background-color: #F5F5F5;
}

#searchResults a {
  text-decoration: none;
  color: #353A44;
  display: block;
}

.switch_locale_link,
.support_info {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  font-family: Inter;
  font-size: 14px;
  font-weight: 400;
  line-height: 17px;
  letter-spacing: 0em;
  text-align: left;
  color: #596171;
  text-decoration: none;
  padding-left: 20px;
}

.support_info {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.nav_link,
.nav-link {
  text-decoration: none;
  color: #252729;
  font-weight: 500;
  font-size: 14px;
  line-height: 18px;
  padding: 10px 15px 10px 15px;
  font-family: Inter;
}

.nav_link:hover,
.nav-link:hover {
  opacity: 0.65;
}

.active-link {
  background-color: #F0F0F0;
  border-radius: 4px;
}

.active-nav-link {
  border-bottom: 2px solid blue;
}

.header-nav-list {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-left: 24px;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  @media screen and (max-width: 768px) {
    display: none;
  }
}

.sub_title {
  font-family: Inter;
  font-size: 12px;
  font-weight: 600;
  line-height: 14px;
  text-align: left;
  text-transform: uppercase;
  color: #9b9b9b;
}

.doc_group_navlink {
  display: flex;
  gap: 1rem;
  margin-left: 1rem;
}

.doc_navlink {
  display: inline-flex;
  align-items: center;
  padding: 1rem 0;
  color: #6F747C;
  text-decoration: none;
  font-family: Inter;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-align: left;
}

.doc_navlink:hover {
  border: 1px gray solid;
}

.hidden {
  display: none !important;
}

.mobile-nav-list {
  display: none;
}

.mobile-nav-list.mobile-nav-list--active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: 30px 0px 20px 20px;
  background-color: #F3F5F7;
  position: fixed;
  z-index: 999;
  width: 100%;
  min-height: 60px;

  a {
    font-size: 14px;
    font-weight: 500;
  }

  .active-link {
    background-color: #fff;
    border-bottom: 1px solid #F3F5F7;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  }
}

.nav_navigation-lists {
  line-height: 40px;
}

/* Search Modal Styles */
.search-modal-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-modal-item {
  display: block;
  padding: 12px 0 10px 18px;
  text-decoration: none;
}

.search-result-parent {
  font-size: 0.97em;
  color: #7b7b7b;
  margin-top: 2px;
}

.search-result-title {
  font-weight: 500;
  font-size: 1.08em;
  color: #222;
}

.search-matches {
  margin-top: 4px;
}

.search-match-line {
  color: #475569;
  margin-bottom: 2px;
  white-space: pre-line;
  font-size: 0.97em;
  padding-left: 8px;
}

.search-match-line.no-matches {
  color: #b91c1c;
}

.search-modal-item:hover .search-match-line {
  background: #f1f5f9;
}

.wrapper {
  display: flex;
  flex-direction: row;
  height: 100%;
  gap: 10px;
  
  @media screen and (max-width: 768px) {
    height: 100%;
    margin: 0;
    padding: 10px;
  }
}

.container-right{
  float: right;
  height: 100%;
  width: 100%;
  flex-grow: 1;
  overflow-y: auto;
  scrollbar-width: thin;
}

.container-left {
  float: left;
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  height: 100%;
  @media screen and (max-width: 768px) {
    display: none;
    left: 0;
    align-items: left;
  }
}

.footer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: start;
  flex-shrink: 0;
  width: 100%;
  gap: 10px;
  padding: 15px;
  border-right: 1px solid gainsboro;
  border-top: 1px solid gainsboro;
  background: #F3F5F7;
  text-align: center;
  margin-top: auto;

  @media screen and (max-width: 768px) {
    display: none;
  }
}

.toc {
  background: #F3F5F7;
  overflow-x: hidden;
  border-right: 1px solid #E4E4E4;
  width: 100%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  height: 100%;
  /* margin-top: 8px; */
  padding: 15px;
  overflow-y: auto;
  overflow-x: hidden;
  
  @media screen and (max-width: 768px) {
    display: none;
    left: 0;
    align-items: left;
  }

  .toc-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    flex-grow: 1;
    gap: 6px;
    @media screen and (max-width: 768px) {
      margin-top: 0;
    }
  }  

  .toc-link-text{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    font-size: 14px;
    font-weight: 400;
  }  
}

.scroll-nojump {
  width: 100%
}

@media screen and (min-width: 1536px) {
  .scroll-nojump {
    margin-left: var(--scrollbar-width);
    margin-right: 0;
    width: calc(100% - var(--scrollbar-width))
  }

  body:has(.page-full-width) .scroll-nojump {
    margin-left: 0;
    width: 100%
  }
}

/* Mobile Nav Styles */
.public-page__header-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  gap: 16px;
  
  @media screen and (max-width: 768px) {
    justify-content: flex-start;
  }

  ul {
    list-style: none;
  }

  a {
    text-decoration: none;
    color: inherit;
  }
}
  
.header-items {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-direction: row;

  @media screen and (max-width: 640px) {
    display: none;
    gap: 8px;
  }
}

.header-nav-items{
  display: none;
  width: 100%;
}

.header-items--show-mobile {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  position: absolute;
  right: 0;
  top: var(--main-nav-height);
  width: 100%;
  background: #F3F5F7;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  height: calc(100vh - var(--main-nav-height));
  overflow-y: auto;
  
  @media screen and (max-width: 640px) {
    display: flex;
  }

  ul {
    width: 100%;
    padding: 0;
    margin: 0;
  }

  li {
    width: 100%;
    border-bottom: none;
  }

  li:last-child {
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  }

  .nav_link {
    display: block;
    color: #1F2937;
    font-size: 14px;
    transition: background-color 0.2s ease;
    width: 100%;

    &:hover {
      background-color: rgba(0, 0, 0, 0.05);
    }

    span {
      display: block;
    }
  }

  .header-nav-items {
    display: block;
  }
}

ul ul {
  .nav_link {
    padding-left: 40px;
    font-size: 14px;
  }
}

.mobile-toggle {
  display: none;

  @media screen and (max-width: 640px) {
    display: block;
    margin-left: -10px;
  }
}

.mobile-toggle__button {
  background: #fff;
  padding: 10px;
  cursor: pointer;
}

.mobile-toggle--active {
  background: #F3F5F7;
}

.mobile-toggle__button__icon {
  display: none;
}

.mobile-toggle__button__icon--active {
  display: block;
}
