@import 'ctl_base_ui/variables';
@import 'ctl_base_ui/colors';
@import 'ctl_base_ui/mixins';
@import 'ctl_base_ui/icons';
@import 'panamax/mixins';

body {
  min-width: 960px;
}

a:focus {
  outline: none;
}

body > header {
  background: $ctl_light_green;
  width: 100%;
  margin-bottom: 10px;

  &:after {
    content: " ";
    display: block;
    clear: both;
    font-size: 0;
    height: 0;
    visibility: hidden;
  }

  h1 {
    border: none;
    float: left;
    padding: 0;
    margin: 0;
  }

  h1.panamax-logo a {
    @include border-box;
    @include hide-text;
    background: image-url('pmx_logo.svg') no-repeat center center $dark_grey;
    @include background-size(148px, 19px);
    width: 178px;
    display: block;
    height: 60px;
  }

  nav {
    float: left;

    ul li {
      float: left;

      &:hover a {
        background-color: $lime;
      }

      a {
        @include border-box;
        color: $white;
        display: block;
        padding: 10px 40px 10px 55px;
        line-height: 40px;
        text-decoration: none;
        position: relative;
        font-size: 0.8em;
        text-transform: uppercase;
        font-weight: 400;
        letter-spacing: 2px;

        &:before {
          display: block;
          content: '';
          position: absolute;
          left: 20px;
          top: 20px;
        }
      }
    }
  }
}

body > header nav ul li {
  &.search-link a:before {
    @extend .icon-magnifying-glass-large;
    @include icon-white;
  }
  &.manage-link a:before {
    @extend .icon-sprocket-large;
    @include icon-white;
  }
  &.documentation-link a:before {
    @extend .icon-document-large;
    @include icon-white;
  }
  &.about-link > nav > ul > li > a:before {
    margin-top: 5px;
    @extend .icon-thin-arrow-down;
    @include icon-white;
  }
}

/* active states */
#search_flow .search-link a,
#manage_flow .manage-link a {
  background-color: $lime;
}

cite.built-by {
  float: right;
  margin: 3px 15px 13px 0;

  h2 {
    float: left;
    height: 30px;
    width: 140px;
    margin: 0;
    padding: 0;
    @include hide-text;
    background: image-url('ctl_base_ui/ctl_logo_base.svg') no-repeat;
    @include background-size(140px, 30px);
    background-position: center left;
  }
}

.metrics {
  float: left;
  margin-left: 30px;
  margin-bottom: 30px;

  span {
    float: left;
    height: 20px;
    line-height: 20px;
    margin-right: 8px;
    color: $dark_grey;
    font-weight: 400;
    margin-top: 8px;
  }

  .health {
    margin-top: 5px;
    position: relative;
    float: left;
    width: auto;
    height: 12px;

    section {
      font-family: $monospace_font_family;
      font-size: 11px;
      margin-bottom: 2px;
      clear: both;

      .label {
        float: left;
        padding: 0 5px 3px 0;
      }

      .bar {
        float: left;
        height: 8px;
        width: 0;
        @include transition('background-color 0.6s');

        &.danger {
          background-color: $dark_red;
        }

        &.warning {
          background: #F5D04C;
        }

        &.good {
          background: darken($ctl_light_green, 10%);
        }
      }
    }
  }
}

main {
  clear: both;
  width: 960px;
  margin: 0 auto;
}

h1.breadcrumbs {
  ul {
    overflow: hidden;
    box-sizing: border-box;
  }

  ul li {
    float: left;
    font-size: 0.6em;
    margin: 0;
    padding: 0;
    line-height: 1.215em;

    &:not(:first-of-type) {
      padding-left: 10px;
    }

    &:not(:last-of-type):after {
      content: '/';
      color: $grey;
      display: inline-block;
      margin-left: 10px;
    }

    a {
      color: $blue_grey;
    }

    &:last-of-type {
      padding: 0;
      white-space: nowrap;
      position: relative;
      font-size: 1em;
      color: $orange;
      clear: left;
    }
  }
}

//Unified button menu styling

