@import "./variables.css";

.menu {
    border-radius: 0 16px 0 0;
    background: var(--staticDark);
    width: 195px;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -moz-box-orient: vertical;
    -moz-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: start;
    -webkit-justify-content: flex-start;
    -moz-box-pack: start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    height: 100vh;
    padding-top: 24px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 15;
}
.menu-item, .item-item {
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -moz-box-align: center;
  -ms-flex-align: center;
  align-items: center;
    text-align: center;
    padding: 12px 8px;
    cursor: pointer;
    width: 100%;
  position: relative;
}
.menu-item-item {
    text-align: center;
    padding: 3px 0;
}
.item-name {
    display: block;
    color: #CACFD3;
    text-align: center;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    letter-spacing: 0.3px;
  margin-left: 8px;
  position: relative;
}
.hidden-label .item-name {
    display: none;
}
.arrow-down {
  position: absolute;
  right: 8px;
  top: 25px;
  transform: rotate(-90deg);
  transition: 0.3s;
}
/* section headers and the Pinned header are buttons; they keep the menu-item look */
:where(button.menu-item) {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}
.menu-item-content {
    display: block;
    overflow: hidden;
    background: var(--staticDark2);
}
/* the list scrolls inside the sidebar when it is taller than the window (GitLab does the same);
   flyouts and the collapsed sidebar's panels are fixed beside it, so the scroll box does not clip them */
.menu-items {
  width: 100%;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
a.menu-item {
  display: block;
}
.data-sync .menu-item:hover {
  background: #04345D;
}
.menu-item.active {
    background: #2E353E;
}
.active .menu-item-content {
    height: calc(100vh - 267px);
    overflow: auto;
}
.menu-item-content::-webkit-scrollbar, .menu::-webkit-scrollbar, .hovered-container::-webkit-scrollbar {
  width: 4px;
}
.menu-item-content::-webkit-scrollbar-track, .menu::-webkit-scrollbar-track, .hovered-container::-webkit-scrollbar-track {
  background: var(--staticDark);
}
.menu-item-content::-webkit-scrollbar-thumb, .menu::-webkit-scrollbar-thumb, .hovered-container::-webkit-scrollbar-thumb {
  background: var(--btn-hover);
}
.menu-item-content::-webkit-scrollbar-thumb:hover, .menu::-webkit-scrollbar-thumb:hover, .hovered-container::-webkit-scrollbar-thumb:hover {
  background: var(--btn-hover);
  opacity: 0.5;
}
.active .arrow-down {
  display: block;
}
.child-menu-content {
  position: fixed;
  top: 72px;
  left: 196px;
  width: 0;
  background: #1E2329;
  padding: 24px 0;
  height: calc(100vh - 72px);
  overflow: hidden;
  transition: 0.3s ease;
}
.open {
  width: 200px;
  padding: 24px 16px;
}
.menu-item + .dropdown-container {
  position: static;
}
.content-item, .content-item .name_ {
  color: #A9B0BC;
  padding: 4px 0;
  position: relative;
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
}

.content-item img {
  margin-left: 12px;
}
.content-menu-title {
  margin-bottom: 8px;
  color: #FFF;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-align: left;
}
.mobile-menu {
  position: fixed;
  left: -100%;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--staticDark);
  width: 100%;
  z-index: 9;
  visibility: hidden; /* closed: off screen and out of the Tab order once it has slid away */
  transition: left 0.3s, visibility 0s linear 0.3s;
}
.mobile-menu .close-mob-menu {
  color: #CACFD3; /* the menu is dark in both modes (btn-close would inherit the page's text colour) */
}
.mobile-menu-header .header-logo img{
  width: 36px;
  margin-right: 8px;
}
.mobile-menu-header .header-logo {
  font-size: 14px;
}
.mobile-menu-header {
  padding: 16px;
  border-bottom: 1px solid rgb(255 255 255 / .12);
}
.mobile-menu-content .menu-item {
  text-align: left;
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -moz-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}
.open-menu {
  left: 0;
  visibility: visible;
  transition: left 0.3s, visibility 0s;
}
.active-child-menu {
  background: #1E2329;
}
.active-item, .menu-items .dropdown-open .click-dropdown {
  background: var(--staticBg);
}
.header-logo span {
  line-height: 100%;
}
.pinned-items-container {
  border-bottom: 1px solid var(--pinned-border-color);
}
.dropdown-open .arrow-down {
  transform: rotate(0);
}
.hovered-container {
  position: fixed;
  top: var(--cf-menu-top, 72px);
  left: 193px;
  background: var(--staticDark) !important;
  padding: 16px 6px 16px 0;
  display: none;
  width: 223px;
  height: calc(100vh - var(--cf-menu-top, 72px));
  overflow: auto;
  border-left: 1px solid var(--cf-primary);
}
.hovered-container .item-name {
  margin-left: 0;
}
/* flyouts are opened by shell.js (mouse hover with a grace period, GitLab-style) */
.dropdown-container.flyout-open > .hovered-container {
  display: block;
}
.item-img {
  width: 32px;
}
/* pin button: outline pin, filled while the row is hovered or the page is pinned */
.pin-icon {
  position: absolute;
  top: 5px;
  right: 1px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #8C95A6;
  cursor: pointer;
}
.pin-icon .icon {
  width: 16px;
  height: 16px;
}
.item-item:is(:hover, :focus-within) .pin-icon, .content-item:is(:hover, :focus-within) .pin-icon {
  display: flex;
}
.item-item:hover .pin-icon, .pin-icon.pinned, #pinnedContent .pin-icon {
  color: var(--btn-hover);
}
.item-item:hover .pin-icon .icon, .pin-icon.pinned .icon, #pinnedContent .pin-icon .icon {
  --cf-icon: url(/images/pin-16-filled.svg); /* absolute: resolved by components/icon.css */
}
#emptyText {
  padding: 10px 16px;
  color: #CACFD3;
  font-size: 14px;
}
.hovered-container .pin-icon {
  top: 5px;
}
.has-not-item-img {
  padding-left: 46px !important;
}
#pinnedContent .name_ {
  font-size: 14px;
  margin-left: 0;
}
#pinnedContent .content-item {
  padding: 5px 0;
}
.open .has-not-item-img, .hovered-container .has-not-item-img {
  padding-left: 0 !important;
}
.content-item:hover .name_ {
  color: #FFFFFF !important;
}
.content-item .name_ {
  font-size: 14px;
}
/* in a link row the link fills the row, the pin sits on top at the end */
.content-item > a.name_ {
  flex: 1;
}
.has-item-img {
  position: relative;
}
.has-drop-item:after {
  content: url("/images/menu-arrow-right.svg");
  position: absolute;
  top: 6px;
  right: 5px;
  transform: rotate(-90deg);
}
.pinned-items .has-drop-item:after {
  display: none !important;
}
.has-drop-item .pin-icon {
  right: 15px;
}


