// (C) Copyright 2011-2014 Hewlett-Packard Development Company, L.P.

form.hp-edit-form, form.hp-add-form {
  
  > .hp-footer {
    width: 100%;
    margin: 0px;
    @include box-sizing(border-box);
    border-top: 1px solid $change-header-divider;
    z-index: $header-z-index; // above stacked panels section header
    
    .hp-form-controls {
      position: absolute;
      padding: 15px;
      top: 0px;
      right: 4px;
      bottom: 0px;
      height: $form-footer-height;
      @include box-sizing(border-box);
      background-color: $primary-background;
      
      > * {
        vertical-align: top;
        margin-right: 11px;
      }
    }
    
    #hp-form-state {
      position: relative;
      height: $form-footer-height;
      line-height: $form-footer-height;
      white-space: nowrap;
      
      #hp-form-message {
        position: absolute;
        left: 60px;
        bottom: 0px;
        @include box-sizing(border-box);
        color: $secondary-primary-color;
        border: 1px solid #fff;
        @include transitions(background-color, 0.2s, max-height, 0.8s);
        max-height: $form-footer-height;
        
        html.hp-high-contrast & {
          color: $projection-color;
        }
        
        .hp-form-message-summary {
          position: relative;
          padding: 0px 0px 0px 20px;
          height: $form-footer-height;
          white-space: nowrap;
        
          > * {
            display: inline-block;
            vertical-align: top;
          }
        
          > .hp-status {
            position: relative;
            top: 24px;
            left: 0px;
            line-height: 14px;
            margin-right: 0px;
          }
          
          .hp-form-message-text {
            overflow: hidden;
            width: 95%;
            white-space: nowrap;
            text-overflow: ellipsis;
          }
        }
        
        > .hp-form-message-details {
          position: relative;
          @include box-sizing(border-box);
          max-height: 400px;
          line-height: normal;
          padding: 0px 20px 20px 20px;
          white-space: normal;
          overflow: auto;
          display: none;
          
          @include form_notification_details();
        }
        
        &.hp-activateable {
          background-color: $attention-background;
          border-top-width: 0px;
          border-bottom-width: 0px;
          border-left-color: $change-header-divider;
          border-right-color: $change-header-divider;
          cursor: pointer;
          
          .hp-form-message-summary {
            
            &:hover {
              background-color: $attention-background;
              color: $primary-color;
              
              html.hp-high-contrast & {
                color: $projection-color;
              }
            }
          }
        }
        
        &.hp-active {
          
          max-height: 400px;
          background-color: $attention-background;
          color: $primary-color;
          border: 1px solid $change-header-divider;
          z-index: ($header-z-index + 10);
          line-height: normal;
          
          html.hp-high-contrast & {
            color: $projection-color;
          }
          
          .hp-form-message-summary {
            height: auto;
            
            > .hp-status {
              top: 17px;
            }
          }
          
          .hp-form-message-text {
            line-height: normal;
            padding-top: 15px;
            padding-bottom: 10px;
            white-space: normal;
            text-overflow: clip;
          }
          
          .hp-form-message-details {
            display: block;
          }
        }
      }
    }
    
    #hp-form-changes {
      position: absolute;
      left: 0px;
      bottom: 0px;
      height: $form-footer-height;
      
      #hp-form-changes-control {
        position: relative;
        display: inline-block;
        color: $secondary-color;
        height: $form-footer-height - 2;
        width: 60px;
        cursor: pointer;
        @include transition(background-color, 0.1s);
        
        html.hp-high-contrast & {
          color: $projection-secondary-color;
        }
      
        .hp-icon {
          position: relative;
          top: 15px;
          left: 15px;
          width: 23px;
          height: 23px;
          background-image: url($img-file);
          background-position: $edit-x -40px;
          background-repeat: no-repeat;
          vertical-align: middle;
        }
      
        .hp-count {
          position: absolute;
          top: 8px;
          right: 8px;
          height: 17px;
          width: 20px;
          padding-top: 3px;
          text-align: center;
          background-image: url($img-file);
          background-repeat: no-repeat;
          background-position: -240px -100px;
          font-size: 11px;
          line-height: 14px;
          font-weight: bold;
          color: #000;
        }
      
        &:hover {
          z-index: $header-z-index;
        
          .hp-icon {
            background-position: $edit-x 0px;
          }
        }
      }
      
      ol {
        position: absolute;
        bottom: $form-footer-height;
        min-width: 80px;
        max-width: 200px;
        max-height: 400px;
        line-height: 14px;
        @include box-sizing(border-box);
        background-color: $primary-background;
        color: $primary-color;
        z-index: $drop-menu-z-index;
        @include drop-menu-border();
        border-top: 5px solid $dropdown-border;
        border-bottom: 1px solid #ccc;
        margin-bottom: 0px;
        overflow: auto;
        display: none;
        
        html.hp-high-contrast & {
          color: $projection-color;
        }
        
        li {
          padding: 15px;
          border-top: 1px solid $primary-divider;
          
          &:first-of-type {
            border-top: none;
          }
          
          .hp-form-change-label {
            color: $secondary-color;         
            
            html.hp-high-contrast & {
              color: $projection-secondary-color;
            }
          }
          
          .hp-form-change-value, .hp-form-change-label {
            white-space: nowrap;
            overflow: hidden;
            max-width: 200px;
            text-overflow: ellipsis;
          } 
        }
      }
      
      &.hp-active {
        #hp-form-changes-control {
          background-color: $primary-background;
          
          .hp-icon {
            background-position: $edit-x 0px;
          }
          
          .hp-count {
            background-position: -140px -60px;
          }
        }
        ol {
          display: block;
        }
      }
    }
    
    .hp-form-confirmation {
      width: 350px;
      position: absolute;
      bottom: -3px;
      right: 0px;
      padding: 19px;
      background-color: #fff;
      border: 1px solid $global-divider;
      line-height: 15px;
      
      .hp-element-hidden {
        visibility: hidden;        
      }
      
      >:first-child {
        margin-top: 0px;
      }

      >:nth-last-child(2) {
        margin-bottom: 20px;
        margin-top: 15px;        
      }      
      
      p, div {
        white-space: normal;
        margin-bottom: 0px;
        margin-top: 20px; 
                 
        > input[type="checkbox"] {
          margin-right: 10px;
          margin-top: 0px;
          margin-left: 0px;
          float: left; 
        }  
      }
      
      .hp-error {
        clear: both;
        margin: 10px 0px 0px 24px;
      }
  
      label {
        display: block;       
        margin-left : 25px;
      }
      
      .hp-form-confirmation-controls {
        text-align: right;
        > * {
          margin-right: 11px;
        }
      }
    }
  }
}
