/* Global Styles */

:root {
  --primary-color: rgb(30, 83, 160);
  --primary-color-rgb: 30, 83, 160;
  --primary-dark-color: rgb(26, 48, 70);
  --primary-medium-color: rgb(35, 119, 213);
  --primary-accent-color: rgb(127, 201, 206);

  --toolbar-height: 50px;
  --link-color: var(--primary-color);
  --link-color-hover: var(--primary-medium-color);
  --grey: #bcbec0;
  --grey-lighten-1: #e6e7e8;
  --grey-lighten-2: #f1f2f2;
}

html {
  scroll-padding-top: var(--toolbar-height);
}

body {
  font-family: "Roboto", Arial, Helvetica, sans-serif;
}

h1,
h2 {
  font-weight: bold !important;
  color: var(--primary-dark-color) !important;
}

h3,
h4,
h5,
h6 {
    font-weight: 500 !important;
    color: var(--primary-dark-color) !important;
}

a {
  text-decoration: none;
  color: var(--link-color);
}

a:hover {
  opacity: 85%;
}

.background-grey-lighten-2 {
  background-color: var(--grey-lighten-2);
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--primary-color) !important;
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--primary-medium-color);
    --bs-btn-hover-border-color: var(--primary-medium-color);
    --bs-btn-focus-shadow-rgb: var(--primary-accent-color);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--primary-color);
    --bs-btn-active-border-color: var(--primary-color);
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--primary-accent-color);
    --bs-btn-disabled-border-color: var(--primary-accent-color);
}

.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

    .btn-primary:hover {
        background-color: var(--primary-medium-color);
        border-color: var(--primary-medium-color);
    }

    .btn-primary:focus {
        background-color: var(--primary-medium-color);
    }

    .btn-primary:active {
        background-color: var(--primary-medium-color);
    }

:hover.button {
  opacity: 75%;
}

.code-text {
  font-family: "Courier New", monospace;
}

.divider-light-blue {
  border-top: 3px solid var(--primary-accent-color);
  margin: 2em 0 2em 0;
  opacity: 1;
}

.icon-light {
  color: var(--primary-accent-color);
}

:hover.icon-light {
  opacity: 75%;
}

.icon-dark {
  color: var(--primary-color);
}

:hover.icon-dark {
  opacity: 75%;
}

.icon::before {
  /* removed font- based rules */
  display: inline-block;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
}

/* Style Edits to Bootstrap Components */

.card-title {
  font-weight: 500;
  color: var(--primary-dark-color);
}

.card {
  height: 100%;
}

.card-primary {
  border-radius: 0;
  border-left: 8px solid var(--primary-color);
  background-color: var(--grey-lighten-2);
}

.card-secondary {
  border-radius: 0;
  border-left: 8px solid var(--primary-dark-color);
  background-color: var(--grey-lighten-2);
}

.card-accent {
  border-radius: 0;
  border-left: 8px solid var(--primary-accent-color);
  background-color: var(--grey-lighten-2);
}

.list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Main Layout */

.layout {
  display: flex;
  justify-content: center;
  scroll-padding-bottom: 45px;
  margin-top: var(--toolbar-height);
}

