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

.hp-switch-context {
  white-space: nowrap;
  
  a {
    cursor: pointer;
  }
  
  > * {
    display: inline-block;
    vertical-align: top;
    margin-right: -4px;
  }
  
  ol {
    margin-bottom: 0px;
  }
  
  .hp-switch-endpoints {
    
    .hp-switch-endpoint {
      position: relative;
      white-space: nowrap;
      width: 100%;
      height: 26px;
      margin-bottom: 5px;
      
      &:last-of-type {
        margin-bottom: 0px;
      }
      
      > * {
        display: inline-block;
        vertical-align: top;
        margin-right: -4px;
        &:last-of-type {
          margin-right: 0px;
        }
      }
    }
  }
  
  .hp-switch-uplink-groups {
    display: table-cell;
  }
  
  .hp-backplane-connect {
    margin-top: 20px;
  }
  
  .hp-switch-servers {
    border: 1px solid $graphics-border;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    max-width: 200px;
    @include box-sizing(border-box);
    
    .hp-switch-server {
      display: block;
      border-bottom: 1px solid $graphics-border;
      
      &:last-of-type {
        border-bottom: none;
      }
      
      &:hover {
        .hp-device {
          background-color: #ffd;
        }
      }
      
      .hp-device {
        border: none;
        background-image: none;
        padding: 5px 15px 5px 5px;
        overflow: hidden;
        
        .hp-status, .hp-device-name {
          display: inline-block;
          vertical-align: top;
          white-space: nowrap;
        }
        .hp-device-model {
          display: none; //block;
          padding-left: 24px;
          color: $secondary-color;
        }
      }
    }
  }
}

.hp-switch.hp-device { 
  position: relative;
  display: inline-block; 
  vertical-align: top;
  padding: 0px 10px 5px 10px;
  margin-right: 20px;
  margin-bottom: 10px;
  text-align: left;
  
  .hp-logical-switch.hp-small & {
    padding: 4px 10px 3px 15px;
  }
  
  .hp-status, label {
    display: inline-block;
  }
  .hp-backplane-ports {
    display: inline-block;
    .hp-up-port {
      display: table-cell;
      border-top: none;
    }
  }
  .hp-up-ports, .hp-fp-ports, .hp-backplane-ports {
    .hp-up-port {
      .hp-full {
        display: none;
        position: absolute;
        overflow: hidden;
        
        .hp-summary {
          margin: 5px 0px 15px;
          
          > * {
            display: inline-block;
            white-space: nowrap;
          }
          .hp-status {
            padding-right: 3px;
          }
        }
        
        .hp-secondary {
          margin-top: 0px;
          padding-left: 0px;
          color: $secondary-color;
        }
        
        .hp-show-form {
          padding-left: 20px;
          margin-bottom: 0px;
          width: auto;
          
          li.hp-form-item {
            > div, ol {
              color: $primary-color;
            }
          }
        }
        
        .hp-usage {
          margin-right: 10px
        }
        
        .hp-simple-table {
          width: 100%;
          padding-left: 20px;
          padding-bottom: 10px;
          margin-top: 20px;
          
          thead {
            display: table-header-group;
          }
          
          th {
            background-image: none;
            color: $primary-color;
            padding-left: 0px;
          }
          
          th:last-child {
            color: $secondary-color;
            padding-right: 0px;
          }
          
          div.hp-secondary {
            display: inline-block;
          }
          
          tr {
            td {
              padding-top: 3px;
              padding-bottom: 3px;
              
              &:first-child {
                text-align: left;
              }
              
              &:last-child {
                padding-right: 0px;
              }
            }
          }
          
          .hp-usage {
            margin-right: 5px;
            margin-left: 0px;
          }
          
        }
        
        .hp-graphic-legend {
          .hp-key {
            .hp-color {
              display: inline-block;
              height: 10px;
              width: 10px;
              margin-right: 5px;
            }
            
            .hp-numeric {
              color: $primary-color;
            }
            
            .hp-name {
              display: inline-block;
            }
          }
        }
        
        .hp-plot {
          margin: 0px 10px 20px 20px;
          .flot-base {
            padding-left: 20px;
          }
        }
      }
    }
  }
  .hp-up-ports, .hp-fp-ports {
    position: relative;
    top: 0px;
    left: 0px;
    width: auto; 
    display: inline-block;
    margin: 5px 0px 0px;
    text-align: center;
    padding: 0px;
    border: none;
    white-space: nowrap;

    .hp-utilization-meter {
      label {
        display: none;
      }
    }
    .hp-up-port {
      display: table-cell;
      width: 22px;
      height: 26px;
      padding: 4px 8px 4px 11px;
      margin-right: -4px;
      border: none;
      border-right: 1px solid #ccc;
      border-radius: 0px;
      min-width: 0px;
      text-align: center;
      
      &:hover {
        opacity: 1;
      }
            
      &:last-of-type {
        margin-bottom: 0px;
        border-right: none;
      }
      .hp-device-name, .hp-status {
        display: block;
        padding: 0px;
        color: $primary-color;
      }
      .hp-condensed {
        .hp-status {
          top: 3px;
          left: 3px;
          margin-bottom: 3px;
          &.hp-changing {
            width: 14px;
            height: 30px;
            > * {
              display: block;
            }
          }
          .hp-status-value {
            position: relative;
            left: 2px;
          }
        }
        .hp-usage {
          margin: 10px 0px 6px -6px;
          width: 25px;
        }
            
        .hp-device-name {
          text-align: center;
          margin-left: -4px;
          color: $primary-color;
        }
      }
    }
  }
  .hp-backplane-ports {
    .hp-logical-switch.hp-small & {
      top: -4px;
      left: 14px;
      margin-right: 4px;
      margin-bottom: -7px;
    }
  }
  
  .hp-fp-ports { 
    margin-top: 10px;
    border-right: 1px solid #ccc;
    .hp-up-port {
      border: none;
    }
    &:last-of-type {
      border-right: none;
    }
  }
  &.hp-small {
    .hp-fp-ports {
      margin-right: 6px;
    }
    .hp-up-port {
      padding-right: 6px;
      padding-left: 9px;
      .hp-condensed {
        .hp-status {
          left: 1px;
        }
        .hp-usage {
          display: none;
        }
      }
    }
  }
}

