/*
 * This file belongs to Hoist, an application development toolkit
 * developed by Extremely Heavy Industries (www.xh.io | info@xh.io)
 *
 * Copyright © 2026 Extremely Heavy Industries Inc.
 */

.xh-appbar {
  .xh-appbar-icon {
    margin-right: var(--xh-pad-px);
  }

  .xh-appbar-title {
    color: var(--xh-appbar-title-color);
    font-size: var(--xh-appbar-title-font-size-px);
    margin-right: var(--xh-pad-px);
  }

  .xh-app-menu-button {
    // Menu button might be on left or right of appBar - add right margin when on left only.
    &:first-child {
      margin-right: var(--xh-pad-px);
    }

    &__user-profile {
      border-radius: 50%;
      border: var(--xh-border-solid);
      cursor: pointer;
      height: 32px;
      line-height: 31px;
      text-align: center;
      width: 32px;
    }

    // Trigger profile-specific hover styles on parent button hover
    &:hover .xh-app-menu-button__user-profile {
      color: var(--xh-appbar-user-profile-hover-color);
      border-color: var(--xh-appbar-user-profile-hover-color);
      background-color: transparent;
    }
  }
}

//------------------------
// Blueprint overrides
//------------------------
.bp6-navbar,
.bp6-dark .bp6-navbar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  color: var(--xh-appbar-color);
  background-color: var(--xh-appbar-bg);
  height: var(--xh-appbar-height-px);
  border-bottom: 1px solid var(--xh-appbar-border-color);
  padding: 0 var(--xh-pad-px);
  box-shadow: var(--xh-appbar-box-shadow); // Remove thick inner shadow

  // Curiously, Admin Log Viewer would cause appbar to shrink without min-height
  min-height: var(--xh-appbar-height-px);

  .bp6-navbar-divider {
    border-left-color: var(--xh-tbar-separator-color);
  }

  > * {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .bp6-navbar-heading {
    color: var(--xh-appbar-title-color);
    font-size: var(--xh-appbar-title-font-size-px);
    margin-left: var(--xh-pad-px);
  }

  .bp6-navbar-group {
    overflow: hidden;
    height: var(--xh-appbar-height-px);

    .bp6-navbar-divider {
      margin: 0 var(--xh-pad-px);
    }

    // Replace default float behaviour in favour of flexbox
    float: none;

    > .svg-inline--fa {
      margin: 0 5px 0 0;
    }

    &.bp6-align-left {
      // Flex simulates left alignment
      flex: 1;

      // Primary app icon
      > svg:first-child {
        color: var(--xh-appbar-title-color);
      }
    }

    &.bp6-align-right {
      // Apply standardized spacing to extra appBar items, excepting dividers and xh-no-pad elements.
      > *:not(.bp6-navbar-divider):not(.xh-no-pad) {
        margin-left: var(--xh-pad-px);
      }

      .bp6-navbar-divider {
        margin-right: 0;
      }
    }
  }
}
