/* @eox/ui imports inside of main.js */

/* App-wide Variables */
:root,
body.light,
body.dark {
  /* general */
  --sapBackgroundColor: var(--surface-container);
  --sapContent_HeaderShadow: none;
  --sapFontHeaderFamily: Inter, sans-serif;
  --sapGroup_ContentBackground: var(--surface-container);
  --sapPageHeader_Background: var(--surface-container);
  --sapTextColor: var(--on-surface);

  /* Luigi side bar */
  --luigi__left-sidenav--width: 240px;
  --sapFontFamily: "Inter", sans-serif;
  --sapFontBoldFamily: "Inter", sans-serif;
  --sapButton_FontFamily: "Inter", sans-serif;

  /* Luigi shell bar */
  --luigi__shellbar--height: 50px !important;
}
@media screen and (max-width: 599px) {
  :root {
    --luigi__left-sidenav--width: 100%;
  }
}

/* General settings and helpers */
html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  letter-spacing: 0.0313rem;
}

body.dark .dark-mode-inverse-monochrome {
  filter: contrast(0) brightness(2);
}

/* Fix for BeerCSS main style making main full-height on mobile devices */
:has(> main) {
  min-block-size: unset !important;
  margin: 0 !important;
}

/* App layout */
#app-container {
  height: 100%;
  display: grid;
  grid-template:
    "main" 1fr
    "footer" 35px
    / 1fr;
}

#app-container footer {
  grid-area: footer;
  min-block-size: unset;
  border-top: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.75rem;
  line-height: 0.75rem;
  padding: 1rem;
  color: var(--on-surface);
}
#app-container footer #footer-content-left,
#app-container footer #footer-content-left a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
@media screen and (max-width: 599px) {
  #app-container footer #footer-content-left > span {
    display: none;
  }
}
#app-container footer .footer-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.4rem;
}
#app-container footer .footer-links a {
  text-decoration: underline;
  color: var(--primary);
}

/* Scroll bars */
/* Explicitly add scrollbar styling to the .scroll helper class */
*::-webkit-scrollbar,
*::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-button {
  background: none;
  inline-size: 0.4rem;
  block-size: 0.4rem;
}

*:is(:hover, :focus)::-webkit-scrollbar-thumb {
  background: var(--outline);
  border-radius: 1rem;
}

/* Luigi side bar overrides */
.lui-fd-side-nav-wrapper {
  padding: 0.5rem;
}
.fd-side-nav {
  --sapGroup_ContentBorderColor: var(--outline-variant);
  --sapList_Background: var(--surface-container-lowest);
  --sapList_SelectionBackgroundColor: var(--surface-container);
  --sapList_Hover_Background: var(--surface-container-low);
  --sapList_Hover_SelectionBackground: var(--surface-container);
  --sapList_Active_Background: var(--surface-container);
  --sapList_Active_TextColor: var(--on-surface);
  --sapList_TextColor: var(--on-surface);
  --sapList_GroupHeaderBackground: var(--surface-container-lowest);
  --sapList_GroupHeaderTextColor: var(--on-surface);
  --sapList_GroupHeaderBorderColor: var(--outline-variant);
}
.fd-nested-list {
  --fdNestedList_Link_Height: auto !important;
  --fdNestedList_Title_Font_Size: 0.875rem !important;
  --fdNestedList_Item_Padding_Left: 0rem !important;
  --fdNestedList_Item_Padding_Right: 0rem !important;
  --sapList_BorderWidth: 0;
}
.fd-nested-list__group-header {
  align-items: center !important;
}
.lui-category {
  padding: 0.5rem 0.5rem 0 0.5rem !important;
  margin-top: 0 !important;
  border-top: none !important;
  color: var(--outline) !important;
}
.lui-category:not(:first-child) {
  margin-top: 0.5rem !important;
}
.fd-nested-list__group-header,
.fd-nested-list__content.has-child .fd-nested-list__link {
  height: auto !important;
  font-weight: unset !important;
  --sapList_BorderWidth: 1px !important;
  border-bottom: none !important;
}
.fd-nested-list__content.has-child:hover {
  background: none;
}
.fd-nested-list__content.has-child:hover .fd-nested-list__link {
  background: var(--sapList_Hover_Background);
  border-radius: 0.5rem 0 0 0.5rem;
}
.fd-nested-list__content.has-child button {
  padding: 0.5rem;
  height: 34px;
  border-radius: 0 0.5rem 0.5rem 0;
}
.fd-nested-list__content.has-child .fd-button > [class*="sap-icon"]:before {
  font-size: 0.875rem;
  color: var(--on-surface);
}
.fd-nested-list--text-only.level-2 {
  --fdNestedList_Item_Padding_Left: 2rem !important;
  --fdNestedList_Item_Padding_Right: 0rem !important;
}
.fd-nested-list__link {
  border: none !important;
  border-radius: 0.5rem;
  padding-block: 0.5rem !important;
  padding-inline-start: calc(
    var(--fdNestedList_Item_Padding_Left) + 0.5rem
  ) !important;
  padding-inline-end: calc(
    var(--fdNestedList_Item_Padding_Right) + 0.5rem
  ) !important;
  height: 33px !important;
}
/* Skeleton loaders */
.fd-nested-list__link.loader {
  padding: 2px;
  background: linear-gradient(
    90deg,
    var(--surface-container) 30%,
    var(--sapList_Background) 50%,
    var(--surface-container) 70%
  );
  background-size: 400%;
  animation: shimmer 1.5s infinite linear;
}
@keyframes shimmer {
  0% {
    background-position: 100% 100%;
  }
  100% {
    background-position: 0 0;
  }
}
.fd-nested-list__link .fd-counter--notification,
.fd-navigation__link .fd-counter--notification {
  margin-right: 0 !important;
}
.fd-nested-list__icon {
  min-width: 0 !important;
  margin-left: 0 !important;
}
.fd-nested-list__icon[class*="sap-icon--"],
.fd-nested-list__icon:has(img) {
  color: var(--on-surface) !important;
  margin-right: 1rem;
  width: 20px !important;
  height: auto !important;
}
.fd-nested-list__group-header .fd-nested-list__icon[class*="sap-icon--"] {
  width: 16px !important;
}
.fd-nested-list__icon,
.fd-nested-list__icon > img {
  max-width: 20px !important;
  max-height: 20px !important;
}
.fd-nested-list__icon[class*="sap-icon--"]::before {
  font-size: 1rem;
}