/* menu new styles */

.menu-logo-container {
  position: relative;
  width: 100%;
  text-align: center;
  border-bottom: 1px solid var(--pinned-border-color);
  padding-bottom: 7px;
  padding-top: 3px;
}
.menu-toggler {
  border: 0;
  background: none;
  position: absolute;
  top: -27px;
  right: 6px;
}

.menu-closed {
  width: 88px;
}
.menu-closed .menu-item {
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -moz-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
}
.menu-closed .menu-item .item-name, .menu-closed .arrow-down {
  display: none !important;
}
.new, .dropDown {
  padding-top: 30px;
}
.new .menu-items .dropdown-content {
  position: fixed;
  top: var(--cf-menu-top, 72px);
  left: 88px;
  max-height: calc(100vh - var(--cf-menu-top, 72px)) !important;
  height: 100vh;
  display: none;
  width: 200px;
  padding-top: 28px;
}
.new .dropdown-container {
  position: static;
}
.new .has-not-item-img {
  padding-left: 20px !important;
}
.new .content-menu-title {
  padding-left: 20px !important;
}
.new .dropdown-open .arrow-down {
  transform: rotate(-90deg);
}
.th-padding {
  padding-left: 83px;
}
.tc-padding {
  padding-left: 118px;
}
.menu-items > .dropdown-container:has(.active-item) .menu-item {
    background: var(--menuActive) !important;
  position: relative;
}
.dropDown:hover .dropdown-container:has(.active-item) .menu-item {
  border-right: 4px solid var(--cf-primary);
}
/*.menu-items > .dropdown-container:has(.active-item) .menu-item::after {*/
/*  content: var(--iconTop);*/
/*  position: absolute;*/
/*  right: 0;*/
/*  top: -14px;*/
/*}*/
/*.menu-items > .dropdown-container:has(.active-item) .menu-item::before {*/
/*  content: var(--iconBottom);*/
/*  position: absolute;*/
/*  right: 0;*/
/*  top: 50px;*/
/*}*/
.new .menu-items .dropdownPin-menu {
  position: fixed;
  top: calc(var(--cf-menu-top, 72px) - 19px);
  left: 88px;
  max-height: calc(100vh - var(--cf-menu-top, 72px)) !important;
  height: 100vh;
  width: 200px;
  padding-top: 28px;
}
.new .dropdownPin {
  position: static;
}
.dropDown .content-menu-title {
  display: none;
}
.hovered-container .content-menu-title {
  display: block;
  padding-left: 16px;
}
.dropDown .has-not-item-img {
  padding-left: 18px !important;
}

.dropDown  .menu-items .dropdown-open .dropdown-menu.dropdown-active {
  max-height: calc(100vh - 352px);
}

.dropDown .pinned-items .has-not-item-img {
  padding-left: 14px !important;
}
.dropDown .pin-icon {
  display: flex !important;
}
.menu-closed .hovered-container {
  left: 88px;
}

.dropdownPin {
  position: relative;
  width: 100%;
}

