.alert_holder {
  margin: -16px;

  .alert-link {
    font-weight: $gl-font-weight-normal;
  }
}

.new_project,
.edit-project,
.import-project {

  .help-block {
    margin-bottom: 10px;
  }

  .project-path .form-control {
    border-radius: $border-radius-base;
  }

  .input-group > div {

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

  @media (max-width: $screen-xs-max) {
    .input-group > div {

      margin-bottom: 14px;

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

    fieldset > .form-group:first-child {
      padding-right: 0;
    }
  }

  .input-group-addon {

    &.static-namespace {
      height: 35px;
      border-radius: 3px;
      border: 1px solid $border-color;
    }

    + .select2 a,
    + .btn-default {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }
  }
}

.toggle-wrapper {
  margin-top: 5px;
}

.project-feature-row > .toggle-wrapper {
  margin: 10px 0;
}

.project-visibility-setting,
.project-feature-settings {
  border: 1px solid $border-color;
  padding: 10px 32px;

  @media (max-width: $screen-xs-min) {
    padding: 10px 20px;
  }
}

.project-visibility-setting .request-access {
  line-height: 2;
}

.project-feature-settings {
  background: $gray-lighter;
  border-top: 0;
  margin-bottom: 16px;
}

.project-repo-select {
  transition: background 2s ease-out;

  &:disabled {
    opacity: 0.5;
    pointer-events: none;
  }

  .highlight-changes & {
    background: $highlight-changes-color;
    transition: none;
  }
}

.project-feature-controls {
  display: flex;
  align-items: center;
  margin: 8px 0;
  max-width: 432px;

  .toggle-wrapper {
    flex: 0;
    margin-right: 10px;
  }

  .select-wrapper {
    flex: 1;
  }
}

.project-feature-setting-group {
  padding-left: 32px;

  .project-feature-controls {
    max-width: 400px;
  }

  @media (max-width: $screen-xs-min) {
    padding-left: 20px;
  }
}

.project-feature-toggle {
  position: relative;
  border: 0;
  outline: 0;
  display: block;
  width: 100px;
  height: 24px;
  cursor: pointer;
  user-select: none;
  background: $feature-toggle-color-disabled;
  border-radius: 12px;
  padding: 3px;
  transition: all .4s ease;

  &::selection,
  &::before::selection,
  &::after::selection {
    background: none;
  }

  &::before {
    color: $feature-toggle-text-color;
    font-size: 12px;
    line-height: 24px;
    position: absolute;
    top: 0;
    left: 25px;
    right: 5px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: animate-disabled .2s ease-in;
    content: attr(data-disabled-text);
  }

  &::after {
    position: relative;
    display: block;
    content: "";
    width: 22px;
    height: 18px;
    left: 0;
    border-radius: 9px;
    background: $feature-toggle-color;
    transition: all .2s ease;
  }

  &.checked {
    background: $feature-toggle-color-enabled;

    &::before {
      left: 5px;
      right: 25px;
      animation: animate-enabled .2s ease-in;
      content: attr(data-enabled-text);
    }

    &::after {
      left: calc(100% - 22px);
    }
  }

  &.disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  @media (max-width: $screen-xs-min) {
    width: 50px;

    &::before,
    &.checked::before {
      display: none;
    }
  }

  @keyframes animate-enabled {
    0%, 35% { opacity: 0; }
    100% { opacity: 1; }
  }

  @keyframes animate-disabled {
    0%, 35% { opacity: 0; }
    100% { opacity: 1; }
  }
}

.project-home-panel,
.group-home-panel {
  padding-top: 24px;
  padding-bottom: 24px;

  @media (min-width: $screen-sm-min) {
    border-bottom: 1px solid $border-color;
  }

  .project-avatar,
  .group-avatar {
    float: none;
    margin: 0 auto;

    &.identicon {
      border-radius: 50%;
    }
  }

  .project-title,
  .group-title {
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: $gl-font-weight-normal;
    line-height: 1;
    word-wrap: break-word;

    .fa {
      margin-left: 2px;
      font-size: 12px;
      vertical-align: middle;
    }
  }

  .project-home-desc,
  .group-home-desc {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0;
    max-width: 700px;

    > p {
      margin-bottom: 0;
    }
  }

  .notifications-btn {
    .fa-bell,
    .fa-spinner {
      margin-right: 6px;
    }

    .fa-angle-down {
      margin-left: 6px;
    }
  }
}

.nav > .project-repo-buttons {
  margin-top: 0;
}

.project-repo-buttons,
.group-buttons {
  .btn {
    @include btn-gray;
    padding: 3px 10px;

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

    .fa {
      color: $layout-link-gray;
    }

    svg {

      path {
        fill: $layout-link-gray;
      }

      use {
        stroke: $layout-link-gray;
      }
    }

    .fa-caret-down {
      margin-left: 3px;
    }
  }

  .project-action-button {
    margin: 15px 5px 0;
    vertical-align: top;
  }

  .notification-dropdown .dropdown-menu {
    @extend .dropdown-menu-align-right;
  }

  .download-button {
    @media (max-width: $screen-md-max) {
      margin-left: 0;
    }
  }

  .count-buttons {
    display: inline-block;
    vertical-align: top;
    margin-top: 15px;
  }

  .project-clone-holder {
    display: inline-block;
    margin: 15px 5px 0 0;

    input {
      height: 28px;
    }
  }

  .count-with-arrow {
    display: inline-block;
    position: relative;
    margin-left: 4px;

    .arrow {
      &::before {
        content: '';
        display: inline-block;
        position: absolute;
        width: 0;
        height: 0;
        border-color: transparent;
        border-style: solid;
        top: 50%;
        left: 0;
        margin-top: -6px;
        border-width: 7px 5px 7px 0;
        border-right-color: $count-arrow-border;
        pointer-events: none;
      }

      &::after {
        content: '';
        position: absolute;
        width: 0;
        height: 0;
        border-color: transparent;
        border-style: solid;
        top: 50%;
        left: 1px;
        margin-top: -9px;
        border-width: 10px 7px 10px 0;
        border-right-color: $white-light;
        pointer-events: none;
      }
    }

    .count {
      @include btn-gray;
      display: inline-block;
      background: $white-light;
      border-radius: 2px;
      border-width: 1px;
      border-style: solid;
      font-size: 13px;
      font-weight: $gl-font-weight-bold;
      line-height: 13px;
      letter-spacing: .4px;
      padding: 6px 14px;
      text-align: center;
      vertical-align: middle;
      touch-action: manipulation;
      background-image: none;
      white-space: nowrap;
      margin: 0 10px 0 4px;

      a {
        color: inherit;
      }

      &:hover {
        background: $white-light;
      }
    }
  }
}

.project-repo-buttons {
  @include new-style-dropdown;

  .project-action-button .dropdown-menu {
    max-height: 250px;
    overflow-y: auto;
  }
}

.split-one {
  display: inline-table;
  margin-right: 12px;

  > a {
    margin: -1px;
  }
}

.save-project-loader {
  margin-top: 50px;
  margin-bottom: 50px;
  color: $save-project-loader-color;
}

.transfer-project .select2-container {
  min-width: 200px;
}

.deploy-key-content {
  @media (min-width: $screen-sm-min) {
    float: left;

    &:last-child {
      float: right;
    }
  }
}

.deploy-key-projects {
  @media (min-width: $screen-sm-min) {
    line-height: 42px;
  }
}

a.deploy-project-label {
  padding: 5px;
  margin-right: 5px;
  color: $gl-text-color;
  background-color: $row-hover;

  &:hover {
    color: $gl-link-color;
  }
}

.vs-public {
  color: $gl-primary;
}

.vs-internal {
  color: $gl-warning;
}

.vs-private {
  color: $gl-success;
}

.lfs-enabled {
  color: $gl-success;
}

.lfs-disabled {
  color: $gl-warning;
}

.breadcrumb.repo-breadcrumb {
  flex: 1;
  padding: 0;
  background: transparent;
  border: 0;
  line-height: 34px;
  margin: 0;

  > li + li::before {
    padding: 0 3px;
    color: $project-breadcrumb-color;
  }

  a {
    color: $gl-text-color;
  }

  .dropdown-menu {
    width: 240px;
  }
}

.fork-thumbnail {
  height: 200px;
  width: calc((100% / 2) - #{$gl-padding * 2});

  @media (min-width: $screen-md-min) {
    width: calc((100% / 4) - #{$gl-padding * 2});
  }

  @media (min-width: $screen-lg-min) {
    width: calc((100% / 5) - #{$gl-padding * 2});
  }

  &:hover:not(.disabled),
  &.forked {
    background-color: $row-hover;
    border-color: $row-hover-border;
  }

  .avatar-container,
  .identicon {
    float: none;
    margin-left: auto;
    margin-right: auto;
  }

  a {
    display: block;
    width: 100%;
    height: 100%;
    padding-top: $gl-padding;
    text-decoration: none;

    &.disabled {
      opacity: .3;
      cursor: not-allowed;
    }
  }
}

.fork-thumbnail-container {
  display: flex;
  flex-wrap: wrap;
  margin-left: -$gl-padding;
  margin-right: -$gl-padding;

  > h5 {
    width: 100%;
  }
}

.project-template {
  > .form-group {
    margin-bottom: 0;
  }

  .template-option {
    padding: $gl-padding $gl-padding $gl-padding ($gl-padding * 4);
    position: relative;

    &:not(:first-child) {
      border-top: 1px solid $border-color;
    }
  }

  .template-title {
    font-size: 16px;
  }

  .template-description {
    margin: 6px 0 12px;
  }

  .template-button {
    input {
      position: absolute;
      clip: rect(0, 0, 0, 0);
    }
  }

  svg {
    position: absolute;
    left: $gl-padding;
    top: $gl-padding;
  }

  .project-fields-form {
    display: none;

    &.selected {
      display: block;
      padding: $gl-padding;
    }
  }

  .template-input-group {
    position: relative;

    @media (min-width: $screen-sm-min) {
      display: flex;
    }

    .input-group-addon {
      flex: 1;
      text-align: left;
      padding-left: ($gl-padding * 3);
      background-color: $white-light;
    }

    .selected-template {
      line-height: 20px;
    }

    .selected-icon {
      svg {
        display: none;
        top: 7px;
        height: 20px;
        width: 20px;

        &.active {
          display: block;
        }
      }
    }
  }
}

.gitlab-tab-content {
  .import-project-pane {
    padding-bottom: 6px;
  }
}

.project-import {
  .import-btn-container {
    margin-bottom: 0;
  }

  .toggle-import-form {
    padding-bottom: 10px;
  }

  .import-buttons {
    padding-left: 0;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;

    .btn {
      padding: 8px;
      margin-right: 10px;
    }

    .btn-template-icon {
      height: 24px;
      width: inherit;
      display: block;
      margin: 0 auto 4px;
      font-size: 24px;

      @media (min-width: $screen-xs-max) {
        top: 0;
      }
    }

    @media (max-width: $screen-xs-max) {
      .btn-template-icon {
        display: inline-block;
        height: 14px;
        font-size: 14px;
        margin: 0;
      }
    }

    > div {
      margin-bottom: 10px;
      padding-left: 0;
    }
  }
}

.create-project-options {
  display: flex;

  @media (max-width: $screen-xs-max) {
    display: block;
  }

  .first-column {
    @media(min-width: $screen-xs-min) {
      max-width: 50%;
      padding-right: 30px;
    }

    @media(max-width: $screen-xs-max) {
      max-width: 100%;
      width: 100%;
    }
  }

  .second-column {
    @media(min-width: $screen-xs-min) {
      width: 50%;
      flex: 1;
      padding-left: 30px;
      position: relative;
    }

    @media(max-width: $screen-xs-max) {
      max-width: 100%;
      width: 100%;
      padding-left: 0;
      position: relative;
    }

    // Mobile
    @media (max-width: $screen-xs-max) {
      padding-top: 30px;
    }

    &::before {
      content: "OR";
      position: absolute;
      left: -10px;
      top: 50%;
      z-index: 10;
      padding: 8px 0;
      text-align: center;
      background-color: $white-light;
      color: $gl-text-color-tertiary;
      transform: translateY(-50%);
      font-size: 12px;
      font-weight: $gl-font-weight-bold;
      line-height: 20px;

      // Mobile
      @media (max-width: $screen-xs-max) {
        left: 50%;
        top: 0;
        transform: translateX(-50%);
        padding: 0 8px;
      }
    }

    &::after {
      content: "";
      position: absolute;
      background-color: $border-color;
      bottom: 0;
      left: 0;
      right: auto;
      height: 100%;
      width: 1px;
      top: 0;

      // Mobile
      @media (max-width: $screen-xs-max) {
        top: 10px;
        left: 10px;
        right: 10px;
        height: 1px;
        width: auto;
      }
    }
  }
}


.project-stats {
  font-size: 0;
  text-align: center;
  max-width: 100%;
  border-bottom: 1px solid $border-color;

  .nav {
    padding-top: 12px;
    padding-bottom: 12px;

    > li {
      display: inline-block;

      &:not(:last-child) {
        margin-right: $gl-padding;
      }

      &.right {
        vertical-align: top;
        margin-top: 0;

        @media (min-width: $screen-lg-min) {
          float: right;
        }
      }

      > a {
        padding: 0;
        background-color: transparent;
        font-size: 14px;
        line-height: 29px;
        color: $notes-light-color;

        &:hover,
        &:focus {
          color: $gl-text-color;
        }
      }
    }
  }

  li.missing {
    border: 1px dashed $border-gray-normal-dashed;
    border-radius: $border-radius-default;

    a {
      padding-left: 10px;
      padding-right: 10px;
      color: $notes-light-color;
      display: block;
    }

    &:hover {
      background-color: $gray-normal;
    }
  }
}

pre.light-well {
  border-color: $well-light-border;
}

.git-empty {
  margin: 0 7px 7px;

  h5 {
    color: $gl-text-color;
  }

  .light-well {
    border-radius: 2px;

    color: $well-light-text-color;
    font-size: 13px;
    line-height: 1.6em;
  }
}

.project-footer {
  margin-top: 20px;

  .btn-remove {
    @include btn-middle;
    @include btn-red;

    float: left !important;
  }
}

/*
 * Projects list rendered on dashboard and user page
 */
.projects-list {
  @include basic-list;
  display: flex;
  flex-direction: column;

  // Disable Flexbox for admin page
  &.admin-projects {
    display: block;

    .project-row {
      display: block;
    }
  }

  .project-row {
    @include basic-list-stats;
    display: flex;
    align-items: center;
  }

  h3 {
    font-size: $gl-font-size;
  }

  .avatar-container,
  .controls {
    flex: 0 0 auto;
  }

  .avatar-container {
    align-self: flex-start;

    > a {
      width: 100%;
    }
  }

  .project-details {
    min-width: 0;

    p,
    .commit-row-message {
      @include str-truncated(100%);
      margin-bottom: 0;
    }
  }

  .controls {
    margin-left: auto;
    text-align: right;
  }

  .ci-status-link {
    display: inline-block;
    line-height: 17px;
    vertical-align: middle;

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

.panel .projects-list li {
  padding: 10px 15px;
  margin: 0;
}

.commits-search-form {
  .input-short {
    min-width: 200px;
  }
}

.git-clone-holder {
  width: 380px;

  .btn-clipboard {
    border: 1px solid $border-color;
  }

  .clone-options {
    display: table-cell;

    a.btn {
      width: 100%;
    }
  }

  .form-control {
    @extend .monospace;
    background: $white-light;
    font-size: 14px;
    margin-left: -1px;
    cursor: auto;
    width: 101%;
  }
}

.cannot-be-merged,
.cannot-be-merged:hover {
  color: $error-exclamation-point;
  margin-top: 2px;
}

.private-forks-notice .private-fork-icon {
  i:nth-child(1) {
    color: $project-private-forks-notice-odd;
  }

  i:nth-child(2) {
    color: $white-light;
  }
}

.new-protected-branch,
.new-protected-tag {
  @include new-style-dropdown;

  label {
    margin-top: 6px;
    font-weight: $gl-font-weight-normal;
  }
}

.create-new-protected-branch-button,
.create-new-protected-tag-button {
  @include dropdown-link;

  width: 100%;
  background-color: transparent;
  border: 0;
  text-align: left;
  text-overflow: ellipsis;
}

.protected-branches-list,
.protected-tags-list {
  @include new-style-dropdown;

  margin-bottom: 30px;

  .settings-message {
    margin: 0;
    border-radius: 0 0 1px 1px;
    padding: 20px 0;
    border: 0;
  }

  .table-bordered {
    border-radius: 1px;

    th:not(:last-child),
    td:not(:last-child) {
      border-right: solid 1px transparent;
    }
  }
}

.protected-tags-list,
.protected-branches-list {
  .dropdown-menu-toggle {
    width: 100%;
    max-width: 300px;
  }

  .flash-container {
    padding: 0;
  }
}

.custom-notifications-form {
  .is-loading {
    .custom-notification-event-loading {
      display: inline-block;
    }
  }
}

.custom-notification-event-loading {
  display: none;
  margin-left: 5px;

  &.is-done {
    color: $gl-text-green;
  }
}

.project-refs-form .dropdown-menu,
.dropdown-menu-projects {
  width: 300px;

  @media (min-width: $screen-sm-min) {
    width: 500px;
  }

  a {
    white-space: normal;
  }
}

.compare-form-group {
  .dropdown-menu,
  .inline-input-group {
    width: 100%;

    @media (min-width: $screen-sm-min) {
      width: 300px;
    }
  }

  + .compare-ellipsis {
    width: 100%;
    vertical-align: middle;
    text-align: center;
    margin-top: -20px;

    @media (min-width: $screen-sm-min) {
      margin-top: 0;
      width: auto;
    }
  }
}

.clearable-input {
  position: relative;

  .clear-icon {
    @extend .fa-times;
    display: none;
    position: absolute;
    right: 7px;
    top: 7px;
    color: $location-icon-color;

    &::before {
      font-family: FontAwesome;
      font-weight: $gl-font-weight-normal;
      font-style: normal;
    }
  }

  &.has-value {
    .clear-icon {
      cursor: pointer;
      display: block;
    }
  }
}

.project-path {
  .form-control {
    min-width: 100px;
  }

  &.form-group {
    @media (min-width: $screen-sm-min) {
      margin-bottom: 0;
    }
  }

  .select2-choice {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
}

.project-home-empty {
  border-top: 0;

  .container-fluid {
    background: none;
  }

  p {
    margin-left: auto;
    margin-right: auto;
    max-width: 650px;
  }
}

.project-feature {
  padding-top: 10px;

  @media (min-width: $screen-sm-min) {
    padding-left: 45px;
  }

  &.nested {
    @media (min-width: $screen-sm-min) {
      padding-left: 90px;
    }
  }
}

.variables-table {
  table-layout: fixed;

  &.table-responsive {
    border: 0;
  }

  .variable-key {
    max-width: 120px;
    overflow: hidden;
    word-wrap: break-word;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .variable-value {
    max-width: 150px;
    overflow: hidden;
    word-wrap: break-word;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .variable-menu {
    text-align: right;
  }
}

.services-installation-info .row {
  margin-bottom: 10px;
}

.service-installation {
  padding: 32px;
  margin: 32px;
  border-radius: 3px;
  background-color: $white-light;

  h3 {
    margin-top: 0;
  }

  hr {
    margin: 32px 0;
    border-color: $border-color;
  }
}
