//! (C) Copyright 2020 Hewlett-Packard Enterprise Company, L.P.

@import "hp-piano-mixins";

#hp-banner-container {
  position: absolute;
  top: 0px;
  left: 0px;
  right: 0px;
  height: $banner-height;
  min-width: 600px;
  background-color: #fff;
  z-index: $banner-z-index;
  font-family: 'HPRegular', Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;

  @media print {
    @include print-position();
  }
}

#hp-simple-banner {
  text-align: center;
  line-height: $banner-height;
  border-bottom: 1px solid $global-border;

  .hp-header-primary {
    display: inline-block;
    position: relative;
    height: 100%;
  
    .hp-logo {
      display: inline-block;
      position: relative;
      top: 15px;
      left: 8px;
    }
  
    h1 {
      position: relative;
      top: 5px;
      padding-left: 20px;
    }
  }
}

#hp-info-bar {
  height: 0px;
  text-align: center;
  color: #fff;

  &.hp-active {
    height: 20px;
    line-height: 20px;
    background-color: #666;
    -webkit-animation-name: relax;
    -webkit-animation-duration: 10s;
    -webkit-animation-timing-function: ease-in;
    -webkit-animation-iteration-count: 1;
    -webkit-animation-delay: 0;
    -moz-animation-name: relax;
    -moz-animation-duration: 10s;
    -moz-animation-timing-function: ease-in;
    -moz-animation-iteration-count: 1;
    -moz-animation-delay: 0;
    -ms-animation-name: relax;
    -ms-animation-duration: 10s;
    -ms-animation-timing-function: ease-in;
    -ms-animation-iteration-count: 1;
    -ms-animation-delay: 0;
    -o-animation-name: relax;
    -o-animation-duration: 10s;
    -o-animation-timing-function: ease-in;
    -o-animation-iteration-count: 1;
    -o-animation-delay: 0;
  }
}

