/** COLORS **/
.cgray { color: $gl-text-color; }
.clgray { color: $common-gray-light; }
.cred { color: $red-500; }
.cgreen { color: $green-600; }
.cdark { color: $common-gray-dark; }

.fwhite { fill: $white-light; }
.fgray { fill: $gray-700; }

.text-plain,
.text-plain:hover {
  color: $gl-text-color;
}

.text-secondary {
  color: $gl-text-color-secondary;
}

.text-tertiary {
  color: $gl-text-color-tertiary;
}

.text-primary,
.text-primary:hover {
  color: $brand-primary;
}

.text-success,
.text-success:hover {
  color: $brand-success;
}

.text-danger,
.text-danger:hover {
  color: $brand-danger;
}

.text-danger-muted,
.text-danger-muted:hover {
  color: $red-300;
}

.text-warning,
.text-warning:hover {
  color: $brand-warning;
}

.text-info,
.text-info:hover {
  color: $brand-info;
}

.bg-gray-light {
  background-color: $gray-light;
}

.text-break-word {
  word-break: break-all;
}

.text-underline,
.text-underline:hover {
  text-decoration: underline;
}

.hint {
  font-style: italic;
  color: $gl-gray-400;
}

.light { color: $gl-text-color; }

.slead {
  color: $gl-text-color;
  font-size: 14px;
  margin-bottom: 12px;
  font-weight: $gl-font-weight-normal;
  line-height: 24px;
}

.bold {
  font-weight: $gl-font-weight-bold;
}

.tab-content {
  overflow: visible;
}

pre {
  &.clean {
    background: none;
    border: 0;
    margin: 0;
    padding: 0;
  }

  &.wrap {
    word-break: break-word;
    white-space: pre-wrap;
  }
}

hr {
  margin: 24px 0;
  border-top: 1px solid darken($gray-normal, 8%);
}

.str-truncated {
  @include str-truncated;

  &-30 {
    @include str-truncated(30%);
  }

  &-60 {
    @include str-truncated(60%);
  }

  &-100 {
    @include str-truncated(100%);
  }
}

.block-truncated {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  > div:not(.block),
  .str-truncated {
    display: inline;
  }
}

.item-title { font-weight: $gl-font-weight-bold; }

.author-link {
  color: $blue-600;
}

.author-link:hover {
  text-decoration: none;
}

table {
  a code {
    position: relative;
    top: -2px;
    margin-right: 3px;
  }
}

.loading {
  margin: 20px auto;
  height: 40px;
  color: $gl-gray-700;
  font-size: 32px;
  text-align: center;
}

p.time {
  color: $gl-gray-400;
  font-size: 90%;
  margin: 30px 3px 3px 2px;
}

.highlight {
  text-shadow: none;
}

.thin-area {
  height: 150px;
}

// Fix issue with notes & lists creating a bunch of bottom borders.
li.note {
  img { max-width: 100%; }

  .note-title {
    li {
      border-bottom: 0 !important;
    }
  }
}

.markdown {
  img {
    max-width: 100%;
  }
}

.wiki_content code,
.readme code {
  background-color: inherit;
}

.error-message {
  padding: 10px;
  background: $red-400;
  margin: 0;
  color: $white-light;

  a {
    color: $white-light;
    text-decoration: underline;
  }
}

@mixin message($background-color, $border-color, $text-color) {
  border-left: 4px solid $border-color;
  color: $text-color;
  padding: 10px;
  margin-bottom: 10px;
  background: $background-color;
  padding-left: 20px;

  &.centered {
    text-align: center;
  }
}

.warning_message {
  @include message($orange-100, $orange-200, $orange-700);
}

.danger_message {
  @include message($red-100, $red-200, $red-900);
}

.gitlab-promo {
  a {
    color: $gl-gray-350;
    margin-right: 30px;
  }
}

.milestone {
  .progress {
    margin-top: 4px;
    box-shadow: none;
    background-color: $border-gray-light;
  }
}

img.emoji {
  height: 20px;
  vertical-align: top;
  width: 20px;
  margin-top: 1px;
}

.chart {
  overflow: hidden;
  height: 220px;
}

.description-block {
  @extend .light-well;
  @extend .light;
  margin-bottom: 10px;
}

.footer-links {
  margin-bottom: 20px;

  a {
    margin-right: 15px;
  }
}

.card.card-body {
  margin-bottom: $gl-padding;

  hr {
    border-color: $gray-darker;
  }
}

.search_box {
  @extend .card.card-body;
  text-align: center;
}

.dropzone .dz-preview .dz-progress {
  border-color: $border-color !important;

  .dz-upload {
    background: $green-500 !important;
  }

}

.dz-message {
  margin: 0;
}

.space-right {
  margin-right: 10px;
}

.alert {
  margin-bottom: $gl-padding;
}

.progress {
  height: 4px;
}

.project-item-select-holder {
  display: inline-block;
  position: relative;

  .project-item-select {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 250px;
    visibility: hidden;
  }
}

.gl-accessibility {
  &:focus {
    display: flex;
    align-items: center;
    top: 1px;
    left: 1px;
    width: auto;
    height: 100%;
    padding: 0 10px;
    clip: auto;
    text-decoration: none;
    color: $gl-text-color;
    background: $gray-light;
    z-index: 1;
  }
}

.bordered-box {
  border: 1px solid $border-color;
  border-radius: $border-radius-default;
}

.tooltip {
  .tooltip-inner {
    word-wrap: break-word;
  }
}

.disabled-content {
  pointer-events: none;
  opacity: 0.5;
}