.dropdownPin-toggle {
  padding: 10px 8px;
  cursor: pointer;
}

.dropdownPin-menu {
  display: none;
  overflow: hidden;
  max-height: 0;
  pointer-events: none;
  transition: max-height 0.3s linear;
}

.pinned-items .show {
  max-height: 300px;
  pointer-events: auto;
  display: block;
  overflow: auto;
}

.dropdownPin-item {
  padding: 8px 12px;
  cursor: pointer;
}

.dropdownPin-item:hover {
  background: #f0f0f0;
}
.pinned-items .arrow-down {
  top: 19px;
}
.menu-closed .hovered-container {
  display: none !important;
}
.dropdownPin.flyout-open > .hovered-container {
  display: block;
}
.dropdownPin:has(.show) .hovered-container {
  display: none !important;
}
.menu-closed .dropdownPin-menu .pin-icon {
  display: block;
}
.other-menu-section {
  border-top: 1px solid var(--cf-primary);
  padding-top: 15px;
  margin-top: 5px;
}



@media (max-width: 900px) {
  /* the Pinned list takes only the room it needs (it was forced to the full panel height) */
  .mobile-menu-content .dropdownPin-menu {
    height: auto;
    max-height: 40vh;
  }
  .menu {
    display: none;
  }
  .mobile-menu-content  .arrow-down {
    display: none !important;
  }
  .menu-item {
    padding: 16px;
  }
  #content .hovered-container {
    display: none;
  }
  .mobile-menu .select {
     margin: 16px auto 0;
    max-width: 92%;
   }
  .select .filter:after {
    top: 16px !important;
    right: 16px !important;
  }
  .item-item, .menu-item-item {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
  }
  .item-item {
    padding: 0 16px;
    width: 100%;
  }
  .menu-item-item {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -moz-box-orient: vertical;
    -moz-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    -moz-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start;
  }
  .menu-item-content {
    overflow: auto;
    height: calc(100vh - 300px);
  }
  .menu-item-item {
    position: relative;
  }
  .menu-items {
    margin-top: 8px;
  }
  .child-menu-content {
    position: relative;
    top: 7px;
    left: 0;
  }
  .child-menu-content {
    height: 0;
    overflow: hidden;
    width: 100%;
    padding: 0;
    position: relative;
  }
  .child-menu-content.open {
    height: auto;
    padding: 0 16px 12px 50px;
  }
  .content-item {
    padding: 10px 0;
  }
  .content-menu-title {
    display: none;
  }
  .dropdown-open .click-dropdown {
    background: transparent;
  }
  .dropdown-active .child-menu-content {
    background: #1E2329;
  }
  .menu-item, .menu-item-item .child-menu-content, .item-item {
    position: relative;
  }
  .menu-item:after {
    content: url("../images/drop-arrow.svg");
    position: absolute;
    right: 16px;
    top: 20px;
  }
  .item-item:after {
    content: url("../images/drop-arrow.svg");
    position: absolute;
    right: 30px;
    top: 7px;
  }
  .menu-item-item .child-menu-content:after {
    content: url("../images/drop-arrow.svg");
    position: absolute;
    right: 11px;
    top: -35px;
  }
  .menu-item-item .open:after {
    content: url("../images/drop-arrow-green.svg");
    background: #252b32;
  }
  .dashboard-item:after {
    display: none;
  }
  .dropdown-open .menu-item:after {
    content: url("../images/drop-arrow-green.svg");
  }
  .menu-item-item {
    padding: 0;
  }
  .search-form-content {
    z-index: 1;
  }
  .mobile-menu .form-select {
    width: calc(100% - 32px);
    margin: 16px 16px 0 16px;
    border-color: rgb(255 255 255 / .15);
    background-color: var(--staticBg);
    color: #CACFD3;
    color-scheme: dark; /* the menu is dark in both modes, so is the list */
  }
  .mobile-menu .header-logo {
    color: #FFF !important;
  }

  .mobile-menu .choices__item {
    color: #CACFD3 !important;
  }
  .mobile-menu .choices__list--dropdown .choices__item--selectable.is-highlighted, .mobile-menu  .choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
    background-color: var(--staticDark2) !important;
  }
  .mobile-menu .choices__list input[type=search] {
    border: 1px solid rgb(255 255 255 / .15) !important;
    background-color: var(--staticBg) !important;
    color: #CACFD3 !important;
  }
  .menu-items .dropdown-open .dropdown-menu.dropdown-active {
    height: auto;
  }
  .pinned-items .item-item:after{
    display: none;
  }
  .pin-icon {
    display: flex;
    right: 7px;
    top: 10px;
  }
  .content-menu-content .content-item {
    padding: 3px 0;
    font-size: 14px;
  }
  .child-menu-content .pin-icon {
    top: 5px;
  }
   .item-item:after {
    display: none;
  }
   .has-drop-item:after {
    display: block !important;
     transform: rotate(0);
     top: 11px;
  }
   .pinned-items .has-drop-item:after {
     display: none !important;
   }
}