@-webkit-keyframes relax {
  0%   {background-color: $tooltip-background; height: 0px;}
  5%   {background-color: $tooltip-background; height: 30px; line-height: 30px;}
  90%  {background-color: $tooltip-background; height: 30px; line-height: 30px;} 100% {background-color: #666; height: 20px; line-height: 20px;} 
}

@-moz-keyframes relax {
  0%   {background-color: $tooltip-background; height: 0px;}
  5%   {background-color: $tooltip-background; height: 30px; line-height: 30px;}
  90%  {background-color: $tooltip-background; height: 30px; line-height: 30px;} 100% {background-color: #666; height: 20px; line-height: 20px;} 
}

@-ms-keyframes relax {
  0%   {background-color: $tooltip-background; height: 0px;}
  5%   {background-color: $tooltip-background; height: 30px; line-height: 30px;}
  90%  {background-color: $tooltip-background; height: 30px; line-height: 30px;} 100% {background-color: #666; height: 20px; line-height: 20px;} 
}

@-o-keyframes relax {
  0%   {background-color: $tooltip-background; height: 0px;}
  5%   {background-color: $tooltip-background; height: 30px; line-height: 30px;}
  90%  {background-color: $tooltip-background; height: 30px; line-height: 30px;} 100% {background-color: #666; height: 20px; line-height: 20px;} 
}

.hp-banner {
  position: absolute;
  top: 0px;
  left: 0px;
  right: 0px;
  height: 100%;
  z-index: $banner-z-index;
  background-color: $global-background;
  color: $global-primary-color;
  
  h1 {
    display: inline-block;
    white-space: nowrap;
    font-size: 18px;
  }
  
  @media print {
    @include print-position();
  }
}

#hp-main-banner {
  border-bottom: 1px solid $global-border;
  z-index: $header-z-index;

  .hp-header-primary {
    position: absolute;
    top: 0px;
    left: 0px;
    right: 150px;
    height: 100%;
    @include box-sizing(border-box);
    white-space: nowrap;
    background-color: $global-background;

    > * {
      vertical-align: top;
    }
    
    #hp-main-menu-control, #hp-search-control {
      position: relative;
      display: inline-block;
      margin: 0px;
      font-weight: normal;
      color: $global-primary-color;
      height: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      cursor: pointer;
      
      &:hover {
        background-color: $global-hover-background;
        color: $global-hover-color;
      }
      
      &.hp-selected {
        ///background-color: $global-selected-background;
        z-index: $banner-flyout-z-index + 80; ///10;
      }
      
      &.hp-disabled {
        &:hover {
          background-color: inherit;
          color: $global-primary-color;
        }
      }
    }

    #hp-main-menu-control {
      @include box-sizing(border-box);
      min-width: 210px;
      padding: 10px;
      white-space: nowrap;
      @include no-select();
      
      &:hover {
        border-right: 1px solid $global-divider;
        &:after {
          content: '';
          display: none;
        }
        .hp-main-menu-carret {
          background-image: $main-menu-over-url;
        }
      }
      
      &.hp-active:hover {
        border-bottom: 5px solid $dropdown-border;
        height: $banner-height + 5px;
      }
      
      &.hp-selected:hover {
        border-bottom: none;
        height: $banner-height;
      }
      
      &:after {
        content: '';
        position: absolute;
        top: 15px;
        right: 0px;
        height: 30px;
        width: 1px;
        background-color: $global-divider;
      }
      
      &.hp-disabled {
        cursor: default;
        
        &:after {
          content: '';
          display: none;
        }
        
        .hp-main-menu-carret {
          display: none;
        }
        
        &:hover {
          border: none;
        }
      }
      
      body.hp-basic-layout & {
        padding: 10px 30px 10px 30px;
      }
      
      #hp-logo {
        position: relative;
        top: 8px;
        display: inline-block;
        vertical-align: top;
        background-image: url($img-file);
        background-position: $logo-x $logo-y;
        background-repeat: no-repeat;
        width: 25px;
        height: 25px;
        
        body.hp-basic-layout & {
          top: 3px;
          width: 36px;
          height: 36px;
          background-position: $logo-x ($logo-y - 100);
        }
      }
      
      #hp-main-menu-labels {
        position: relative;
        top: 12px;
        display: inline-block;
        vertical-align: top;
        height: $banner-height - 20;
        padding-right: 5px;
        padding-left: 5px;
        min-width: 135px;
        //max-width: 240px;
        @include box-sizing(border-box);
      }
      
      #hp-main-menu-label {
        font-size: 16px;
        font-weight: normal;
        line-height: normal;
        vertical-align: bottom;
        margin-bottom: 3px;
        
        body.hp-basic-layout & {
          position: relative;
          top: -12px;
          font-size: 36px;
          font-family: 'HPLight', Arial, Helvetica, sans-serif;
          padding-right: 15px;
          padding-left: 15px;
        }
      }
      
      #hp-main-menu-sub-label {
        font-size: 12px;
        margin: 0px;
        color: $secondary-color;
        text-align: right;
      }
      
      .hp-main-menu-carret {
        position: relative;
        top: 11px;
        display: inline-block;
        vertical-align: top;
        width: 20px;
        height: 20px;
        background-image: $main-menu-active-url;
        background-position: right 0px;
        background-repeat: no-repeat;
      }
    }

    #hp-search-control {
      position: absolute;
      top: 0px;
      left: 200px;
      right: 0px;
      height: $banner-height - 4px;
      padding: 2px 12px 2px 45px;
      //border-left: 1px solid $global-divider;
      background-image: url($img-file);
      background-position: -380px -99px;
      background-repeat: no-repeat;
      font-size: 21px;
      line-height: $banner-height - 2px;
      color: $global-secondary-color;
      @include transition(left, $normal-animation-duration);
      
      &:hover {
        background-color: $global-hover-background;
        color: $global-primary-color;
        background-position: -380px -59px;
      }
      
      &.hp-selected {
        color: $global-primary-color;
        background-position: -380px -59px;
      }
    }
    
    #hp-banner-title {
      display: none;
      margin: 0px;
      font-size: 21px;
      line-height: $banner-height;
      font-weight: normal;
      padding-left: 20px;
      padding-right: 20px;
    }

    @media print {
      display: none;
    }
  }
  
  #hp-activity-notification {
    position: absolute;
    top: 0px;
    right: 0px; //-400px;
    height: $banner-height;
    max-width: 150px;
    padding: 0px 15px;
    @include box-sizing(border-box);
    background-color: $global-background;
    color: #000;
    line-height: $banner-height;
    font-size: 13px;
    white-space: nowrap;
    z-index: $header-z-index + 2; // above primary, below secondary
    @include transitions(right, 1s, max-width, 1s);
    
    &.hp-active {
      right: 150px;
      max-width: 400px;
    }
    
    .hp-message {
      padding-left: 30px;
      max-width: 300px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .hp-status {
      position: absolute;
      top: 19px;
      left: 10px;
      display: none;
      -webkit-animation: bounce 0.7s ease-in-out 0.5s infinite;
      -moz-animation: bounce 0.7s ease-in-out 0.5s infinite;
      -ms-animation: bounce 0.7s ease-in-out 0.5s infinite;
      -o-animation: bounce 0.7s ease-in-out 0.5s infinite;
      
      &.hp-active {
        display: block;
      }
    }
    
    @media print {
      display: none;
    }
  }

  ol.hp-header-secondary {
    position: absolute;
    top: 0px;
    right: 0px;
    height: 100%;
    background-color: $global-background;
    z-index: $header-z-index + 5; // above notifications
    white-space: nowrap;
    font-size: 0px;
    
    > li {
      display: inline-block;
      font-size: $body-font-size;
      vertical-align: top;
    }
    
    .hp-banner-control {
      position: relative;
      cursor: pointer;
      top: 0px;
      width: 50px;
      height: $banner-height;
      @include box-sizing(border-box);
      border: 1px solid transparent;
      
      &.hp-full {
        width: auto;
      }
       
      &:hover {
        background-color: $global-hover-background;
        &:after {
          content: '';
          display: none;
        }
      }
      
      &.hp-selected {
        //background-color: $global-selected-background;
        z-index: $banner-flyout-z-index + 10;
      }
      
      &:after {
        content: '';
        position: absolute;
        top: 15px;
        left: 0px;
        height: 30px;
        width: 1px;
        background-color: $global-divider;
      }
      
      .hp-icon {
        position: relative;
        top: 22px;
        left: 17px;
        width: 20px;
        height: 20px;
        background-image: url($img-file);
        background-repeat: no-repeat;
      }
      
      @media print {
        display: none;
      }
    }
    
      .hp-count { 
        position: absolute;
        top: 10px;
        right: 6px;
        height: 18px;
        width: 20px;
        padding-top: 2px;
        text-align: center;
        background-image: url($img-file);
        background-repeat: no-repeat;
        background-position: $activity-x -60px;
        font-size: 11px;
        font-weight: bold;
        color: #000;
        z-index: 1; ///26;
        display: none;
        
        &.hp-active {
          display: block;
        }
      }
    
    #hp-activity-control {
      
      .hp-icon {
        top: 23px;
        background-position: $activity-x -20px;
      }
      
      &:hover, &.hp-selected {
        .hp-icon {
          background-position: $activity-x 0px;
        }
        #hp-activity-control-new-count {
          background-position: $activity-x -40px;
        }
      }
      
    }

    #hp-session-control {
      white-space: nowrap;
      
      .hp-icon {
        top: 23px;
        background-position: $user-x -20px;
      }
      &:hover .hp-icon, &.hp-selected .hp-icon {
        background-position: $user-x 0px;
      }
      .hp-name {
        position: relative;
        top: 15px;
        padding: 0px 15px 0px 20px;
      }
      &.hp-full .hp-icon, &.hp-full .hp-name {
        display: inline-block;
      }
    }
    
    #hp-help-control {
      .hp-icon {
        top: 22px;
        background-position: $help-x -20px;
      }
      &:hover .hp-icon, &.hp-selected .hp-icon {
        background-position: $help-x 0px;
      }
    }
    
    @media print {
      height: auto;
      width: auto;
    }
  }
}

