.sidebar {
  width: 0;
  flex-shrink: 0;
  -webkit-flex-shrink: 0;

  overflow: hidden;
  border-bottom-right-radius: 4px;
  border-left: 3px solid $color-sidebar-border;
  position: relative;

  background: $color-sidebar-bg;
  box-shadow: inset -1px 0 0 rgba(0,0,0,0.1), inset 1px 0 0 rgba(0,0,0,0.1);
  color: $color-sidebar-text;

  @media only screen and (min-width: $large-screen) {
    position: relative;
    top: 0;
    bottom: 0;

    width: 430px;
    border-left-width: 0;
  }
}

.sidebar-url-segment {
  font-weight: bold;
}

.sidebar-prefill {
  padding: 16px 0 0 0 !important;
}

.sidebar-flex-wrapper {
  overflow: hidden;

  @media only screen and (min-width: $large-screen) {
    height: 100%;
    overflow: hidden;
  }
}

//
// Begin Sidebar Controls
//
.sidebar-controls {
  height: 43px;
  width: 80px;
  position: absolute;
  top: 0;
  right: -80px;

  border-radius: 0 0 0 4px;
  border: 1px solid $color-sidebar-controls-border;
  // border-left-width: 0;

  background: $color-sidebar-controls-bg;

  &,
  .collapse {
    transition: 0.2s ease background;
  }

  &:hover {
    &,
    .collapse {
      background: darken($color-sidebar-controls-bg, 5%);
    }
  }

  @media only screen and (min-width: $large-screen) {
    // width: 22px;
    right: -21px;

    border-left-width: 1px;
  }

  .collapse {
    padding: 0;
    padding-right: 2px;

    border: none;
    width: 100%;
    height: 100%;


    background: $color-sidebar-controls-bg;
    outline: none;

    svg {
      width: 15px;
      margin: 0 auto;
      vertical-align: text-bottom;

      transition: 0.2s ease transform;
    }
  }

  // "Try it" label appears when the sidebar is collapsed
  .discoverable {
    padding-left: 5px;

    font-size: 12pt;
    font-weight: 700;
  }
}

// Control to switch to full-screen/full-width view
.sidebar-controls-fullscreen {
  display: block;
  border-left: 1px rgba(0, 0, 0, 0.1) solid;

  @media only screen and (min-width: $large-screen) {
    display: none;
  }
}

// Control to switch to intermediate view
.sidebar-controls-collapse {
  display: none;

  .discoverable {
    display: none;
  }

  @media only screen and (min-width: $large-screen) {
    display: none;

    .collapse img {
      visibility: hidden;
    }
  }
}

.sidebar-resize-toggle {
  cursor: pointer;
  float: right;
  width: 19px;
  height: 19px;
  margin-right: 15px;
  margin-top: 3px;

  border-radius: 100%;
  border: 1px solid #808080;
  padding: 0;
  text-align: center;

  &:hover {
    opacity: 0.7;
  }

  svg {
    width: 10px;
    height: 12px;
    margin-bottom: 4px;
    margin-left: 1px !important;
  }
}

.sidebar-resize-toggle {
  .close-sidebar {
    height: 19px;
    margin-top: -4px;
    color: #808080;
    font-weight: 500;
  }
}

.sidebar-resize {
  margin-right: 5px;
  display: none;

  @media only screen and (min-width: $large-screen) {
    display: block;
  }
}

.sidebar-collapse-toggle {
  display: none;

  cursor: pointer;
  float: right;
  width: 19px;
  height: 19px;
  margin-right: 15px;
  margin-top: 3px;

  border-radius: 100%;
  border: 1px solid #808080;
  padding: 0;
  text-align: center;

  &:hover {
    opacity: 0.7;
  }

  svg {
    width: 10px;
    height: 12px;
    margin-bottom: 4px;
    margin-left: 1px !important;
  }
}

.sidebar-collapse-toggle {
  .close-sidebar {
    height: 19px;
    margin-top: -4px;
    color: #808080;
    font-weight: 500;
  }
}

// control to expand to full-width view
.sidebar-fullscreen-toggle {
  cursor: pointer;
  float: right;
  width: 19px;
  height: 19px;
  margin-right: 15px;
  margin-top: 3px;

  border-radius: 100%;
  border: 1px solid #808080;
  padding: 0;
  text-align: center;

  &:hover {
    opacity: 0.7;
  }

  svg {
    width: 10px;
    height: 12px;
    margin-bottom: 4px;
    margin-left: 1px !important;
  }
}