.hp-switch {
  .hp-up-port {
    .hp-condensed {
      .hp-usage {
        margin: 10px 0 6px -6px;
      }
    }
  }
  .hp-backplane-ports {
    border-bottom-left-radius: 5px;
    border-left: 2px solid $graphics-border;
    border-bottom: 2px solid $graphics-border;
    margin: 0;
    margin-bottom: 10px;
    padding: 7px 5px 5px;
    position: relative;
    top: 0px;
    width: auto;
    left: 10px;

    .hp-up-port {
      &:first-child {
        padding-left: 7px;
      }
      &:last-of-type {
        border-right: none;
      }
   }
  }
  .hp-up-ports, .hp-backplane-ports {
    .hp-up-port {
      position: relative;
      margin-bottom: 0px;
      @include box-sizing(border-box);
      white-space: nowrap;
      cursor: pointer;
      display: block;;
      height: 26px;
      padding: 4px 8px 4px 11px;
      width: auto;
      margin-right: -4px;
      border: none;
      border-top: 1px solid #ccc;
      border-right: none;
      border-radius: 0px;
      min-width: 0px;
      text-align: center;
    
      .hp-status, .hp-device-name, .hp-usage {
        display: inline-block;
        vertical-align: top;
      }
      
      &:hover {
        
        .hp-full {
          display: block;
          width: auto;
          background: #fff;
          z-index: 2;
          border: 1px solid $graphics-border;
          border-bottom-left-radius: 7px;
          border-top-right-radius: 7px;
          padding: 10px 15px;
          text-align: left;
          @include animation-name(fadeInDown);
          top: 25px;
          
          .hp-summary {
            margin-right:20px;
          }
          
          label {
            width: 50%;
          }
          
          &:after {
            display: block;
            position: absolute;
            height: auto;
            width: 0px;
            left: 0px;
            content: "";
            margin: 5px 15px;
          }
          .hp-usage {
            label {
              left: -60px;
              color: $primary-color;
            }
          }
          
          .hp-device-address, .hp-uplink-group, .hp-uplink-networks {
            margin-top: 5px;
            margin-left: 5px;
          }
        }
      }
    }
  }
}

.hp-backplane-connect {
  width: 50px;
  height: 23px;
  background: url($img-file);
  background-position: -140px -140px;
  background-repeat: no-repeat;
}