@-webkit-keyframes bounce {
  0%  {left: 15px;}
  30% {left: 15px;}
  50% {left: 5px;}
  70% {left: 15px;}
  90% {left: 17px;}
  100%  {left: 15px;}
}

@-moz-keyframes bounce {
  0%  {left: 15px;}
  30% {left: 15px;}
  50% {left: 5px;}
  70% {left: 15px;}
  90% {left: 17px;}
  100%  {left: 15px;}
}

@-ms-keyframes bounce {
  0%  {left: 15px;}
  30% {left: 15px;}
  50% {left: 5px;}
  70% {left: 15px;}
  90% {left: 17px;}
  100%  {left: 15px;}
}

@-o-keyframes bounce {
  0%  {left: 15px;}
  30% {left: 15px;}
  50% {left: 5px;}
  70% {left: 15px;}
  90% {left: 17px;}
  100%  {left: 15px;}
}

#hp-main-menu {
  position: absolute;
  top: 0px;
  height: auto;
  background-color: #fff;
  padding: $banner-height 42px 15px 42px;
  @include box-sizing(border-box);
  font-size: 16px;
  z-index: $banner-flyout-z-index;
  display: none;
  @include drop-menu-border();
  border-left-color: transparent;
  
  &.hp-active {
    display: block;
  }
  
  body.hp-basic-layout & {
    padding-left: 85px;
    padding-right: 30px;
    font-size: 18px;
  }
  
  > :first-child {
    border-top: 1px solid #000;
    padding-top: 22px;
  }
  
  > header a {
    display: block;
    padding: 12px 0px;
  }
    
  .hp-sections > li {
    display: inline-block;
    vertical-align: top;
    margin-right: 20px;
    
    label {
      display: block;
      font-weight: bold;
      font-size: 12px;
      margin-bottom: 10px;
      color: #999;
      text-transform: uppercase;
    }
  }

  .hp-section > li {
    margin-bottom: 6px;
    min-width: 135px;
    
    &.hp-unauthorized {
      display: none;
    }
    
    a {
      display: block;
      color: $unselected-color;
      padding: 2px 0px;
      
      &.hp-selected {
        color: $menu-selected-color;
        font-weight: bold;
      }
      
      &:hover {
        color: $text-link-color;
        text-decoration: underline;
      }
    }
    
    .hp-menu-item-prompt {
      position: relative;
      display: inline-block;
      font-size: 13px;
      background-color: $attention-background;
      color: $attention-color;
      margin: 5px 10px;
      padding: 3px 10px 3px 10px;
      
      &:after {
        content: "";
        position: absolute;
        top: -5px;
        left: 5px;
        right: auto;
        border-width: 0 7px 7px;
        border-color: $attention-background transparent;
        border-style: solid;
        display: block;
        width: 0;
      }
      
      &.hp-done {
        background-image: url($img-file);
        background-position: -380px -215px;
        background-repeat: no-repeat;
      }
      
      a {
        display: inline;
        padding: 2px;
        color: $primary-color;
        
        &:hover {
          background-color: transparent;
          text-decoration: underline;
          color: $primary-color;
        }
      }
    }
  }
}