/* Prevent horizontal overflow on main content */
.container {
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

/* Ensure code blocks, tables, and pre elements wrap or scroll within themselves */
.container pre,
.container code,
.container table {
  max-width: 100%;
  overflow-x: auto;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Search Bar Styles */

@media (max-width: 768px) {
  .DocSearch-Modal {
    top: 0;
    position: fixed !important;
  }
}

.DocSearch-Button {
  margin: 0 !important;
}

.DocSearch-Container {
  font-family: "Roboto", Arial, Helvetica, sans-serif !important;
}

/* Nav Menu Styles */

.menu-position {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.menu-btn {
  margin: 0 5px 0 5px;
  display: inline-block;
  outline: none;
  color: transparent;
  border: none;
  background-color: transparent;
}

@media only screen and (max-width: 768px) {
  .menu-btn {
    margin-right: 4px;
    margin-left: 4px;
  }
}

.page-menu {
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;
}

.menu-brand {
  font-style: normal;
  font-weight: 400;
  font-size: 1.5rem;
  margin-left: 5px;
}

.menu-chapter-title {
  font-style: normal;
  font-weight: 300;
  font-size: 1.2rem;
  text-overflow: ellipsis;
  cursor: pointer;
}

.menu-progress {
  font-style: normal;
  font-weight: 200;
  font-size: 1rem;
}

.has-tooltip {
  position: relative;
  display: inline-block;
}

.has-tooltip .tooltip-text {
  visibility: hidden;
  width: 120px;
  background-color: var(--grey-lighten-1);
  color: var(--primary-color);
  text-align: center;
  font-size: 1rem;
  padding: 5px;
  border-radius: 6px;
  width: 120px;
  top: 120%;
  left: 50%;
  margin-left: -60px;
  position: absolute;
  z-index: 1;
}

.has-tooltip:hover .tooltip-text {
  visibility: visible;
}

.has-tooltip .tooltip-text::after {
  content: " ";
  position: absolute;
  bottom: 100%; /* At the top of the tooltip */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent var(--grey-lighten-1) transparent;
}

.has-tooltip:hover .sidebar-tooltip-text {
  transition-delay: 1s;
  transition-property: visibility;
}

.has-tooltip .sidebar-tooltip-text {
  width: 90px;
  position: relative;
  left: 5rem;
  border-radius: 10px;
  padding: 10px;
  white-space: normal;
}

.has-tooltip .sidebar-tooltip-text:after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  position: absolute;
  border-width: 5px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid var(--grey-lighten-1);
  left: -9%;
  bottom: 30%;
}

.nav-link {
    color: white;
}

.nav-link:hover {
    color: var(--primary-accent-color);
}

.nav-item .active {
    color: var(--primary-accent-color);
}

.account-nav-link {
    color: black;
}

.account-nav-link:hover {
    color: var(--primary-accent-color);
}

.account-nav-item .active {
    color: var(--primary-accent-color);
}

/* Page Navigation Arrow Buttons */

.turn-page {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 2rem;
  top: auto;
  transform: none;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  padding: 0 0.5rem;
  height: auto;
  pointer-events: none; /* allow buttons to be clickable only */
  margin-left: 0;
}

.turn-page .arrow-btn {
  pointer-events: auto;
}

/* Hide turn-page buttons on mobile when sidebar is open */
@media only screen and (max-width: 768px) {
  /* Hide buttons when sidebar is open on mobile (sidebarSmall class is used) */
  body:has(.sidebarSmall) .turn-page {
    display: none;
  }
  
  .turn-page {
    bottom: 4rem;
    margin-left: 0;
  }
}

/* Adjust turn-page positioning when sidebar is visible on larger screens */
@media only screen and (min-width: 769px) {
  .layout.has-sidebar .turn-page {
    margin-left: 375px; /* Same as sidebar width */
  }
}

.turn-page .arrow-btn {
  display: block;
  border-radius: 3rem;
  background-color: var(--primary-color);
  background: var(--primary-color);
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
  cursor: pointer;
  text-align: center;
  position: relative;
}

.turn-page .arrow-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
}

.turn-page-tooltip {
  position: relative;
  display: block;
  text-align: center;
}

.turn-page-tooltip:hover .turn-page-tooltip-text {
  visibility: visible;
}

.turn-page-tooltip .turn-page-tooltip-text {
  visibility: hidden;
  position: absolute;
  z-index: 2;
  top: -15px;
  max-width: 50vw;
  width: 200px;
  color: var(--primary-color);
  font-size: 1rem;
  background-color: var(--grey-lighten-1);
  border-radius: 10px;
  padding: 10px;
  word-break: break-word;
  white-space: normal;
}

.turn-page-tooltip .tooltip-right {
  left: 3rem;
}

.turn-page-tooltip .tooltip-left {
  right: 3rem;
}

/* Chapter Navigation Sidebar Styles */

.sidebar {
  width: 375px;
  height: 100%;
  overflow-y: auto;
  position: sticky;
  top: var(--toolbar-height);
  max-height: calc(100vh - var(--toolbar-height));
}

.sidebar .hide {
  display: none;
}

.sidebarSmall {
  background-color: white;
  position: fixed;
  width: 100%;
  z-index: 5;
  padding-bottom: 6rem;
  /*occupy the whole screen so that its the only scrollable content*/
  max-height: 120vh;
}

@media only screen and (max-width: 768px) {
  .noScrollOnSmallScreen {
    /*prevent body from being scrollable when sidebar is open*/
    overflow-y: hidden;
  }
}

.filter-input-container {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem;
    box-sizing: border-box;
}

.filter-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}

