/* Additional CSS for infrastructure. */
@import "../../bootstrap/less/variables.less";

// global layout
html,
body {
  width: 100%;
  height: 100%;
}

// sidebar
.sidebar {
  font-size: 95%;
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 240px;
  border-right: 1px solid rgb(210,210,210);
  background: rgb(235,235,235);

  h1.brand {
    text-align: center;

    a {
      display: inline-block;
      width: 80px;
      height: 85px;
      background-size: 80px 85px;
      float: none;
      margin: 20px 0;
    }
  }

  .nav-tabs {
    margin-top: -30px;
    border-bottom: 1px solid rgb(200,200,200);

    a {
      position: relative;
      top: 1px;
      padding: 7px 10px;
    }

    li.active a,
    li a:hover {
      background: rgb(235,235,235);
      border: 1px solid rgb(200,200,200);
      border-bottom: 0 none;
    }
  }

  .main_nav {
    text-align: right;
    margin-right: 0;
    width: 100%;

    li {
      display: inline-block;
      text-align: left;
    }

    a {
      margin: 0;
      position: relative;
      right: -1px;
      border: 1px solid rgb(200,200,200);
      border-right: 0 none;
      border-radius: 4px 0 0 4px;
    }
  }
}

// right part
#main_content {
  padding: 15px 0 25px 0;
  margin-left: 240px;

  // topbar
  .topbar {
    padding: 0 30px 0 30px;
    margin: 0;
    background: white;
    color: rgb(180, 180, 180);
    border: 0 none;

    .page-header {
      font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    }

    h2 {
      font-weight: lighter;
      font-size: 19px;
      color: rgb(180, 180, 180);
      line-height: 24px;
    }

    #user_info {
      position: relative;
      color: inherit;

      a {
        color: rgb(130, 190, 245);
      }
    }
  }

  .row-fluid {
    margin: 15px 0 40px;
  }

  // content area
  & > .row-fluid {
    padding: 0 30px;
    margin: 0;
    width: auto;
  }
}

// navigations
#main_content {
  .nav-tabs {
    margin: 0 0 20px;
    border: 0 none;
    border-top: 1px solid rgb(230,230,230);

    li a {
      position: relative;
      top: -1px;
      border-radius: 0 0 2px 2px;
      text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
      border-top-width: 0;
    }

    li.active a {
      border: 1px solid rgb(220, 220, 220);
      background: rgb(110, 110, 110);
      color: white;
      text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    }

    li:not(.active) a:hover {
      border: 1px solid rgb(240, 240, 240);
      border-top-width: 0;
      background: rgb(244, 244, 244);
    }
  }

  .tab-content {
    padding: 0;
    border: 0 none;
  }
}

// index pages layout
#main_content {
  #resource_management_tabs {
    font-size: 130%;
    border: 0 none;
    border-bottom: 1px solid rgb(200, 200, 200);
    font-weight: lighter;

    a {
      padding: 13px 18px;
      border-top-width: 1px;
      border-bottom-width: 0;
      border-radius: 2px 2px 0 0;
    }

    li.active a,
    li:not(.active) a:hover {
    }
  }
}

// tables
table.table {
  th.table_header {
    padding: 10px 0;
    background: none;
  }

  th {
    background: linear-gradient(rgb(244,244,244), rgb(235,235,235));
    font-size: 85%;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
  }

  tfoot {
    color: rgb(180,180,180);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);

    tr td {
      background: linear-gradient(rgb(244,244,244), rgb(235,235,235));
      padding: 7px 12px;
      height: auto;
    }
  }

  .table_actions {
    width: 100%;
    text-align: right;
  }

  .table_title {
    display: none;
  }

  .table_search {
    float: left;
  }

  tr td {
    padding: 0px 10px;
    line-height: 1;
    height: 40px;
    vertical-align: middle;

    &.anchor {
      padding: 0;

      a {
        padding: 4px 10px;
      }
    }
  }

  .table_search input {
    padding-left: 10px;
  }

  .table-bordered tr.table_caption + tr th:first-child {
    border-top-left-radius: 2px;
  }

  .table-bordered tr.table_caption + tr th:last-child {
    border-top-right-radius: 2px;
  }

  .table-bordered tfoot tr td:first-child {
    border-bottom-left-radius: 2px;
  }

  .table-bordered tfoot tr td:last-child {
    border-bottom-right-radius: 2px;
  }
}

// detail pages
#main_content {
  h3 {
    font-weight: lighter;
    font-size: 26px;
    color: rgb(80,80,80);
    margin-bottom: 3px;
    margin: 0 0 3px 0;
  }

  h4 {
    font-weight: lighter;
    font-size: 18px;
    color: rgb(160,160,160);
    margin-bottom: 3px;
  }

  dl {
    dt {
      width: 130px;
      float: left;
      font-weight: normal;
      color: rgb(160,160,160);
      line-height: 1.7;

      &:after {
        content: ":";
        display: inline;
      }
    }

    dd {
      margin-left: 130px;
      line-height: 1.7;
    }
  }
}