#hp-search-menu {
  position: absolute;
  top: 0px;
  left: 200px;
  right: 150px;
  @include box-sizing(border-box);
  padding: 0px 18px;
  background-color: $global-selected-background;
  z-index: ($banner-z-index + 1);
  display: none;
  @include drop-menu-border();
  border: 2px solid #0099D2;
  
  &.hp-active {
    display: block;
  }
  
  > header {
    height: $banner-height - 3px;
    background-image: url($img-file);
    background-position: -399px -61px;
    background-repeat: no-repeat;
    
    #hp-search-input {
      position: absolute;
      top: 0px;
      left: 0px;
      right: 0px;
      padding-top: 16px;
      padding-left: 43px;
      padding-right: 40px;
      height: $banner-height - 18px;
    }
    
    input {
      width: 100%;
      font-size: 21px;
      line-height: normal;
      font-weight: normal;
      -webkit-font-smoothing: antialiased;
      margin: 0px;
      padding: 0px;
      background: transparent;
      font-family: 'HPRegular', Arial, Helvetica, sans-serif;
      color: #000;
      border: none;
      //@include remove-box-shadow();
      cursor: default;
      
      &::-moz-selection {
        background: $selected-background;
      }
      &::-ms-clear {
        display: none;
      }
    }
    
    #hp-search-clear {
      position: absolute;
      top: 20px;
      right: 10px;
      width: 20px;
      height: 20px;
      background-image: $close-url;
      background-repeat: no-repeat;
      cursor: pointer;
      
      &:hover {
        background-image: $close-over-url;
      }
    }
  }
  
  #hp-search-choices {
    position: relative;
    padding: 10px 25px 20px 25px;
    background-image: $horizontal-dot-url;
    background-position: left top;
    background-repeat: repeat-x;
    overflow: hidden;
    
    h2 {
      display: none;
    }
    
    li {
      cursor: pointer;
    }
  }
  
  #hp-search-suggestions, #hp-search-recent {
    margin: 0px -25px;
    font-size: 16px;
    white-space: nowrap;
    margin-bottom: 15px;
    
    li {
      padding: 5px 25px;
      overflow: hidden;
      text-overflow: ellipsis;
      
      &:hover {
        background-color: $primary-hover-background;
        color: $primary-color;
      }
      
      &.hp-selected {
        background-color: $selected-background;
        color: $primary-color;
      }
    }
  }
  
  /*#hp-search-recent {
    margin: 0px;
    font-size: 13px;
    
    li {
      display: inline-block;
      background-color: $global-hover-background;
      white-space: nowrap;
      margin-right: 5px;
      margin-bottom: 5px;
      padding: 2px 5px;
    }
  }*/
  
  #hp-search-scope {
    padding: 11px 0px;
    background-image: $horizontal-dot-url;
    background-position: left top;
    background-repeat: repeat-x;
    @include box-sizing(border-box);
    
    input {
      display: inline-block;
      margin: 0px 3px 0px 0px;
    }
    
    label {
      display: inline-block;
      max-width: 50%;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-right: 20px;
      
      &:first-child {
        margin-right: 10px;
      }
    }
  }
}