.filter-btn {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-left: none;
    background-color: #007bff;
    color: white;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

    .filter-btn .fa-search {
        font-size: 1rem;
    }


/* Table of Contents For Chapters */

.toc-menu {
  color: black;
}

.toc-tree {
  padding-right: 0.25em;
  font-size: 1rem;
}

.toc-label {
  color: black;
  background-color: white;
  text-align: left;
  font-size: 1rem;
  margin-top: 5px;
  cursor: pointer;
  border: none;
}

.toc-content {
  color: black;
  text-align: left;
  padding-left: 25px;
  cursor: pointer;
}

.toc-tree .divider {
  margin: 0.5em 0 0.5em 0;
}

.tree {
  margin-left: -25px;
  --spacing: 1.6rem;
}

.tree li {
  list-style: none;
  position: relative;
  padding-left: 0px;
  padding: 5px 0 5px 0;
}

.tree ul li {
  padding-left: 20px;
}

.tree ul {
  margin-left: 8px;
  padding-left: 0;
}

details > summary {
  list-style: none;
  position: relative;
}

details > summary::-webkit-details-marker {
  display: none;
}

.tree summary:focus {
  outline: none;
}

.tree summary:focus-visible {
  outline: none;
}

.tree summary::before {
  font: var(--fa-font-solid);
  content: "\f054";
  display: block;
  position: absolute;
  font-size: 0.75rem;
  left: 0px;
  top: 4px;
}

.tree details[open] > summary::before {
  font: var(--fa-font-solid);
  content: "\f078";
  display: block;
  position: absolute;
  left: 0px;
  top: 4px;
}

.tree summary.nested::before {
  font: var(--fa-font-solid);
  content: "\f054";
  display: block;
  position: absolute;
  font-size: 0.75rem;
  left: -20px;
  top: 4px;
}

.tree details[open] > summary.nested::before {
  font: var(--fa-font-solid);
  content: "\f078";
  display: block;
  position: absolute;
  font-size: 0.75rem;
  left: -20px;
  top: 0px;
  width: 19px;
}

.tree details[open] > summary::before {
  font: var(--fa-font-solid);
  content: "\f078";
  display: block;
  position: absolute;
  font-size: 0.75rem;
  left: 0px;
  top: 4px;
}

.section-link {
  font-style: normal;
  text-decoration: none;
  color: black;
}

.current-section {
  font-weight: bold;
  text-decoration: none;
  color: #11356a;
}

.current-li {
  background-color: #e6e7e8;
  border-radius: 15px;
}

.toc-padding {
  padding-top: 15px;
  padding-right: 18px;
  padding-left: 15px;
  scrollbar-gutter: stable;
}

/* Top Banner Bar */

.header-background {
  height: var(--toolbar-height);
  width: 100%;
  display: flex;
  justify-content: center;
  background: var(--primary-dark-color);
  position: fixed;
  top: 0;
  z-index: 2;
  padding: 0 2em;
}

@media only screen and (max-width: 540px) {
  .header-background {
    padding: 0 1em;
  }
}

.banner {
  height: var(--toolbar-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
}

.banner-main-label {
  font-style: normal;
  font-weight: 300;
  font-size: 2rem;
  margin-top: 5px;
  margin-bottom: 5px;
  margin-right: 5px;
  margin-left: 5px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.banner-main-label-center {
  margin-top: 10px;
  margin-right: 5px;
  margin-left: 5px;
}

/* Content Hiding Styles */

.hide-on-mobile {
  display: block;
}

@media only screen and (max-width: 768px) {
  .hide-on-mobile {
    display: none;
  }
}

.show-on-mobile {
  display: none;
}

@media only screen and (max-width: 768px) {
  .show-on-mobile {
    display: block;
  }
}

.show {
  display: block;
}

.hide {
  display: none;
}

/* Page Footer */

.footer {
  padding: 1em 2em;
  bottom: 0;
  width: 100%;
  background-color: var(--grey-lighten-2);
}

@media only screen and (max-width: 768px) {
  .footer {
    text-align: center;
  }
}

.footer .footer-link {
  display: block;
  justify-content: right;
  padding-left: 1em;
}

/* Home Page Styles */

.quote {
  max-width: 600px;
  display: inline-block;
  margin: 40px 0 20px 0;
}

.quote .quote-author {
  padding-top: 20px;
  text-align: right;
}

.quote .quote-content {
  position: relative;
}

.quote .quote-content .quote-text {
  font-size: large;
  text-align: center;
  background-color: var(--grey-lighten-2);
  padding: 25px 20px 20px 20px;
}

.quote .quote-content .quote-icon {
  color: var(--primary-accent-color);
  position: absolute;
  top: -30px;
  left: 20px;
  z-index: 1;
  font-size: 40px;
}

.quote .quote-content .quote-text::after {
  content: " ";
  position: absolute;
  top: 100%;
  left: 85%;
  margin-left: -5px;
  border-width: 15px;
  border-style: solid;
  border-color: var(--grey-lighten-2) transparent transparent transparent;
}

/* Anchor Styling */
.heading-wrapper:not(:hover) .anchor-link:not(:focus-visible) {
    opacity: 0;
}

.anchor-link {
    border: none;
    color: var(--link-color);
    text-decoration: none;
    position: absolute;
    font-size: 14px;
    margin: 4px 2px;
    transition-duration: 0.4s;
    cursor: pointer;
    background-color: transparent;
}

    .anchor-link:hover {
        color: var(--link-color-hover);
    }


/* The snackbar - position it at the bottom and in the middle of the screen */
#snackbar {
  visibility: hidden; /* Hidden by default. Visible on click */
  min-width: 250px; /* Set a default minimum width */
  margin-left: -125px; /* Divide value of min-width by 2 */
  background-color: #333; /* Black background color */
  color: #fff; /* White text color */
  text-align: center; /* Centered text */
  border-radius: 2px; /* Rounded borders */
  padding: 16px; /* Padding */
  position: fixed; /* Sit on top of the screen */
  z-index: 1; /* Add a z-index if needed */
  left: 50%; /* Center the snackbar */
  bottom: 30px; /* 30px from the bottom */
}

/* Show the snackbar when clicking on a button (class added with JavaScript) */
#snackbar.show {
  visibility: visible; /* Show the snackbar */
  /* Add animation: Take 0.5 seconds to fade in and out the snackbar.
        However, delay the fade out process for 2.5 seconds */
  -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
  animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

/* Animations to fade the snackbar in and out */
@-webkit-keyframes fadein {
  from {
    bottom: 0;
    opacity: 0;
  }

  to {
    bottom: 30px;
    opacity: 1;
  }
}

@keyframes fadein {
  from {
    bottom: 0;
    opacity: 0;
  }

  to {
    bottom: 30px;
    opacity: 1;
  }
}

@-webkit-keyframes fadeout {
  from {
    bottom: 30px;
    opacity: 1;
  }

  to {
    bottom: 0;
    opacity: 0;
  }
}

@keyframes fadeout {
  from {
    bottom: 30px;
    opacity: 1;
  }

  to {
    bottom: 0;
    opacity: 0;
  }
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  color: #fff;
  background-color: #1b6ec2;
  border-color: #1861ac;
}

button.accept-policy {
  font-size: 1rem;
  line-height: inherit;
}

/*vue transitions*/

.slide-fade-enter-active {
  transition: all 0.3s ease-out;
}

.slide-fade-leave-active {
  transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
}

.slide-fade-enter-from,
.slide-fade-leave-to {
  transform: translateX(-20px);
  opacity: 0;
}

/*end transitions*/

/* Captcha Modal Styles */
.captcha-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000; /* Higher than chat widget */
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.3s ease-out;
}

.captcha-modal-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideInScale 0.4s ease-out;
}