// capacities
table.capacities {
  &.overall_usage {
    margin-top: 5px;
  }

  td {
    padding: 3px;

    &.capacity_label {
      width: 60px;
      padding-right: 5px;
      color: rgb(160,160,160);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    & div.capacity_bar {
      line-height: 0;
      width: 120px;
    }
  }
}

// flavor usages
div.flavor_usage_bar {
  max-width: 550px;
}

table.flavor_usages {
  width: 100%;
  max-width: 550px;

  td {
    text-align: center;
    padding: 3px;

    &.flavor_usage_label {
      width: 60px;
      text-align: center;
    }

    &.flavor_usage_text {
      width: 60px;
      text-align: center;
      line-height: 1;
    }

    & div.flavor_usage_bar {
      width: auto;
      text-align: center;
      line-height: 0;
      height: 120px;
    }
  }
}

#interval_selector {
  position: absolute;
  right: 15px;
  top: 15px;

  li {
    display: inline;
    list-style-type: none;
    padding-right: 5px;

    &.active {
      font-weight: bold;

      a {
        color: black;

        &:hover {
          text-decoration:none;
        }
      }
    }
  }
}

svg {
  .axis {
    path, line {
      fill: none;
      stroke: #000;
      shape-rendering: crispEdges;
    }
  }
}

.communication_chart_wrapper {
  display:inline-block;
  vertical-align: middle;
  width: 38%;
}

.communication_chart_connection {
  display:inline-block;
  width: 60px;
  height: 30px;
  vertical-align: middle;
  background: url('/static/dashboard/img/communication_flow.png') no-repeat 50% 50%;
  background-size: 40px 20px;
}

.circles_chart_time_picker {
  float: right;
}

.csv_rack_table {
  padding-top: 40px;
}

// breadcrumbs

.breadcrumbs {
  font-size: 85%;
  margin: 0 0 25px 0;

  a {
    color: rgb(170, 170, 170);
    text-decoration: underline;

    &:hover {
      text-decoration: none;
      color: rgb(100, 100, 100);
    }
  }

  .separator {
    color: rgb(200, 200, 200);

    &:before {
      display: inline;
      content: ">>";
      margin: 0 7px;
    }

    &:last-child:after {
      display: inline;
      content: "...";
    }
  }
}

// others
.btn,
input {
  border-radius: 2px;
}

.btn-group .btn:first-child {
  border-radius: 2px 0 0 2px;
}

.btn-group .btn:last-child {
  border-radius: 0 2px 2px 0;
}

.btn:not(.btn-danger) {
  background: rgb(243, 243, 243);

  &:hover {
    background: rgb( 235, 235, 235);
  }

  &.btn-primary {
    background: #0088cc;

    &:hover {
      background: #006Dcc;
    }
  }
}

.btn-toolbar.pull-right {
  margin: 0;
}

.alerts .icon-warning-sign {
  padding-right: 5px;
}

.well {
  background: rgb(249, 249, 249);
  border-width: 1px;
  box-shadow: none;
}

// forms
.modal {
  .help_text,
  .right {
    display: none;
  }
}

// formsets
.datatable {
  th.narrow {
    width: 1em;
  }

  input {
    padding: 2px 5px;
    margin: 0;
  }

  input.number_input_slim {
    width: 4em;
    text-align: right;
  }

  th span.required:after {
    // Copied from horizon.less, because there is no way to reuse their class.
    content: "*";
    font-weight: bold;
    line-height: 0;
    padding-left: 4px;
    color: #3290c0;
  }
}

.big-number {
  font-size: 1.5em;
}

#nodes-formset-datatable .datatable tbody {
  input {
    padding: 2px 1px;
  }
  input.number_input_slim {
    width: 3em;
  }
  td {
    padding: 2px;
    text-align: center;
    a.close {
        margin-right: 4px;
    }
  }
}

// Register nodes formset
.register-nodes-formset {
  a.add-node-link {
    display: block;
    margin-top: 6px;
  }
  .nav-tabs > .active > a {
    color: @white;
    background-color: @linkColor;
  }
  ul.nav-tabs > li span.delete-icon {
    display: none;
  }
  ul.nav-tabs > li.active span.delete-icon {
    display: block;
    margin: 4px 19px 4px 0;
    cursor: pointer;
  }
  ul.nav-tabs > li {
    position: relative;
  }
  ul.nav-tabs > li.active {
    width: 107%;
  }
  ul.nav-tabs > li.active:after {
    display: block;
    content: '';
    position: absolute;
    top: 1px;
    right: -7px;
    border-top: 16px solid transparent;
    border-bottom: 16px solid transparent;
    border-left: 8px solid @linkColor;
  }
  .register-nav-head {
    margin-top: 19px;
  }
  .form h4, .form h3 {
    margin-bottom: 16px;
  }
  .form label.checkbox {
    font-weight: normal;
  }
}

