// Omnisearch https://github.com/scambier/obsidian-omnisearch
@media only screen and (max-width: 600px) {
  .omnisearch-input-container__buttons {
    padding: 0 8px;
  }
}
@media only screen and (min-width: 600px) {
  .omnisearch-input-container__buttons {
    margin-inline-end: 4px;
  }
}
.omnisearch-input-field {
  width: 100%;
}
.omnisearch-input-container__buttons button {
  box-shadow: none;
  border: var(--input-border-width) solid var(--background-modifier-border);
}
body:not(.is-mobile) .omnisearch-input-container__buttons {
  display: none;
}
body:is(.layout-cards, .layout-border) {
  @media only screen and (max-width: 600px) {
    .omnisearch-input-container__buttons {
      padding: 0;
    }
  }
  @media only screen and (min-width: 600px) {
    .omnisearch-input-container__buttons {
      margin-inline-end: 0;
    }
    .omnisearch-input-container__buttons button {
      height: var(--prompt-input-height);
    }
  }
  .omnisearch-input-container {
    margin: 8px 8px 0;
    border-bottom-width: 0;
  }
}

// Notebook Navigator https://github.com/johansan/notebook-navigator
body {
  --nn-theme-mobile-nav-bg: transparent;
  --nn-theme-nav-header-bg: transparent;
  --nn-theme-nav-bg: transparent;
  --nn-theme-list-header-bg: transparent;
  --nn-theme-list-bg: transparent;

  --nn-theme-navitem-selected-bg: var(--background-modifier-hover);
  --nn-theme-navitem-selected-inactive-bg: var(--background-modifier-hover);
  --nn-theme-file-tag-bg: var(--tag-background);
  --nn-theme-file-tag-color: var(--tag-color);

  --nn-theme-mobile-list-header-link-color: var(--icon-color);
  --nn-theme-mobile-toolbar-button-active-bg: var(--interactive-accent);
  --nn-theme-mobile-toolbar-button-icon-color: var(--icon-color);
  --nn-theme-mobile-toolbar-button-active-icon-color: var(--text-on-accent);

  --nn-theme-navitem-border-radius: var(--radius-m);
  --nn-theme-file-border-radius: var(--radius-m);

  .notebook-navigator {
    background-color: transparent;
  }
}
body:not(.is-mobile) .view-content.notebook-navigator {
  padding: 0 !important;

  .nn-split-container.nn-single-pane {
    .nn-navigation-pane .nn-pane-header,
    .nn-navigation-pane-scroller {
      border-right: none;
    }
  }
  .nn-virtual-container {
    margin-bottom: 32px;
  }
  .nn-search-input {
    height: 100% !important;
  }

  .nn-pane-header {
    padding: 8px 16px;
    height: auto;
  }
  .nn-header-actions button.nn-icon-button {
    padding: 8px;
    min-width: unset;
    height: auto;
  }
}
body.is-mobile .view-content.notebook-navigator-mobile {
  .nn-pane-header,
  .nn-mobile-title {
    padding: 0;
  }
}
body:is(.layout-cupertino, .layout-macos).mobile-immersive .view-content.notebook-navigator-mobile {
  --nn-scroller-padding: 0;

  .nn-back-button,
  .nn-mobile-toolbar {
    backdrop-filter: var(--blur-s);
    box-shadow: var(--shadow-xs);
    border: none;
    background-color: transparent;
    border-radius: 100vh;
  }
}
body.mobile-immersive .view-content.notebook-navigator-mobile {
  .nn-nav-bottom-spacer,
  .nn-list-bottom-spacer {
    height: calc(var(--safe-area-inset-bottom-override) + 64px);
  }
  .nn-mobile-toolbar {
    position: absolute;
    inset: auto 0 var(--safe-area-inset-bottom-override);
    margin: 0 auto;
    border: var(--border-width) solid var(--background-modifier-border);
    border-radius: 100vh;
    background: var(--background-secondary);
    padding: 4px;
    height: 48px;
    width: fit-content;
  }
  .nn-mobile-toolbar-button {
    width: unset;
    height: unset;
    min-width: unset;
    min-height: 100%;
    max-height: 100%;
    padding: 12px;

    span {
      display: flex;
    }
  }
}

// Hider https://github.com/kepano/obsidian-hider
.hider-sidebar-buttons.mod-macos {
  --frame-left-space: calc(80px - var(--ribbon-width));
}
.hider-sidebar-buttons .sidebar-toggle-button.mod-right,
.hider-sidebar-buttons .sidebar-toggle-button.mod-left {
  display: flex;
  visibility: hidden;
  width: 0;
  opacity: 0;
}

// Quick Explorer https://github.com/pjeby/quick-explorer
.obsidian-themepocalypse:not(.qe-hide-breadcrumbs) {
  --status-bar-radius: 0;
  --status-bar-border-width: 0;
  --status-bar-background: transparent;

  #quick-explorer .explorable {
    color: var(--text-faint);
    transition: var(--anim-duration-fast);
  }

  #quick-explorer .explorable.selected,
  #quick-explorer .explorable:hover {
    background-color: transparent;
    color: var(--text-normal);
  }

  .status-bar {
    width: 100%;
    transform: none !important;
    opacity: 1 !important;

    &::before {
      content: none !important;
    }
  }

  &.status-bar-cupertino .status-bar {
    margin: 4px 0;

    &:hover {
      margin: 0;
      box-shadow: none;
      backdrop-filter: none;
      border: none;
    }
  }

  &:is(.layout-cupertino, .layout-cards, .layout-border):not(.is-mobile) {
    .workspace-split {
      padding-bottom: 0 !important;
    }
    .status-bar {
      bottom: 8px;
      right: 8px;
    }
  }
}