.hp-banner-flyout {
  position: absolute;
  top: $banner-height;
  width: 200px;
  right: 0px;
  @include box-sizing(border-box);
  background-color: $global-selected-background;
  color: $global-primary-color;
  z-index: $banner-flyout-z-index;
  @include drop-menu-border();
  display: none;
  
  &.hp-active {
    display: block;
  }
  
  &.hp-sidebarred {
    top: 0px;
    width: auto; //200px;
    left: 0px;
    right: 0px;
    bottom: 0px;
    background-color: #f3f3f3;
    z-index: 0;
    border: none;
  }
  
  > header {
    @include box-sizing(border-box);
    height: $subnav-height + 20px;
    line-height: $subnav-height - 2px;
    padding: 10px 15px;
    color: #333;
    font-family: 'HPRegular', Arial, Helvetica, sans-serif;
    
    h1 {
      font-size: 18px;
      line-height: inherit;
    }
    
    .hp-pin-right {
      position: absolute;
      top: 9px;
      right: -2px;
      
      .hp-sidebarred & {
        right: 20px;
      }
    }
  }
}

#hp-session-flyout {
  padding: 20px;
  
  #hp-session-user {
    font-weight: bold;
    color: $global-secondary-color;
    word-break: break-all;
    width: 138px;
  }
  
  #hp-session-user-edit {
    float: right;
    background-position: -276px -77px; 
  }
  
  #hp-session-duration {
    margin-top: 10px;
    color: $global-secondary-color;
    //white-space: nowrap;
    margin-bottom: 5px;
  }
  
  #hp-session-perf-location {
    color: $global-secondary-color;
    margin-top: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 180px;
  }
  
  #hp-session-perf-duration {
  }
}

