@font-face {
  font-family: "KH Teka";
  src: url("../assets/fonts/KHTeka-Regular.otf") format("otf"),
    url("../assets/fonts/KHTeka-Bold.otf") format("otf");
  font-weight: normal;
  font-style: normal;
}

/* Apply to navigation elements */
.md-header__title,
.md-nav__title,
.md-nav__item .md-nav__link {
  font-family: "KH Teka";
}

/* Highlight the active tab label with green */
.md-typeset .tabbed-set > input:checked + label {
  color: #00c34e;
  border-bottom: 2px solid #00c34e;
}

/* Ensure unselected tabs have a transparent bottom border (for consistency) */
.md-typeset .tabbed-label {
  border-bottom: 2px solid transparent;
}

/* Change header background color */
.md-header {
  background-color: #f2f2f2 !important;
}

/* Navigation links in header */
.md-tabs {
  background-color: #f2f2f2 !important;
}

/* Navigation links in header */
.md-tabs__list {
  color: #000000 !important;
}
/* Change active tab text color */
.md-tabs__link--active {
  color: #000000 !important;
  font-weight: bold !important;
}
/* Change header text color */
.md-header__title {
  color: #000000 !important;
}

/* Change navigation text color in header */
.md-header__option {
  color: #000000 !important;
}

/* Change color of navigation menu items */
.md-header-nav__link {
  color: #000000 !important;
}

/* Change color of icons (search, menu toggle) */
.md-header__button {
  color: #000000 !important;
}

/* Change repository link color */
.md-header-nav__source {
  color: #000000 !important;
}

/* Navigation link hover */
.md-nav__link:hover {
  color: #b8aea7 !important;
}

:root > * {
  --md-primary-fg-color: #00c34e;
  --md-primary-fg-color--light: #f2f2f2;
  --md-primary-fg-color--dark: #000000;
}
/* Style the copy-to-clipboard button */
pre button.md-clipboard {
  color: black;
  background-color: none;
  border: none;
  border-radius: 4px;
  font-size: 0.75rem;
  padding: 0.3em 0.6em;
  top: 0.5rem;
  right: 0.5rem;
  opacity: 0.8;
  transition: all 0.2s ease-in-out;
}

/* On hover: make it pop */
pre button.md-clipboard:hover {
  color: #00c34e;
  opacity: 1;
  background-color: none;
  transform: scale(1.05);
  cursor: pointer;
}

pre button.md-clipboard {
  top: auto;
  bottom: 0.5rem;
}

.md-typeset h1 {
  color: #000000 !important;
}

.md-footer {
  background-color: #f2f2f2 !important;
  color: #000000 !important;
}

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

.md-footer__link {
  color: #000000 !important;
}

.md-footer__link:hover {
  color: #b8aea7 !important;
}

.md-footer-meta {
  display: none !important;
}

/* Search input field */
.md-search__input:focus {
  background-color: #ffffff !important;
  border-color: #b8aea7 !important;
}

/* Placeholder text */
.md-search__input::placeholder {
  color: #000000 !important;
}

/* Search icon/button */
.md-search__icon {
  color: #000000 !important;
}

.md-search__icon:hover {
  color: #b8aea7 !important;
}

/* Search form container */
.md-search__form {
  background-color: #ffffff !important;
  border-radius: 0 px; /* Optional: adjust border radius */
}

/* Permalink icon color */
.md-typeset .headerlink {
  color: #b8aea7 !important;
  opacity: 0.7;
}

/* Hover state */
.md-typeset .headerlink:hover {
  color: #00c34e !important;
  opacity: 1;
}

/* Start invisible but maintain layout */
.md-typeset .headerlink {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* Show with smooth fade-in on hover */
.md-typeset h1:hover .headerlink,
.md-typeset h2:hover .headerlink,
.md-typeset h3:hover .headerlink,
.md-typeset h4:hover .headerlink,
.md-typeset h5:hover .headerlink,
.md-typeset h6:hover .headerlink,
.md-typeset .headerlink:hover,
.md-typeset .headerlink:focus {
  opacity: 1;
  visibility: visible;
}

/* Make content area wider on all pages */
@media screen and (min-width: 1220px) {
  .md-container {
    display: flex;
    justify-content: center;
  }

  .md-main {
    width: 100%;
    max-width: 100%;
  }

  .md-content {
    max-width: none; /* Remove max-width constraint */
    width: 100%;
  }

  .md-grid {
    max-width: none; /* Remove max-width constraint */
    width: 90%; /* Use 90% of available width */
    grid-template-columns: 15rem 1fr; /* Sidebar + content */
  }

  .md-main__inner {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .md-sidebar--primary {
    width: 15rem; /* Narrower sidebar for more content space */
  }
}

/* Optional: Adjust notebook cell width */
.jp-Notebook,
.jp-Cell {
  max-width: 100%;
}

/* Ensure content uses full available width */
.md-typeset {
  max-width: none;
}

/* Ensure mobile navigation shows all items */
@media screen and (max-width: 1219px) {
  .md-nav__list {
    display: block !important;
  }

  .md-nav__item {
    display: block !important;
  }

  /* Ensure nested navigation items are visible */
  .md-nav__item--nested .md-nav__list {
    display: block !important;
  }

  /* Make sure all navigation sections are expanded on mobile */
  .md-nav__item--nested > .md-nav__link {
    pointer-events: none; /* Prevent collapse on mobile */
  }

  /* Fix mobile navigation completely */
  .md-overlay {
    z-index: 1000 !important;
    pointer-events: none !important; /* Allow clicks through overlay */
  }

  .md-nav--primary {
    z-index: 1200 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 85% !important;
    height: 100vh !important;
    background-color: white !important;
    box-shadow: 2px 0 15px rgba(0,0,0,0.3) !important;
    overflow-y: auto !important;
    pointer-events: auto !important; /* Enable clicks on navigation */
    transform: translateX(-100%) !important; /* Start hidden */
    transition: transform 0.3s ease !important;
  }

  /* Show navigation when drawer is checked */
  [data-md-toggle="drawer"]:checked ~ .md-container .md-nav--primary {
    transform: translateX(0) !important; /* Slide in */
  }

  /* Completely hide header on mobile */
  .md-header {
    z-index: 500 !important;
  }

  /* Hide header when burger menu is open */
  [data-md-toggle="drawer"]:checked ~ .md-container .md-header {
    transform: translateY(-100%) !important;
    transition: transform 0.3s ease !important;
  }

  /* Style the navigation drawer content */
  .md-nav--primary .md-nav__list {
    background-color: white !important;
    padding: 2rem 1rem !important;
    margin: 0 !important;
    min-height: 100vh !important;
  }

  /* Make sure navigation items are clickable */
  .md-nav--primary .md-nav__link {
    pointer-events: auto !important;
    display: block !important;
    padding: 0.5rem 0 !important;
    color: #000000 !important;
  }
}
