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

@import "hp-piano-mixins";

#hp-page-notifications {
  position: relative;
  opacity: 0;
  top: -45px;
  background-color: $attention-background;
  color: $attention-color;
  height: 35px;
  margin-bottom: 10px;
  overflow: hidden;
  background-image: $select-down-url;
  background-position: right 8px;
  background-repeat: no-repeat;
  border-top-right-radius: 7px;
  border-bottom-left-radius: 7px;
  white-space: nowrap;
  cursor: pointer;
  
  .hp-notify-disabled & {
    display: none;
    top: -$subnav-height;
  }
  
  &:hover {
    background-image: $select-down-over-url;
    border: 2px solid #999;
    margin: -2px -2px 8px -2px;
  }
  
  &:focus {
    outline: none;
  }
  
  &.hp-available {
    opacity: 1;
    top: 0px;
  }
  
  &.hp-active {
    background-image: $select-up-url;
    max-height: 80%;
    height: auto;
    @include drop-menu-border();
    border-bottom-color: #F4B51E;
    //border-radius: 0px;
    border-top-right-radius: 7px;
    border-bottom-left-radius: 7px;
    margin: -1px;
    z-index: 100;
    
    &:hover {
      background-image: $select-up-over-url;
    }
    
    .hp-notification .hp-full, .hp-controls .hp-selector {
      display: block;
    }
    
    .hp-notification {
      > header {
        height: auto;
        .hp-message {
          margin-top: 10px;
          line-height: 15px;
          white-space: normal;
        }
      }
    }
  }
  
  html.hp-high-contrast & {
    color: $projection-attention-color;
  }
  
  a {
    color: $text-link-color;
  }
  
  @media print {
    @include print-position();
    display: none;
  }
  
  .hp-notification {
    position: relative;
    display: inline-block;
    vertical-align: top;
    margin-right: -4px;
    @include box-sizing(border-box);
    background-color: $attention-background;
    border: 1px solid transparent;
    overflow: hidden;
    white-space: nowrap;
    
    > header {
      vertical-align: top;
      height: 35px;
      line-height: 35px;
      
      .hp-status {
        top: 12px;
        left: 10px;
        margin-right: 10px;
      }
    }
    
    .hp-source, .hp-source-name {
      display: none;
    }
    
    .hp-full {
      display: none;
      position: relative;
      margin: 10px 0px 20px 0px;
      padding: 0px 28px;
      max-height: 400px;
      overflow-y: auto;
      white-space: normal;
      
      p, ul, ol {
        margin: 10px 0px;
      }
      
      .hp-resolution-container > h3 {
        display: inline;
        font-weight: bold;
        font-size: inherit;
        margin-right: 5px;
        &:after {
          content: ':';
        }
      }
      
      .hp-actions {
        margin-top: 15px;
        > li {
          color: $primary-color;
          display: inline-block;
          margin-right: 20px;
        }
      }
    }
  }
  
  .hp-controls {
    display: inline-block;
    vertical-align: top;
    width: 200px;
    border-left: 1px solid #ccc;
    @include box-sizing(border-box);
    
    > header {
      height: 35px;
      line-height: 35px;
      padding: 0px 10px;
    
      .hp-view-all {
        display: inline-block;
        margin-right: 10px;
      }
    
      .hp-summary-status {
        display: inline-block;
        .hp-status {
          top: 4px;
          left: 2px;
        }
      }
    }
    
    .hp-selector {
      display: none;
      margin-bottom: 0px;
      overflow-y: auto;
      background-color: $primary-background;
      
      li {
        padding: 5px 10px;
        background-color: $attention-background;
        
        &.hp-selected {
          background-color: $selected-background;
        }
        
        &:hover {
          background-color: $menu-selection;
        }
        
        .hp-status {
          display: inline-block;
          top: 4px;
        }
        .hp-message {
          display: inline-block;
          width: 160px;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }
        .hp-timestamp {
          margin-left: 19px;
        }
      }
    }
  }
  
  @media print {
    display: block;
    margin-bottom: 10px;
  }
}

.hp-notification-summary {
  > * {
    display: inline-block;
    vertical-align: top;
    margin-right: 10px;
  }
  
  .hp-status {
    margin-right: 0px;
  }
  
  .hp-progress {
    width: 100px;
    margin: 12px 10px 1px 10px;
  }
  
  .hp-message {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  
  .hp-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 20px;
    height: 20px;
    background-position: -156px -16px;
    margin-left: 10px;
    display: none;

    &:hover {
      background-position: -156px 4px;
    }

    &.hp-active {
      display: block;
    }
  }
}

.hp-details-error { // .hp-details-error should be removed from all pages
  display: none;
  padding: 20px;
  background-color: #f00;
  margin-bottom: 20px;
}