.sidebar-fullscreen-toggle {
  .close-sidebar {
    height: 19px;
    margin-top: -4px;
    color: #808080;
    font-weight: 500;
  }
}

// End Sidebar Controls

//
// Begin Collapsed Sidebar/Narrow View
//
.resource-list.is-collapsed {
  display: none;
}

.sidebar.is-collapsed {
  width: 0;
  border-left: 0;
  // position: absolute;
}

.sidebar.is-collapsed .sidebar-controls {
  right: -80px;
  width: 80px;
}

.sidebar.is-collapsed .collapse {
  &:before {
    content: none;
  }

  .discoverable {
    display: inline;
  }

  img {
    visibility: visible;
  }
}
// End Collapsed Sidebar/Narrow View

//
// Begin Full-Width Sidebar
//
.sidebar.is-fullscreen {
  width: 100%;
  border-left-width: 0;

  box-shadow: none;

  @media only screen and (min-width: $large-screen) {
    border-left-width: 1px;
  }
}

.sidebar.is-fullscreen .sidebar-controls {
  display: none;
}

.sidebar.is-fullscreen .sidebar-content {
  display: block;
  border: 0;
}

.sidebar-resize-toggle {
  svg.small-resize {
    display: none;
  }

  svg {
    margin-left: 8px;
  }
}

// Control to close full-screen/full-width sidebar
.sidebar.is-fullscreen .sidebar-resize-toggle {
  svg.full-resize {
    display: none;
  }

  svg.small-resize {
    display: inline-block;
  }
}

.sidebar.is-fullscreen .sidebar-input-tooltip {
  display: block;
}
// End Full-Width Sidebar

.sidebar-content {
  display: none;
  overflow: hidden;
  border: solid $color-sidebar-border;
  border-width: 0 1px;

  // box-shadow: inset -1px 0px 0 rgba(0,0,0,0.1);

  @media only screen and (min-width: $large-screen) {
    display: block;
    min-width: 430px;
    height: 100%;
  }
}

.sidebar-content-wrapper {
  min-height: 455px;

  @media only screen and (min-width: $large-screen) {
    overflow: hidden;
    max-height: calc(100% - 43px);
    -webkit-overflow-scrolling: touch;
  }
}

.sidebar-row {
  padding: 12px 16px 16px;
}

.sidebar-row .codemirror-body-editor {
  width: 100%;
  resize: none;
  font-family: Source Code Pro;
  font-size: 14px;
  border: 1px solid $color-editor-border;
}

.sidebar-header {
  position: relative;

  padding-top: 8px;
  padding-right: 0;
  padding-bottom: 8px;
  border-top: 1px solid $color-sidebar-header-border;
  border-bottom: 1px solid $color-sidebar-header-border;

  background: $color-sidebar-header-bg;
  color: $color-sidebar-header-text;

  .resource-btn {
    position: absolute;
    top: 5px;
    right: 10px;

    font-size: 14px;
  }
}

.sidebar-head {
  margin: 0;

  vertical-align: top;

  font-size: 18px;
  font-weight: 700;
  text-rendering: optimizeLegibility;
}

.sidebar-head-expand {
  position: relative;

  display: inline-block;
}

.sidebar-expand-btn {
  position: relative;

  margin: 0;
  padding: 0 20px 0 0;
  border: none;

  background: transparent;
  opacity: 0.8;
  transition: 0.2s ease all;

  &:hover {
    border-color: $color-sidebar-add-btn-bg-hover;
    opacity: 1;
  }

  &.is-open:before {
    content: " ";

    position: absolute;
    top: 10px;
    right: 0;

    margin: 0 auto;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-bottom: 7px solid $color-sidebar-add-btn-bg;

    border-right: 7px solid transparent;
  }

  &.is-collapsed:before {
    content: " ";

    position: absolute;
    top: 11px;
    right: 0px;

    margin: 0 auto;
    width: 0;
    height: 0;
    border-right: 7px solid transparent;
    border-left: 7px solid transparent;

    border-top: 7px solid $color-sidebar-add-btn-bg;
  }
}

.sidebar-subheader {
  margin-top: 10px;
  margin-right: 16px;
  padding-top: 10px;
  padding-bottom: 10px;
  border-top: 2px solid $color-sidebar-subheader-border;
  border-width: 1px 0;
  position: relative;

  color: $color-sidebar-subheader-text;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-rendering: optimizeLegibility;
}