body.dark .fd-nested-list__icon > img,
body.dark .fd-nested-list__link > svg,
body.dark .fd-shellbar__button img,
body.dark .fd-menu__item img,
body.dark .fd-menu__addon-before img {
  filter: contrast(0) brightness(2);
}

/* Luigi shell bar overrides */
.fd-shellbar {
  --sapShellColor: var(--surface-container-lowest);
  --sapShell_TextColor: var(--on-surface);
  --fdShellbar_Title_Color: var(--primary);
  --fdButtonIconColor: var(--on-surface);
  border-bottom: 1px solid var(--outline-variant) !important;
}
/* If no logo is set, remove it completely */
.fd-shellbar__branding:has(.fd-shellbar__logo--image-replaced):not(
    :has(.lui-shellbar-single-app-title)
  ) {
  display: none;
}
.fd-shellbar__logo--image-replaced {
  background-image: none !important;
  width: 0 !important;
  margin: 0 !important;
}
.fd-shellbar .fd-shellbar__button.is-hover,
.fd-shellbar .fd-shellbar__button:hover,
.fd-shellbar .fd-shellbar__button.is-active,
.fd-shellbar .fd-shellbar__button:active {
  border-radius: 2rem;
  --sapShell_Hover_Background: color-mix(
    in srgb,
    var(--primary) 10%,
    transparent
  );
  --sapShell_Active_Background: color-mix(
    in srgb,
    var(--primary) 10%,
    transparent
  );
}
.fd-shellbar__branding.is-hover,
.fd-shellbar__branding:hover {
  border-radius: 2rem;
  --fdShellBar_Branding_Background: color-mix(
    in srgb,
    var(--primary) 10%,
    transparent
  ) !important;
}
.fd-shellbar .fd-shellbar__button.lui-burger {
  margin-left: -0.5rem;
}
.fd-shellbar .fd-button--menu {
  border-radius: 2rem;
  border-color: var(--outline-variant);
  --fdShellbar_Title_Color: var(--primary);
  --sapFontHeader5Size: 0.875rem;
  padding-inline: 0.75rem;
}
body.dark .fd-shellbar .fd-button--menu {
  --fdShellbar_Title_Color: var(--on-surface);
}
@media screen and (max-width: 599px) {
  body.lui-simpleSlideInNav.lui-leftNavToggle .fd-app__sidebar {
    box-shadow: none;
  }
}

/* Luigi profile menu overrides */
.lui-username {
  font-size: 0.875rem !important;
}

/* Luigi popover/menu overrides */
.fd-popover__body,
.fd-product-switch__body,
.fd-menu__item {
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  --sapList_Background: var(--surface-container-lowest);
  --sapList_SelectionBackgroundColor: var(--surface-container);
  --sapList_Hover_Background: var(--surface-container-low);
  --sapList_Hover_SelectionBackground: var(--surface-container);
  --sapList_Active_Background: var(--surface-container);
  --sapList_Active_TextColor: var(--on-surface);
  --sapList_TextColor: var(--on-surface);
  --sapGroup_TitleTextColor: var(--on-surface);
  --sapGroup_ContentBackground: var(--surface-container-lowest);
  --fdMenu_Item_Background_Color: var(--surface-container-lowest);
  --fdMenu_Icon_Color: var(--on-surface);
  --fdMenu_Shortcut_Color: var(--on-surface);
  --fdMenu_Text_Color: var(--on-surface);
}