.hp-details-notify, .hp-notify {
  position: relative;
  @include box-sizing(border-box);
  margin: 5px 0px 15px 0px;
  padding: 20px;
  background-color: $attention-background;
  color: $attention-color;
  white-space: normal;
  display: none;
  
  html.hp-high-contrast & {
    color: $projection-attention-color;
  }
  
  &.hp-active {
    display: block;
  }
  
  &.hp-notify-heavy {
    height: auto;
    width: auto;
    margin: 10px auto;
  }
  
  .hp-details-pane .hp-details-show-section & {
    margin-right: -15px;
  }
  

  .hp-status {
    margin-top: 12px;
    margin-left: 12px;
  }
  
  .hp-notify-message {
    padding: 8px 0px;

  }
  
  @media print {
    padding: 15px 0px;
    display: none;
  }
  
  a {
    cursor: pointer;
  }
  
  .hp-details-notify-controls, .hp-notify-controls {
    position: absolute;
    top: 8px;
    right: 12px;
    
    li {
      display: inline-block;
      margin-left: 8px;
      
      a {
        font-weight: bold;
        color: $secondary-color;
      }
    }
    
    @media print {
      display: none;
    }
  }
}

.hp-form-content .hp-notify {
  padding:14px;
  
  h3 {
    display:inline;
    font-size:13px;
    font-weight:bold;
  }
}

.hp-dialog-notification {
  position: relative;
  display: block;
  background-color: $attention-background;
  color: $attention-color;
  
  html.hp-high-contrast & {
    color: $projection-attention-color;
  }
  
  @include box-sizing(border-box);
  padding: 10px;
  overflow: hidden;
  cursor: pointer;
  background-image: $select-down-url;
  background-position: right 8px;
  background-repeat: no-repeat;
  
  &:hover {
    background-image: $select-down-over-url;
    
    a {
      text-decoration: underline;
    }
    
    .hp-message {
      color: $primary-color;
    }
  }
  
  > * {
    display: inline-block;
    vertical-align: top;
  }
  
  > .hp-status {
    top: 2px;
    height: 12px;
  }
  
  > .hp-message {
    display: inline-block;
    max-width: 500px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  > .hp-full {
    display: none;
  }
  
  &.hp-active {
    overflow: visible;
    
    &:hover {
      border-color: transparent;
    }
    
    a {
      text-decoration: underline;
    }
    
    .hp-full {
      position: absolute;
      display: block;
      top: 0px;
      left: 0px;
      right: 0px;
      margin: -1px;
      z-index: 100;
      padding: 10px 20px 20px 32px;
      @include box-sizing(border-box);
      background-color: $attention-background;
      color: $attention-color;
      @include drop-menu-border();
      border-bottom-color: #F4B51E;
      background-image: $select-down-url;
      background-position: right 8px;
      background-repeat: no-repeat;
      
      &:hover {
        background-image: $select-down-over-url;
      }
      
      header {
        margin-left: -22px;
        margin-right: -22px;
        
        > .hp-status {
          display: inline-block;
          vertical-align: top;
          top: 2px;
          height: 12px;
        }
        
        > .hp-message {
          display: inline-block;
          vertical-align: top;
          max-width: 90%;
          padding-bottom: 10px;
        }
      }
      
      .hp-contents {
        overflow: auto;
      }
      
      p, ul, ol {
        margin: 10px 0px;
      }
      
      .hp-actions {
        margin-top: 15px;
        > li {
          color: $primary-color;
          display: inline-block;
          margin-right: 10px;
        }
      }
    }
  }
}

.hp-details-pane .hp-notify {
  width: auto;
  margin: 0px 0px 20px 0px;
}

.hp-temporary-status {
  clear: both;
}

#hp-error-page, .hp-error-section {
  background-color: inherit;
  
  .hp-notify {
    max-width: 600px;
    height: auto;
    margin: 0px auto;
    background-color: #fff;
    color: #000;
    text-align: left;
    @include drop-menu-border();
    
    h1 {
      display: block;
      font-weight: bold;
      font-size: 14px;
      margin-bottom: 15px;
    }
    
    label {
      display: block;
      font-weight: bold;
      margin-bottom: 5px;
    }
    
    a {
      text-decoration: underline;
    }
    
    footer {
      width: 100%;
      text-align: right;
    }
  }
  
  .hp-spinner {
    width: 400px;
    background-color: #fff;
    color: #000;
    padding: 20px 10px 50px 10px;
    margin: 0px auto;
    @include drop-menu-border();
  }
}

.hp-sessioned .hp-error-section {
  background-color: inherit;
  
  .hp-notify {
    width: 400px;
    margin: 0px auto;
    background-color: #fff;
    color: #000;
    @include drop-menu-border();
  }
  
  .hp-notify-autowidth {
    width: auto;
  }
}

.hp-unauthorized-page { // deprecated
  width: 400px;
  margin: 40px auto;
  padding: 10px;
  background-color: $information-background;
  color: $attention-color;
}