.sidebar-subheader-top {
  margin-top: 0;
  border-top: 0;
}

.sidebar-subhead {
  margin: 0;
  font-size: 13px;
}

.sidebar-header + .sidebar-subheader {
  margin-top: 0;
  border-top: 0;
}

.sidebar-add-btn {
  position: absolute;
  top: 11px;
  right: 5px;

  width: 17px;
  height: 17px;
  border: none;
  border-radius: 50%;

  background: $color-sidebar-add-btn-bg;
  color: $color-sidebar-add-btn;
  opacity: 0.4;
  transition: 0.2s ease all;

  &:before {
    content: "\002B";

    position: absolute;
    top: 0;
    left: 0;
    right: 0;

    font-size: 16px;
    font-weight: 900;
    line-height: 1;
  }

  &:hover {
    background-color: $color-sidebar-add-btn-bg-hover;
    opacity: 1;
  }
}

.sidebar-toggle-group {
  padding: 5px 0;
}

.sidebar-action-group {
  font-size: 0;
}

.sidebar-action {
  margin-top: 12px;
  padding: 5px 0px;
  border: 1px solid rgba(0,0,0,0.1);
  border-bottom-color: rgba(0,0,0,0.5);
  border-radius: 3px;

  // background-image: linear-gradient(to bottom, rgba(255,255,255,0.2), rgba(0,0,0,0.1));
  color: $color-console-tab-text;
  cursor: pointer;
  font-family: $lato;
  // font-size: 18px;
  font-weight: 900;
  transition: 0.2s ease background-color;
  -webkit-font-smoothing: antialiased;

  font-size: 15px;
}

.sidebar-action-get {
  // width: 47%;
  width: 130px;
  background-color: $color-console-tab-get;
  letter-spacing: 2px;

  &:hover {
    background-color: $color-console-tab-get-hover;
  }
}

.sidebar-action-put {
  // width: 47%;
  width: 130px;
  background-color: $color-console-tab-put;
  letter-spacing: 2px;

  &:hover {
    background-color: $color-console-tab-put-hover;
  }
}

.sidebar-action-post {
  // width: 47%;
  width: 130px;
  background-color: $color-console-tab-post;
  letter-spacing: 2px;

  &:hover {
    background-color: $color-console-tab-post-hover;
  }
}

.sidebar-action-delete {
  // width: 47%;
  width: 130px;
  background-color: $color-console-tab-delete;
  letter-spacing: 2px;

  &:hover {
    background-color: $color-console-tab-delete-hover;
  }
}

.sidebar-action-patch {
  // width: 47%;
  width: 130px;
  background-color: $color-console-tab-patch;
  letter-spacing: 2px;

  &:hover {
    background-color: $color-console-tab-patch-hover;
  }
}

.sidebar-action-connect {
  // width: 47%;
  width: 130px;
  background-color: $color-console-tab-connect;
  letter-spacing: 2px;

  &:hover {
    background-color: $color-console-tab-connect-hover;
  }
}

.sidebar-action-head {
  // width: 47%;
  width: 130px;
  background-color: $color-console-tab-head;
  letter-spacing: 2px;

  &:hover {
    background-color: $color-console-tab-head-hover;
  }
}

.sidebar-action-options {
  // width: 47%;
  width: 130px;
  background-color: $color-console-tab-options;
  letter-spacing: 2px;

  &:hover {
    background-color: $color-console-tab-options-hover;
  }
}

.sidebar-action-trace {
  // width: 47%;
  width: 130px;
  background-color: $color-console-tab-trace;
  letter-spacing: 2px;

  &:hover {
    background-color: $color-console-tab-trace-hover;
  }
}

.sidebar-action-force {
  // width: 47%;
  width: 130px;
  background-color: red;
  letter-spacing: 2px;

  &:hover {
    background-color: #ff4d4d;
  }
}

.sidebar-action-cancel-request {
  // width: 47%;
  width: 130px;
  background-color: #8f6953;
  letter-spacing: 2px;

  &:hover {
    background-color: #a9826c;
  }
}

.sidebar-action-clear {
  // width: 25%;
  width: 80px;
  // margin-left: 1.5%;
  margin-left: 7px;

  background-color: $color-sidebar-action-clear-bg;

  &:hover {
    background-color: lighten($color-sidebar-action-clear-bg, 10%);
  }
}