.fd-menu__link:active {
  --fdMenu_Text_Color: var(--on-surface) !important;
}

/* Luigi tabs overrides */
.fd-icon-tab-bar__header {
  --sapObjectHeader_Background: var(--surface-container-lowest);
  --fdIconTabBar_Tag_Color: var(--on-surface);
  --fdIconTabBar_Overflow_Button_Background: transparent;
  --fdIconTabBar_Overflow_Button_Text_Color: var(--on-surface);
  --fdIconTabBar_Overflow_Button_Icon_Color: var(--on-surface);
  --sapButton_Hover_Background: color-mix(
    in srgb,
    var(--primary) 10%,
    transparent
  );
  --sapButton_Hover_BorderColor: var(--outline-variant);
  --sapButton_Active_Background: color-mix(
    in srgb,
    var(--primary) 10%,
    transparent
  );
  --sapButton_Active_BorderColor: var(--outline-variant);
  --fdIconTabBar_Overflow_Button_Border_Color: var(--outline-variant);
  --fdIcon_Tab_Bar_Overflow_Button_Text_Color: var(--on-surface);
  --fdIcon_Tab_Bar_Overflow_Button_Icon_Color: var(--on-surface);
  --fdIcon_Tab_Bar_Overflow_Button_Text_Color_Hover: var(--on-surface);
  --fdIcon_Tab_Bar_Overflow_Button_Icon_Color_Hover: var(--on-surface);
}
.fd-icon-tab-bar__tab.is-selected,
.fd-icon-tab-bar__tab[aria-selected="true"] {
  --fdIconTabBar_Tag_Color: var(--primary);
}

/* Luigi breadcrumbs overrides */
.lui-breadcrumb-container {
  background: var(--surface-container-lowest);
  border-bottom: 1px solid var(--outline-variant);
}

/* Gets hidden by luigi automatically after init */
[luigi-app-loading-indicator] {
  width: 100%;
  height: 100%;
  background: white !important;
  position: absolute;
  transition: opacity 0.7s;
}

.fd-button[class*="-compact"] {
  width: 40px;
  height: 40px;
  max-height: none;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--primary);
}

.fd-button[class*="-compact"]:hover {
  box-shadow: none;
}

.fd-button[class*="-compact"]:hover:after {
  content: "";
  background-image: radial-gradient(circle, currentColor 1%, transparent 1%);
}

/* Custom loading spinner */
/* Also replaces fiori loader with custom spinner */
.fd-busy-indicator,
.fd-busy-indicator div {
  all: unset;
}

.lds-ring,
.fd-busy-indicator,
.lds-ring div,
.fd-busy-indicator div {
  box-sizing: border-box;
}

.lds-ring,
.fd-busy-indicator {
  display: inline-block;
  position: absolute;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  margin-left: -20px;
  color: #004170 !important;
  /* transition: opacity 0.7s; */
}

.lds-ring {
  top: 50%;
  left: 50%;
}

.fd-busy-indicator {
  top: 0;
  left: 0;
}

.lds-ring div,
.fd-busy-indicator div {
  box-sizing: border-box;
  display: block;
  position: absolute;
  width: 40px;
  height: 40px;
  margin: 8px;
  border: 4px solid currentColor;
  border-radius: 50%;
  animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  border-color: currentColor transparent transparent transparent;
}

.lds-ring div:nth-child(1),
.fd-busy-indicator div:nth-child(1) {
  animation-delay: -0.45s;
}

.lds-ring div:nth-child(2),
.fd-busy-indicator div:nth-child(2) {
  animation-delay: -0.3s;
}

.lds-ring div:nth-child(3),
.fd-busy-indicator div:nth-child(3) {
  animation-delay: -0.15s;
}