ul[class*='button-menu'] {
  float: right;

  li {
    display: block;
    float: left;
    margin-left: 5px;

    &:first-child {
      margin-left: 0;
    }

    a {
      font-size: 14px;
      color: $white;
      display: inline-block;
      position: relative;
      padding: 10px 10px 10px 25px;
      text-align: left;
      text-decoration: none;
      border-radius: 3px;

      &.template {
        background: $medium_grey;

        &:hover {
          background: $dark_grey;
        }

        &:after {
          @include icon-white;
          @extend .icon-star;
          content: '';
          position: absolute;
          left: 10px;
          top: 11px;
          display: block;
          height: 10px;
          width: 10px;
        }
      }

      &.deploy {
        background: $ctl_light_green;

        &:hover {
          background: $green;
        }

        &:after {
          @include icon-white;
          @extend .icon-outbox;
          content: '';
          position: absolute;
          left: 10px;
          top: 11px;
          display: block;
          height: 10px;
          width: 10px;
        }
      }

      &.reload {
        background: $dark_grey;

        &:hover {
          background: $medium_grey;
        }

        &:after {
          @include icon-white;
          @extend .icon-arrowloop;
          content: '';
          position: absolute;
          left: 10px;
          top: 12px;
          display: block;
          height: 10px;
          width: 10px;
        }
      }

      &.export {
        background: $dark_grey;

        &:hover {
          background: $medium_grey;
        }

        &:after {
          @include icon-white;
          @extend .icon-outbox;
          content: '';
          position: absolute;
          left: 10px;
          top: 12px;
          display: block;
          height: 10px;
          width: 10px;
        }
      }

      &.delete {
        background: $dark_red;

        &:hover {
          background: lighten($dark_red, 10%);
        }

        &:after {
          @include icon-white;
          @extend .icon-x;
          content: '';
          position: absolute;
          left: 10px;
          top: 12px;
          display: block;
          height: 10px;
          width: 10px;
        }
      }

      &.disabled {
        background:$grey;
        color: $dark_grey;

        &:hover {
          background: $grey;
          cursor: not-allowed;
        }

        &:after {
          @include icon-grey;
        }
      }
    }
  }
}

//Unified action menu icons

.actions {
  a.delete-action,
  a.edit-action,
  a.view-action {
    @include hide-text;
    float: left;
    width: 20px;
    height: 100%;
    position: relative;

    &:after {
      @include icon-light-grey;
      left: 5px;
      top: 16px;
      position: absolute;
      content: '';
    }
  }

  a.edit-action,
  a.view-action {
    &:hover:after {
      @include icon-grey;
    }
  }

  a.edit-action {
    &:after {
      @extend .icon-pencil;
    }
  }

  a.view-action {
    &:after {
      @extend .icon-magnifying-glass;
    }
  }

  a.delete-action {
    &:after {
      @extend .icon-x;
    }

    &:hover:after {
      @include icon-red;
    }

    &.disabled {
      &:hover:after {
        @include icon-light-grey;
      }
    }
  }
}


.ui-dialog-buttonset button {
  margin-left: 5px;
}

.ui-dialog {
  position:absolute;
}

// Confirm delete dialog

.confirm-delete {
  position: absolute;
  top: -10px;
  left: 0;
  width: 100%;
  height: 100%;
  color: $medium_grey;
  font-weight: normal;
  font-size: 0.9em;

  span {
    padding: 0;
    display: block;
    margin-top: 3px;

    button {
      padding: 3px 15px;
      border-radius: 3px;
      box-shadow: none;
      border: none;
      outline: none;

      &.yes {
        color: $white;
        background: $dark_red;
        margin-left: 2px;

        &:hover {
          cursor: pointer;
          background: darken($dark_red, 5%);
        }
      }

      &.no {
        background: $medium_grey;
        color: $dark_grey;

        &:hover {
          cursor: pointer;
          background: darken($medium_grey, 5%);
        }
      }
    }
  }
}

.indicate-new {
  background: $yellow;
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 1000;
  top: 0;
  left: 0;
  cursor: not-allowed;
}

.content-editable {
  @include border-radius('5px');
  position: relative;
  margin: 0;
  border: 2px solid $medium_grey;
  background: $white;
  display: block;
  padding: 11px 5px;
  width: 100%;
  box-sizing: border-box;
  outline: 0px solid transparent;

  &:focus {
    outline: 0px solid transparent;
  }

  &:hover {
    cursor: default;
  }

  .edit-field {
    margin-left: 1px;
  }

  *[contenteditable=true] {
    outline: 0px solid transparent;
  }

  .checkmark {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    margin-top: -10px;
    width: 30px;
    height: 30px;
    @extend .icon-checkmark-large;
    @include icon-light-grey;

    &:hover {
      @include icon-grey;
      cursor: pointer;
    }
  }

  .checkmark.dirty {
    width: 30px;
    height: 30px;
    @extend .icon-checkmark-large;
    @include icon-light-green;
  }

  .loading {
    position: absolute;
    top: 50%;
    margin-top: -8px;
    right: 8px;
    width: 16px;
    height: 16px;
    background-image: image-url('icon_loading_green.gif');
    background-position: top left;
    background-repeat: no-repeat;

  }
}