.sidebar-action-prefill {
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid $color-toggle-border;
  border-radius: 4px;
  background-color: $color-toggle-bg;
  cursor: pointer;
  font-family: $lato;
  font-size: 13px;
  font-weight: 700;
  transition: 0.2s ease color, 0.2s ease border-color;
  -webkit-font-smoothing: antialiased;

  &:hover {
    border-color: rgba(0,0,0,0.25);

    background-color: #a8a9b4;
    color: $color-toggle-active-text;
  }
}

.sidebar-action-reset {
  // width: 25%;
  width: 80px;
  // margin-left: 1.5%;
  margin-left: 7px;

  background-color: $color-sidebar-action-reset-bg;

  &:hover {
    background-color: lighten($color-sidebar-action-reset-bg, 10%);
  }
}

.sidebar-input-container {
  position: relative;
}

.sidebar-label {
  display: block;

  color: $color-label;
  font-size: 14px;
  font-weight: 700;
}

.sidebar-security-label {
  display: inline;
  float: right;
  font-size: 11px;
  font-weight: normal;
  margin-right: 5px;
  margin-top: 9px;
}

.sidebar-input {
  display: block;
  width: 100%;
  margin-top: 5px;
  margin-bottom: 18px;
  height: 36px;
  padding: 0 4px 0 36px;
  border: 1px solid $color-input-border;
  border-radius: 3px;

  background-color: $color-input-bg;
  color: $color-input-text;
  font-size: 16px;
  // line-height: 36px;
  -webkit-font-smoothing: antialiased;
}

.sidebar-input-reset {
  position: absolute;
  bottom: 5px;
  left: 2px;

  border: 0;

  background: transparent;
  color: $color-input-reset;
  font-weight: 900;
  transition: 0.3s ease color;

  &:before {
    content: "↪";
    display: block;

    -webkit-transform: rotate(-180deg);
  }

  &:hover {
    color: $color-input-reset-hover;
  }
}

.sidebar-input-tooltip-container-enum {
  margin-right: 19px;
}

.sidebar-input-tooltip-container {
  position: absolute;
  right: 7px;
  bottom: 9px;

  width: 100%;
}

.sidebar-input-left {
  position: static;
}

.sidebar-input-tooltip {
  position: absolute;
  right: 0;
  bottom: 0;

  display: none;
  width: 19px;
  height: 19px;
  border: 1px solid $color-input-reset;
  border-radius: 50%;

  background: transparent;
  color: $color-input-reset;
  font-weight: 900;
  transition: 0.3s ease color, 0.3s ease border-color;

  &:before {
    content: "i";

    position: absolute;
    top: 1px;
    left: 1px;
    right: 0;

    font-family: $monospace;
    font-size: 13px;
    font-weight: 700;
  }

  .sidebar-input-tooltip-container:hover & {
    color: $color-input-reset-hover;
    border-color: $color-input-reset-hover;
  }
}