#hp-activity-flyout, #hp-upload-flyout {
  
  > header {
    #hp-activity-count {
      &:before {
        content: '(';
      }
      &:after {
        content: ')';
      }
    }
  }
  
  .hp-flyout-contents {
    max-height: 400px;
    overflow-y: auto;
  }
  
  &.hp-sidebarred {
    .hp-flyout-contents {
      max-height: none;
      overflow: visible; //auto;
      
      .hp-activity {
        > .hp-activity-message {
          width: 131px;
        }
      }
      
      .hp-fileupload {
        > .hp-upload-message {
          width: 131px;
        }
      }
    }
  }
  
  #hp-flyout-new-activities, #hp-flyout-old-activities {
    margin: 0px;
  }
    
  li.hp-activity, li.hp-fileupload {
    color: #000;
    height: 45px;
    line-height: 14px;
    cursor: pointer;
    @include transition(background-color, 8s);
    
    &:hover {
      .hp-brief {
        background-color: $global-hover-background;
      }
    }
    
    &.hp-selected, &.hp-selected:hover {
      div.hp-brief {
        background-color: $selected-background;
        border-top: 1px solid #ccc;
        border-bottom: 1px solid #ccc;
        border-right: 1px solid #ccc;
        left: -1px;
        padding: 6px 14px 6px 16px;
        width: 201px;
        z-index: 50;
        > * {
          opacity: 0.2;
        }
      }
      div.hp-full {
        opacity: 1;
        right: 200px;
        width: 300px;
      }
    }
    
    &.hp-new {
      background-color: $primary-background;
    }
    
    div.hp-brief {
      position: relative;
      @include box-sizing(border-box);
      padding: 7px 15px;
      background-color: transparent;
      min-height:45px; //to keep the same height as activity brief
      
      > .hp-status {
        float: left;
        margin-top: 1px;
        margin-right: 5px;
        margin-bottom: 14px;
      }
    
      > .hp-activity-source {
        display: block;
        margin-bottom: 3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    
      > .hp-activity-message, .hp-upload-message {
        color: #666;
        width: 121px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
    
    div.hp-full {
      position: absolute;
      top: 0px;
      right: 0px;
      width: 200px;
      max-height: 70%;
      overflow: auto;
      padding: 7px 20px 7px 28px;
      @include box-sizing(border-box);
      @include drop-menu-border();
      background-color: #f3f3f3;
      color: #000;
      opacity: 0;
      z-index: -50;
      line-height: normal;
      @include transition(right, $appearance-duration);
        
      header {
        margin-bottom: 10px;
        
        > * {
          display: inline-block;
          vertical-align: baseline;
          white-space: normal;
          color: #333;
        }
        
        > .hp-status {
          position: absolute;
          top: 10px;
          left: 10px;
        }
        
        > .hp-timestamp {
          color: #666;
          margin-right: 4px;
        }
        
        > .hp-activity-message, .hp-upload-message {
          margin-right: 4px;
        }
      }
      
      > .hp-contents {
        margin-top: 10px;
        
        > .hp-actions {
          margin-bottom: 10px;
        }
      }
      
      a {
        color: $text-link-color;
      }
    }
  }

  footer {
    @include box-sizing(border-box);
    height: $flyout-footer-height;
    padding: 10px 15px;
  }
}

#hp-upload-flyout {
  li.hp-fileupload {
    div.hp-full {
      word-break:break-all;
      overflow:visible;   //added to fix the spinning icon disappearing for upload flyouts 
      
      > .hp-contents {
        > .hp-details {
          display: none;  // used for calculating the interval
        }
        > .hp-message {
          display: inline-block;
        }
        > .hp-actions {
          margin-top: 10px;
          display: block;
        }
      }
    }
  }
}

#hp-flyout-uploads {
  .hp-close {
    display: inline-block;
    position: relative;
    top: 6px;
    left: 15px;
  }
  
  .hp-upload-message {
    display: inline-block;
  }
}

#hp-help-flyout {
  
  &.hp-sidebarred {
    .hp-flyout-contents {
      max-height: none;
    }
  }
 
  .hp-flyout-contents {
    max-height: 400px;
    overflow-y: auto;
    padding: 0px 15px 15px 15px;
    @include box-sizing(border-box);
    
    h2 {
      font-size: 16px;
      line-height: normal;
      color: #333;
      font-family: 'HPRegular', Arial, Helvetica, sans-serif;
    }
    
    .hp-help-section:first-child h2 {
      margin-top: 0px; //19px;
    }
    
    li {
      &.hp-done {
        background-image: $green-check-url;
        background-position: -4px 3px;
        background-repeat: no-repeat;
      }
      
      > a {
        display: block;
        padding: 5px 0px;
        color: $text-link-color;
      }
    }
    
    .hp-has-indicators li {
      padding-left: 12px;
      @include transition(padding-left, $normal-animation-duration);
    }
  }
}