@keyframes lds-ring {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Snackbar */
.error {
  background-color: var(--error) !important;
  color: var(--on-error) !important;
}
.snackbar {
  position: fixed;
  inset: auto auto 6rem 50%;
  inline-size: 80%;
  block-size: auto;
  z-index: 200;
  visibility: hidden;
  display: flex;
  box-shadow: var(--elevate2);
  color: var(--inverse-on-surface);
  background-color: var(--inverse-surface);
  padding: 1rem;
  cursor: pointer;
  text-align: start;
  align-items: center;
  border-radius: 0.25rem;
  gap: 0.5rem;
  transition: all var(--speed2);
  transform: translate(-50%, 1rem);
  opacity: 0;
}
@media only screen and (min-width: 993px) {
  .snackbar {
    inline-size: 40%;
  }
}
.snackbar:is(.active) {
  visibility: visible;
  transform: translate(-50%);
  opacity: 1;
}
@media screen and (max-width: 599px) {
  .lui-shellbar-wrapper {
    column-gap: 0 !important;
  }
}

@media (max-width: 425px) {
  .fd-shellbar__group--product .fd-shellbar__separator,
  .fd-shellbar__group--product .fd-shellbar__title {
    display: none;
  }
}

.ntf {
  position: relative;
}

.ntf-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  position: relative;
  color: var(--on-surface);
}

.ntf-btn .mdi {
  font-size: 20px;
}

.ntf-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--error);
  color: var(--on-error);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

.ntf-panel {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 360px;
  max-height: 520px;
  display: flex;
  flex-direction: column;
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  font-family: inherit;
}

.ntf-panel[hidden] {
  display: none;
}

.ntf-head,
.ntf-filter-bar {
  flex-shrink: 0;
}

.ntf-main {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ntf-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border-radius: 0 0 10px 10px;
}

.ntf-filter-overlay {
  position: absolute;
  top: -7px;
  left: 16px;
  right: 16px;
  bottom: 8px;
  z-index: 1;
  pointer-events: none;
}

.ntf-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 8px;
}

.ntf-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--on-surface);
}

.ntf-link {
  font-size: 13px;
  text-decoration: underline;
  color: var(--on-surface-variant);
}

.ntf-count {
  font-size: 11px;
}

.ntf-filter-bar {
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--outline-variant);
}

.ntf-filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}

.ntf-filter-btn:hover {
  background: color-mix(
    in srgb,
    var(--on-surface) 6%,
    var(--surface-container-lowest)
  );
}

.ntf-filter-btn:focus-visible {
  outline: 2px solid var(--outline);
  outline-offset: 1px;
}

.ntf-filter-chevron {
  font-size: 18px;
  color: var(--on-surface-variant);
  transition: transform 0.15s;
}

.ntf-filter-btn[aria-expanded="true"] .ntf-filter-chevron {
  transform: rotate(180deg);
}

.ntf-filter-menu {
  box-sizing: border-box;
  max-height: 100%;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  pointer-events: auto;
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

.ntf-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin: 6px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--on-surface);
  cursor: pointer;
}

.ntf-filter-option:hover {
  background: color-mix(in srgb, var(--on-surface) 8%, transparent);
}

.ntf-filter-option.selected {
  background: var(--surface-container-high);
  font-weight: 600;
}

.ntf-filter-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ntf-filter-logo {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
}

.ntf-filter-all {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-container-high);
}

.ntf-filter-all .mdi {
  font-size: 14px;
  color: var(--on-surface-variant);
}

.ntf-filter-btn .ntf-count,
.ntf-filter-option .ntf-count {
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
}

.ntf-filter-option.selected .ntf-count {
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
}

.ntf-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface-container-lowest);
  border-bottom: 1px solid var(--outline-variant);
  cursor: pointer;
}

.ntf-item.unread {
  background: var(--surface-container);
}

.ntf-content {
  flex: 1;
  min-width: 0;
}

.ntf-body {
  font-size: 14px;
  line-height: 1.4;
  color: var(--on-surface);
}

.ntf-body a {
  color: inherit;
  text-decoration: underline;
}

.ntf-time {
  font-size: 12px;
  color: var(--on-surface-variant);
  margin-top: 4px;
}

.ntf-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 24px 16px;
  color: var(--on-surface-variant);
  font-size: 14px;
  text-align: center;
}

.ntf-logos {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.ntf-logo,
.ntf-globe {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.ntf-logo {
  object-fit: cover;
}

.ntf-globe {
  background: var(--surface-container-high);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ntf-globe .mdi {
  font-size: 16px;
  color: var(--on-surface-variant);
}

.ntf-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.15s;
}

.ntf-toggle:hover {
  background: color-mix(in srgb, var(--on-surface) 8%, transparent);
}

.ntf-toggle:focus-visible {
  outline: 2px solid var(--outline);
  outline-offset: 1px;
}

.ntf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--on-surface-variant);
  background: transparent;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}

.ntf-item.unread .ntf-dot {
  background: var(--on-surface);
  border-color: var(--on-surface);
}

@media (max-width: 599px) {
  .ntf-panel {
    position: fixed;
    top: var(--ntf-mobile-top, 56px);
    left: 12px;
    right: 12px;
    width: auto;
    margin-top: 0;
    max-height: calc(100dvh - var(--ntf-mobile-top, 56px) - 12px);
  }
}