@keyframes flyout-slide {
  0% {
    opacity: 0;
    transform: translateY(-5px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.sidebar-tooltip-flyout {
  position: absolute;
  top: 5px;
  right: -7px;
  z-index: 20;

  display: none;
  max-width: 100%;
  margin: 0 0 18px 0;
  padding: 6px 12px;
  border-radius: 4px;

  background-color: $color-flyout-bg;
  color: $color-flyout-text;
  font-size: 14px;
  text-align: right;

  .sidebar-input-tooltip-container:hover & {
    display: block;

    animation: flyout-slide 0.15s ease forwards;
  }

  &:before {
    content: ' ';

    position: absolute;
    top: -5px;
    right: 12px;

    width: 0;
    height: 0;

    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid $color-flyout-bg;
  }
}

.sidebar-tooltip-flyout-left {
  position: absolute;
  top: 57px;
  left: 0;
  z-index: 20;

  display: none;
  max-width: 100%;
  margin: 0 0 18px 0;
  padding: 6px 12px;
  border-radius: 4px;

  background-color: $color-flyout-bg;
  color: $color-flyout-text;
  font-size: 14px;
  text-align: left;

  .sidebar-input-tooltip-container:hover & {
    display: block;
    animation: flyout-slide 0.15s ease forwards;
  }

  &:before {
  content: ' ';

  position: absolute;
  top: -5px;
  left: 12px;

  width: 0;
  height: 0;

  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid $color-flyout-bg;
  }
}

.sidebar-input-container-custom {
  position: relative;
}

// The custom <label>
.sidebar-label-custom {
  margin-top: 5px;
  margin-bottom: 6px;
  padding: 0;
  border: 2px solid $color-input-border;
  border-radius: 4px;
}

// The custom <input> so the user can describe the <label>
// I don't know
.sidebar-custom-input-for-label {
  display: block;
  width: 100%;
  height: 30px;
  padding: 0px 4px 3px 30px;
  border: none;

  background-color: transparent;
  color: $color-label;
  font-size: 15px;
  line-height: 30px;
  -webkit-font-smoothing: antialiased;
}

.sidebar-input-custom {
  padding-left: 10px;
}

.sidebar-input-delete {
  position: absolute;
  top: 1px;
  left: 3px;

  border: 0;

  background: transparent;
  color: $color-input-reset;
  font-weight: 900;
  font-size: 22px;
  transition: 0.3s ease color;

  &:before {
    content: "\00d7";
    display: block;

    -webkit-transform: rotate(-180deg);
  }

  &:hover {
    color: $color-input-reset-hover;
  }
}

.sidebar-url {
  margin: 0;
  display: inline-block;
  font-size: 16px;
}

.sidebar-method {
  float: left;
  // width: 50px;
  padding-top: 2px;
  margin: 0 5px 0 0;

  font-size: 14px;
  font-weight: 700;
}

.sidebar-method-content {
  margin-bottom: 16px;
  font-size: 14px;
}

.sidebar-request-metadata {
  display: none;

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

.sidebar-response {
  display: none;

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

.sidebar-response-head {
  margin: 0;
  margin-bottom: 2px;
  padding-bottom: 3px;
  border-bottom: 1px solid $color-sidebar-response-border;

  color: $color-sidebar-response-text;
  font-size: 16px;
  font-weight: 700;
}

.sidebar-response-item {
  font-size: 16px;
  word-wrap: break-word;
}

.sidebar-response-metadata {
  margin-bottom: 5px;
  margin-left: 16px;
  word-wrap: break-word;
}

.sidebar-response-item b {
  margin-left: -16px;
  margin-right: 3px;

  color: $color-sidebar-text-emphasis;
  font-weight: 400;
  font-style: italic;
}

.sidebar-pre {
  margin: 0;
  // padding: 8px 12px;
  border: 1px solid $color-sidebar-pre-border;
  border-radius: 3px;

  background: $color-sidebar-pre-bg;
  font-family: Source Code Pro;
  font-size: 14px;
}

.sidebar-pre code > div {
  line-height: 1;
  position: relative;
  overflow: hidden;
  background: #fff;
  // color: #000;
}

.sidebar-response-head-pre {
  border: 0;
}

.sidebar-request-url {
  padding: 0;

  b, i {
    margin: 0;

    font-style: normal;
    font-weight: 700;
  }

  b {
    color: rgb(168, 75, 197);
  }

  i {
    color: #4392DB;
  }
}

.sidebar-show-more {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;

  height: 25px;
  border-bottom-left-radius: 3px;

  background-color: $color-sidebar-show-more-bg;
  color: $color-resource-path-active;
  text-align: center;
  font-weight: 900;
  img {
    width: 15px;
    vertical-align: middle;
  }
}

.sidebar-response-body {
  padding: 0 !important;
}

.sidebar-response-body .CodeMirror {
  height: 100% !important;
}

.sidebar-request-body {
  padding: 0 !important;
}

.sidebar-request-body .CodeMirror {
  height: 100% !important;
}

.sidebar-security-field {
  padding: 0 0 0 11px !important;
}

.sidebar-field-no-default {
  padding: 0 0 0 11px !important;
}

.sidebar-base-uri {
  font-size: 13px;
}

.side-bar-try-it-description {
  display: block;
}

.sidebar-securty {
  padding-bottom: 0;
  padding-top: 0;
}

.sidebar-override-show {
  display: block !important;
}

.sidebar-override-hide {
  display: none;
}

.sidebar-override {
  font-weight: normal;
  float: right;
  cursor: pointer;
  margin-right: 1px;
}

.sidebar-force-message {
  font-size: 13px;
  color: red;
}

.sidebar-oauth-scopes {
  list-style-type: none;
  padding-left: 0;
  font-size: 14px;
  margin-top: -10px !important;
}