/* Base styles for tooltips */
.tooltip {
  display: block;
  position: absolute;
  z-index: 9999;
  color: $warm_grey;
  background: $yellow;
  font-weight: normal;
  font-size: 0.85em;
  padding: 5px;
  @include border-radius(5px);
  word-wrap: break-word;

  &:before {
    content: '';
    display: block;
    position: absolute;
    border-bottom: 6px solid $yellow;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    top: -6px;
  }
}

footer {
  clear: both;
  margin-top: 70px;
  background: $light_grey;

  .inner {
    padding: 20px;
    overflow: auto;
    max-width: 960px;
    margin: 0 auto;

    #footer-info {
      width: 45%;
      float: left;

      h4 {
        margin-bottom: 0;
        padding-bottom: 0;
      }

      > p {
        padding-bottom: 70px;
      }

      ul li {
        display: inline-block;

        a {
          display: inline-block;
          font-size: 14px;
          margin: 0px 10px 0px 0px;
          text-decoration: none;

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

        &.github-link a {
          @extend .icon-github-large;
        }

        &.twitter-link {
          a {
            @extend .icon-twitter-large;
          }

          &:after {
            content: '|';
            font-weight: 100;
            color: $medium_grey;
            margin-right: 5px;
          }
        }

        &.github-link a,
        &.twitter-link a {
          margin-bottom: -5px;
          width: 20px;
          @include hide-text;
          @include icon-light-grey;

          &:hover {
            @include icon-grey;
          }
        }
      }
    }

    #newsletter {
      width: 45%;
      float: right;

      input[type='email'] {
        width: 240px;
      }

      input[type='submit'] {
        font-weight: normal;
      }
    }
  }
}

.copyright {
  padding: 0;
  margin: 0;

  #logo {
    height: 70px;
    width: 190px;
    display: inline-block;
    background:  image-url('ctl_base_ui/ctl_logo_base.svg') 20px 20px no-repeat #FFF;
    background-size: 140px 30px;
  }

  small {
    margin-left: 0px;
    font-size: 12px;
    vertical-align: 30px;
  }
}

