@import '../../../../../style/variables.less';

/** 顶部 */
.pro-layout-header {
  position: fixed;
  top: 0;
  z-index: 98;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 64px;
  padding: 0 32px 0px 0px;
  line-height: 64px;
  background:
    var(--header-bg-image) no-repeat top center / 100% auto,
    #f7f9fd;
  box-shadow: none;
  overflow: visible;

  .pro-layout-header-actions {
    .@{ant-prefix}-avatar {
      background: var(--zaui-brand, #006aff);
    }
  }

  .pro-layout-header-apps-trigger {
    position: absolute;
    left: 0;
    top: 0;
    width: 48px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;

    .pro-icon {
      width: 20px;
      height: 20px;
    }

    // 当存在 apps 图标时，logo 需要更多左侧间距
    ~ .pro-layout-header-logo {
      margin-left: 64px;
    }
  }

  .pro-layout-header-logo {
    position: relative;
    display: flex;
    flex: 200px;
    align-items: center;
    width: auto;
    padding: 0;
    margin-left: 48px;
    background: transparent;
    gap: 24px;
    z-index: 1;

    > span:first-child {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      width: auto;
    }

    .default-logo {
      display: inline-block;
      width: 120px;
      height: auto;
    }

    h4 {
      font-size: var(--zaui-font-size-lg, 16px);
      font-weight: 600;
      color: #1d2129;
      padding-left: var(--zaui-space-size-md, 16px);
      position: relative;
      margin: 0;

      &::before {
        content: '';
        width: 1px;
        height: 19px;
        background: #dee0e3;
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
      }
    }

    a {
      color: rgba(0, 0, 0, 0.85);
    }

    .pro-layout-icon {
      width: 200px;
      height: 64px;
    }

    .pro-layout-header-apps-trigger {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 24px;
      height: 24px;
      cursor: pointer;
      transition: all 0.3s;

      &:hover {
        opacity: 0.8;
      }

      .pro-icon {
        width: 24px;
        height: 24px;
      }
    }
  }

  &-logo {
    height: 64px;
    padding: 5px 0;
    text-align: center;
    background-color: #081838;
    transition: width 0.3s cubic-bezier(0.075, 0.82, 0.165, 1);

    > a {
      display: flex;
      align-items: center;
      text-decoration: none;

      &:hover,
      &:visited {
        text-decoration: none !important;
      }
    }

    img {
      height: 33px;
    }

    h1 {
      margin: 0.67em 0;
      padding-left: 12px;
      color: var(--zaui-text, #343434);
      font-size: var(--zaui-font-size-xl, 18px);
    }
  }

  &-content {
    position: relative;
    flex: auto;
    z-index: 1;
  }

  &-actions {
    position: relative;
    display: flex;
    align-items: center;
    float: right;
    z-index: 1;

    > .pro-layout-icon {
      width: 26px;
      height: 26px;
      margin-right: 30px;
      color: var(--zaui-text, #343434);
      cursor: pointer;
      transition: width 0.3s cubic-bezier(0.075, 0.82, 0.165, 1);

      &:hover {
        color: var(--zaui-text, #343434);
      }
    }
  }
}

// apps Popover 样式
.pro-layout-header-apps-popover {
  // 隐藏 Popover 箭头
  .@{ant-prefix}-popover-arrow {
    display: none;
  }

  .@{ant-prefix}-popover-inner {
    padding: var(--zaui-space-size-md, 16px);
    min-width: 300px;
    border-radius: var(--zaui-border-radius, 8px);
  }

  // 扁平模式 - 网格布局
  .pro-layout-header-apps-list {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .pro-layout-header-apps-item {
    display: flex;
    align-items: center;
    gap: var(--zaui-space-size-sm, 8px);
    padding: var(--zaui-space-size-sm, 8px) var(--zaui-space-size-md, 16px);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    border-radius: var(--zaui-border-radius, 8px);

    &:hover {
      background-color: rgba(0, 106, 255, 0.08);
    }

    &-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 20px;
      flex-shrink: 0;
    }

    &-label {
      font-size: var(--zaui-font-size-base, 14px);
      color: var(--zaui-text, #343434);
      line-height: 22px;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }

  // 分组模式 - 4列网格布局
  .pro-layout-header-apps-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;

    .pro-layout-header-apps-list {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      column-gap: 4px;
      row-gap: 4px;
    }

    .pro-layout-header-apps-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: var(--zaui-space-size-sm, 8px);
      padding: var(--zaui-space-size-sm, 8px);
      border-radius: var(--zaui-border-radius, 8px);

      &-icon {
        width: 32px;
        height: 32px;
        font-size: 32px;
      }

      &-label {
        text-align: center;
        font-size: 13px;
        line-height: 18px;
        white-space: nowrap;
      }
    }
  }

  .pro-layout-header-apps-group {
    &-title {
      padding: 0 0 var(--zaui-space-size-sm, 8px) 0;
      font-weight: 600;
      font-size: var(--zaui-font-size-base, 14px);
      color: var(--zaui-text, #343434);
      line-height: 22px;
    }
  }
}
