@import 'ctl_base_ui/colors';
@import 'ctl_base_ui/mixins';
@import 'ctl_base_ui/icons';
@import 'ctl_base_ui/typography';
@import 'panamax/extensions';

h1 + header {
  border-bottom: 1px solid $grey;
}

section.applications {
  display: table;
  border-collapse: collapse;
  table-layout: fixed;
  margin-bottom: 20px;
  width: 100%;

  > div {
    display: table-row;
    border-bottom: 1px solid $light_grey;
    width: 100%;
    height: 75px;
    color: $dark_grey;

    > div {
      display: table-cell;
    }
  }
  .name, .info {
    vertical-align: middle;
  }

  .name {
    font-size: 0.8em;

    a {
      vertical-align: middle;
      font-size: 2.2em;
      text-decoration: none;

      &:hover {
        border-bottom: 1px solid $blue_grey_dark;
        color: $blue_grey_dark;
      }
    }
  }

  .info {
    > a {
      margin: 0 8px 0 10px;
    }
    span {
      display: inline-block;
      margin-top: 3px;
    }
  }

  .actions {
    width: 420px;
    padding-top: 20px;
    position: relative;
  }

  .select-target-container {
    width: 255px;
    margin-top: 10px;
  }

  .select-target {
    @include border-radius(0.3em);
    @include border-box;
    width: 255px;
    position: absolute;
    margin: 10px 0 0;
    background: $orange;
    overflow:hidden;
    border-radius: 0.3em;
    padding: 10px 30px 11px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;

    &.expanded {
      header:after {
        @extend .icon-thick-arrow-down;
        content: '';
        position: absolute;
        right: 10px;
        top: 12px;
        display: block;
        @include icon-white;
        width: 10px;
        height: 10px;
      }

      .target-options {
        padding-top: 20px;
        height: 50px;
      }
    }

    header {
      color: $white;
      font-size: 14px;

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

    a {
      color: $white;
      text-decoration: none;
      font-size: 13px;
      font-weight: normal;

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

    .target-options {
      @include transition('height 0.5s, padding 0.5s');
      height: 0;
      text-align: left;
      overflow: hidden;

      li {
        padding: 5px 0;
      }
    }
  }

  .select-target.disabled {
    cursor: not-allowed;
  }
}

header.application {
  position: relative;
  border-bottom: 1px solid $grey;
  padding-bottom: 15px;
  margin-bottom: 20px;

  h1.breadcrumbs {
    display: inline-block;
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    + .imagelayers-link {
      display: inline-block;
      float: none;
    }
  }
}

a.button-add-positive {
  margin-top: 10px;
}

.settings-container {
  width: 48px;
  height: 39px;
  position: relative;
  @include transition('background 0.2s ease 0.42s');

  &:before {
    @include icon-light-grey;
    @extend .icon-sprocket-large;
    content: '';
    display: block;
    position: absolute;
    top: 8px;
    left: 5px;
    width: 30px;
    height: 30px;
  }

  &:after {
    @include icon-light-grey;
    @extend .icon-thick-arrow-down;
    content: '';
    display: block;
    position: absolute;
    top: 12px;
    right: 5px;
  }

  &:hover {
    cursor: pointer;
  }

  &.expanded {
    background: $dark_grey;
    @include transition('background 0.001s ease');


    &:before {
      @include icon-white;
    }

    &:after {
      @include icon-white;
    }

    .settings-menu {
      max-height: 210px;
    }
  }

  .settings-menu {
    @extend .expandable;
    position: absolute;
    box-sizing: border-box;
    top: 39px;
    right: 0;
    width: 215px;
    background: $dark_grey;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
    z-index: 100;

    li {
      padding: 0px 10px 5px 10px;
      margin-left: 0;

      &:first-child {
        padding-top: 5px;
      }
    }

    .template, .deploy, .delete, .reload, .export {
      background-color: transparent;

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

      &:after {
        @include icon-light-grey;
        left: 5px;
      }

      &:hover {
        background-color: transparent;
        text-decoration: underline;
      }
    }

    .disabled {
      color: $white;
    }
  }
}

#app-from-compose-modal {
  display: none;
  overflow: auto;

  &.ui-dialog-content {
    padding-left: 0;
    padding-right: 0;
  }

  input[type=file] {
    position: fixed;
    top: -1000px;
  }

  .import-file-name {
    font-family: $monospace_font_family;
  }

  #app_compose_yaml_uri {
    width: 760px;
  }
  
  #tabs {
    ul {
      border-bottom: 1px solid $medium_grey;
      padding: 20px 20px 0;
    }

    li {
      display: inline;
      list-style-type: none;

      &.ui-state-active {
        a {
          background-color: white;
          color: $blue_grey;
        }
      }

      a {
        display: inline-block;
        background-color: $medium_grey;
        color: $blue_grey_dark;
        padding: .9em 15px;
        text-decoration: none;
        border-top: 1px solid $medium_grey;
        border-right: 1px solid $medium_grey;
        border-left: 1px solid $medium_grey;
        margin-right: 15px;
      }
    }

    div, p {
      padding: 15px;
    }
  }
}

#gistConfirmationDialog {
  display: none;
}

.dialog-dialog {
  background-color: transparent;
  border: none;
  box-shadow: none;
  color: $white;

  &:focus {
    outline: none;
  }

  .ui-dialog-titlebar {
    display: none;
  }

  .ui-dialog-content {
    overflow: hidden;
    text-align: center;
    margin-top: 60px;

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

    li {
      display: inline-block;

      &:first-child {
        margin-right: 20px;
      }

      a.cancel-export {
        color: $white;
      }

      a.button-primary,
      a.cancel-export:hover {
        text-decoration: none;
      }
    }

  }
}