.break-word {
  word-wrap: break-word;
}

.checkbox-icon-inline-wrapper {
  .checkbox {
    display: inline;

    label {
      display: inline;
    }
  }
}

.outline-0 {
  outline: 0;

  &:focus {
    outline: 0;
  }
}

/** COMMON CLASSES **/
.prepend-top-0 { margin-top: 0; }
.prepend-top-2 { margin-top: 2px; }
.prepend-top-4 { margin-top: $gl-padding-4; }
.prepend-top-5 { margin-top: 5px; }
.prepend-top-8 { margin-top: $grid-size; }
.prepend-top-10 { margin-top: 10px; }
.prepend-top-15 { margin-top: 15px; }
.prepend-top-default { margin-top: $gl-padding !important; }
.prepend-top-16 { margin-top: 16px; }
.prepend-top-20 { margin-top: 20px; }
.prepend-top-32 { margin-top: 32px; }
.prepend-left-4 { margin-left: 4px; }
.prepend-left-5 { margin-left: 5px; }
.prepend-left-8 { margin-left: 8px; }
.prepend-left-10 { margin-left: 10px; }
.prepend-left-15 { margin-left: 15px; }
.prepend-left-default { margin-left: $gl-padding; }
.prepend-left-20 { margin-left: 20px; }
.prepend-left-32 { margin-left: 32px; }
.append-right-4 { margin-right: 4px; }
.append-right-5 { margin-right: 5px; }
.append-right-8 { margin-right: 8px; }
.append-right-10 { margin-right: 10px; }
.append-right-15 { margin-right: 15px; }
.append-right-default { margin-right: $gl-padding; }
.append-right-20 { margin-right: 20px; }
.prepend-right-32 { margin-right: 32px; }
.append-bottom-0 { margin-bottom: 0; }
.append-bottom-4 { margin-bottom: $gl-padding-4; }
.append-bottom-5 { margin-bottom: 5px; }
.append-bottom-8 { margin-bottom: $grid-size; }
.append-bottom-10 { margin-bottom: 10px; }
.append-bottom-15 { margin-bottom: 15px; }
.append-bottom-20 { margin-bottom: 20px; }
.append-bottom-default { margin-bottom: $gl-padding; }
.prepend-bottom-32 { margin-bottom: 32px; }
.inline { display: inline-block; }
.center { text-align: center; }
.block { display: block; }
.flex { display: flex; }
.vertical-align-top { vertical-align: top; }
.vertical-align-middle { vertical-align: middle; }
.vertical-align-sub { vertical-align: sub; }
.flex-align-self-center { align-self: center; }
.flex-grow { flex-grow: 1; }
.flex-no-shrink { flex-shrink: 0; }
.ws-initial { white-space: initial; }
.ws-normal { white-space: normal; }
.overflow-auto { overflow: auto; }

.d-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/** COMMON SIZING CLASSES **/
.w-0 { width: 0; }
.w-8em { width: 8em; }
.w-3rem { width: 3rem; }

.h-12em { height: 12em; }
.h-32-px { height: 32px;}

.mw-460 { max-width: 460px; }
.mw-6em { max-width: 6em; }
.mw-70p { max-width: 70%; }
.mw-90p { max-width: 90%; }

.min-height-0 { min-height: 0; }

.svg-w-100 {
  svg {
    width: 100%;
  }
}

/** COMMON SPACING CLASSES **/
@each $index, $padding in $spacing-scale {
  #{'.gl-p-#{$index}'} { padding: $padding; }
  #{'.gl-pl-#{$index}'} { padding-left: $padding; }
  #{'.gl-pr-#{$index}'} { padding-right: $padding; }
  #{'.gl-pt-#{$index}'} { padding-top: $padding; }
  #{'.gl-pb-#{$index}'} { padding-bottom: $padding; }
}

/**
 * Removes browser specific clear icon from input fields in
 * Internet Explorer 10, Internet Explorer 11, and Microsoft Edge.
 * This is intended for elements which add a customized clear icon.
 *
 * see also https://developer.mozilla.org/en-US/docs/Web/CSS/::-ms-clear
 */
.ms-no-clear ::-ms-clear {
  display: none;
}

/** COMMON POSITIONING CLASSES */
.position-bottom-0 { bottom: 0 !important; }
.position-left-0 { left: 0 !important; }
.position-right-0 { right: 0 !important; }
.position-top-0 { top: 0 !important; }

.drag-handle {
  width: 4px;

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

  &.is-dragging {
    background-color: $gray-600;
  }
}

.cursor-pointer {
  cursor: pointer;
}

// Make buttons/dropdowns full-width on mobile
.full-width-mobile {
  @include media-breakpoint-down(xs) {
    width: 100%;

    > .dropdown-menu,
    > .btn {
      width: 100%;
    }
  }
}

.onboarding-helper-container {
  bottom: 40px;
  right: 40px;
  font-size: $gl-font-size-small;
  background: $gray-100;
  width: 200px;
  border-radius: 24px;
  box-shadow: 0 2px 4px $issue-boards-card-shadow;
  z-index: 10000;

  .collapsible {
    max-height: 0;
    transition: max-height 0.5s cubic-bezier(0, 1, 0, 1);
  }

  &.expanded {
    border-bottom-right-radius: $border-radius-default;
    border-bottom-left-radius: $border-radius-default;

    .collapsible {
      max-height: 1000px;
      transition: max-height 1s ease-in-out;
    }
  }

  .avatar {
    border-color: darken($gray-normal, 10%);

    img {
      width: 32px;
      height: 32px;
    }
  }
}