.notice {
  ul {
    list-style: disc;
    list-style-position: inside;

    li {
      font-size: 13px;
    }
  }

  a {
    color: $white;

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

.context-help {
  section.tooltip {
    padding: 10px 15px 10px 10px;
    display: none;
    min-width: 345px;
    max-width: 490px;

    &:before {
      display: none;
    }

    > aside.arrow {
      box-sizing: content-box;
      width: 0;
      height: 0;
      display: block;
      border-left: 6px solid transparent;
      border-right: 6px solid transparent;
      border-bottom: 6px solid $yellow;
      position: absolute;
      left: 30px;
      top: -6px;
    }

    &:hover {
      cursor: auto;
    }

    p {
      font-size: 13px;

      &:last-child {
        padding-bottom: 0;
      }
    }

    pre {
      font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace;
      background-color: lighten($yellow, 10%);
      border: 1px solid darken($yellow, 10%);
      padding: 5px 5px 4px 5px;
    }

    span.dismiss {
      float: right;
      width: 15px;
      height: 15px;
      position: relative;

      &:hover {
        cursor: pointer;
      }

      &:after {
        content: '';
        position: absolute;
        left: 0px;
        top: 5px;
        display: block;
        @include icon-light-grey;
        @extend .icon-x;
        width: 20px;
        height: 20px;
      }
    }
  }
}

em {
  font-style: italic;
}

pre.prettyprint {
  font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace;
  font-size: 0.9em;

  span {
    color: $dark_grey;
    line-height: 1.15em;
  }

  span.com, span.str {
    font-style: normal;
  }

}

.styled-radio {
  width: 30px;
  height: 20px;
  margin: 0 auto;
  display: inline-block;
  position: relative;

  input[type=radio] {
    visibility: hidden;

    &:checked + label:after {
      opacity: 1.0;
    }
  }

  label {
    cursor: pointer;
    position: absolute;
    width: 20px;
    height: 20px;
    top: 0;
    left: 5px;
    border-radius: 10px;
    border: 2px solid $grey;

    &:hover::after {
      opacity: 0.33;
    }

    &:after {
      opacity: 0;
      content: '';
      position: absolute;
      top: 5px;
      left: 5px;
      width: 0;
      height: 0;
      border: 5px solid $dark_grey;
      border-radius: 5px;
    }
  }

}

.styled-check {
  width: 20px;
  margin: 0 auto;
  position: relative;

  input[type=checkbox] {
    visibility: hidden;

    &:checked + label:after {
      opacity: 1.0;
    }
  }

  label {
    cursor: pointer;
    position: absolute;
    width: 20px;
    height: 20px;
    top: 0;
    left: 0;
    border-radius: 4px;
    border: 2px solid $grey;

    &:hover::after {
      opacity: 0.33;
    }

    &:after {
      opacity: 0;
      content: '';
      position: absolute;
      width: 9px;
      height: 5px;
      background: transparent;
      top: 4px;
      left: 4px;
      border: 3px solid $medium_grey;
      border-top: none;
      border-right: none;

      -webkit-transform: rotate(-45deg);
      -moz-transform: rotate(-45deg);
      -o-transform: rotate(-45deg);
      -ms-transform: rotate(-45deg);
      transform: rotate(-45deg);
    }

    em {
      left: 30px;
      top: 3px;
      position: absolute;
      font-style: normal;
    }

  }
}
.tab-container {
  @include flexbox();
  border-collapse: separate;
  border-spacing: 10px 0;
  width: 100%;
  min-height: 460px;

  .tab, .tab > * {
    box-sizing: border-box;
  }

  .column {
    box-sizing: border-box;
    vertical-align: top;
    @include flex-grow(1);
    @include flex-shrink(1);
    @include transition('all 0.6s');

    .title {
      height: 55px;

      h3 {
        @include border-radius(3px);
        background: $blue_grey;
        color: $white;
        font-weight: normal;
        padding: 13px 15px;
        font-size: 16px;
      }
    }

    .content {
      box-sizing: border-box;
      width: 100%;
      min-height: 400px;
      padding: 10px;
      border: 1px solid #ccc;
    }
  }

  .card {
    display: none;
    padding-right: 10px;

    &.active {
      display: block;
    }
  }

  .tabs {
    clear: both;
    position: relative;
    @include flex-basis('185px');

    .tab, .hide {
      width: 185px;
      height: 54px;
      margin-bottom: 10px;
      border-top-left-radius: 3px;
      border-bottom-left-radius: 3px;
      border: 1px solid #ccc;
      border-right: none;
      position: relative;
      background: $light_grey;
      @include transition('all 0.6s');

      &:hover {
        background: $white;
      }

      &.active {
        background: $white;

        .text {
          color: $dark_grey;
          font-weight: bold;
        }

        label {
          border-right: 1px solid $white;
        }

      }

      label {
        left: 1px;
        padding: 10px;
        height: 52px;
        position: absolute;
        width: 100%;
        display: inline-block;

        .icon {
          float: left;
          width: 20px;
          height: 20px;
          margin-top: 5px;
          background-repeat: no-repeat;
        }

        .text {
          float: left;
          font-size: 12px;
          margin: 10px 0 0 10px;
          color: $blue_grey;
          @include transition('opacity 0s');
          transition-delay: 0.5s;
          -webkit-transition-delay: 0.5s;
          -o-transition-delay: 0.5s;
          -moz-transition-delay: 0.5s;
          opacity: 1.0;
        }
      }
    }

    .hide:hover {
      background: none;
      .icon {
        background-position: -20px 0;
      }
    }

    .hide {
      border: none;
      background: none;
      height: 55px;
      margin: 0;

      .icon {
        background-position: 0 0;
      }
    }

    &.slim {
      @include flex-basis('40px');

      .tab {
        width: 40px;
      }

      label .text {
        opacity: 0;
        transition-delay: 0s;
        -webkit-transition-delay: 0s;
        -o-transition-delay: 0s;
        -moz-transition-delay: 0s;
      }
    }
  }

  .cards {
    @include flex-basis('510px');
  }
}

::-webkit-input-placeholder {
  font-style: italic;
}
:-moz-placeholder { /* Firefox 18- */
  font-style: italic;
}
::-moz-placeholder {  /* Firefox 19+ */
  font-style: italic;
}
:-ms-input-placeholder {
  font-style: italic;
}