.captcha-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    text-align: center;
}

.captcha-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: #1976d2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.captcha-modal-content {
    padding: 24px;
    text-align: center;
}

.captcha-explanation {
    margin: 0 0 24px;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.8);
}

.captcha-widget-container {
    display: flex;
    justify-content: center;
    margin: 24px 0;
    min-height: 78px; /* hCaptcha widget height */
}

.captcha-help-text {
    margin: 24px 0 0;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
    font-style: italic;
}

/* Modal animations */
@keyframes slideInScale {
    0% {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
}

/* Responsive adjustments for mobile */
@media (max-width: 480px) {
    .captcha-modal-card {
        width: 95%;
        margin: 16px;
        border-radius: 12px;
    }
    
    .captcha-modal-header {
        padding: 20px 16px 12px;
    }
    
    .captcha-modal-content {
        padding: 20px 16px;
    }
    
    .captcha-modal-title {
        font-size: 18px;
    }
    
    .captcha-explanation {
        font-size: 15px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .captcha-modal-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .captcha-modal-card {
        border: 2px solid #000;
    }
    
    .captcha-modal-header {
        border-bottom-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .captcha-modal-overlay,
    .captcha-modal-card {
        animation: none;
    }
    
    .captcha-modal-overlay {
        opacity: 1;
    }
    
    .captcha-modal-card {
        transform: none;
    }
}
