/*
    Unsorted
    ----------------------------------------------
*/
.text-right .btn {
  margin: 0 0 0 4px;
}
.text-center .btn {
  margin: 0 6px;
}
.default-source-label {
  display: inline-block;
  vertical-align: middle;
  font-size: 13px;
  font-weight: 500;
  background-color: $g2-kevlar;
  color: $c-pool;
  border-radius: 3px;
  padding: 2px 6px;
  margin-left: 4px;
}
.progress-label {
  margin-bottom: 4px;
  color: $g11-sidewalk;
  width: 100%;

  strong {
    font-weight: 500;
    color: $g8-storm;
  }
}
.modal {
  form {
    padding: 0;
    margin: 0;
    background-color: transparent;
  }
  .form-grid {
    width: 100%;
    display: inline-block;

    &.padding-top {
      padding-top: 15px;
    }
  }
}

/*
    Generic Empty State
    ----------------------------------------------
*/
.generic-empty-state {
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
  justify-content: center;
  color: $g10-wolf;
  @include no-user-select();

  h4,
  h5 {
    font-weight: 400;
  }

  strong {
    color: $g14-chromium;
  }

  .icon {
    margin-bottom: 11px;
  }
}

/*
    Loading Dots
    ----------------------------------------------
*/
.loading-dots {
  position: absolute;
  transform: translate(0, 0);
  transform: translateX(50%);
  width: 16px;
  height: 18px;

  div {
    width: 4px;
    height: 4px;
    background-color: $g6-smoke;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  div:nth-child(1) {
    left: 0;
    animation: refreshingSpinnerA 0.8s cubic-bezier(0.645, 0.045, 0.355, 1)
      infinite;
  }
  div:nth-child(2) {
    left: 50%;
    animation: refreshingSpinnerB 0.8s cubic-bezier(0.645, 0.045, 0.355, 1)
      infinite;
  }
  div:nth-child(3) {
    left: 100%;
    animation: refreshingSpinnerC 0.8s cubic-bezier(0.645, 0.045, 0.355, 1)
      infinite;
  }
}

/*
    Custom Tabs
    ----------------------------------------------
*/
.tab-group {
  display: flex;
  justify-content: flex-start;
  display: inline-block;

  .btn.tab {
    border: 2px solid $g17-whisper;
    border-right-width: 0;
    padding: 10px 20px;
    margin: 0 !important;
    font-weight: 400;
    color: $g11-sidewalk;
    background-color: $g17-whisper;
    box-shadow: none;
    transition: color 0.25s ease, background-color 0.25s ease;

    &:hover {
      cursor: pointer;
      background-color: $g18-cloud;
      color: $g9-mountain;
    }

    &:first-child {
      border-radius: 5px 0 0 5px;
    }

    &:last-child {
      border-radius: 0 5px 5px 0;
      border-right-width: 2px;
    }
    &.active {
      background-color: white;
      color: $g8-storm;
    }
  }
}
.currently-connected-source {
  color: $c-rainforest;
  font-weight: 600;
  font-size: 12px;
  margin: 0 4px;
  @include no-user-select();
}

br {
  @include no-user-select();
}

.select-source-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  @include custom-scrollbar($g2-kevlar, $c-pool);
  @include gradient-v($g2-kevlar, $g0-obsidian);
}

.source-table--connect {
  width: 74px;
}
.source-table--connect-col {
  width: 90px;
}
.source-table--kapacitor {
  border-left: 2px solid $g5-pepper;
  width: 278px;
}
.source-table--kapacitor__view-only {
  @include no-user-select();
  font-size: 14px;
  font-weight: 600;
}

/*
  Styles for the Status Dashboard
  -----------------------------------------------------------------------------
  Not enough of these to merit their own page, will organize later
*/
.alerts-widget,
.getting-started {
  padding: 0 16px;
}
.getting-started--cell {
  color: $g11-sidewalk;
  background-color: $g2-kevlar;
  border-radius: 3px;
  padding: 12px;
  margin-bottom: 4px;

  &.intro {
    @include gradient-h($c-pool, $c-star);
    color: $g20-white;
  }

  p {
    font-size: 13px;
  }
}
.alerts-widget {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;

  > .btn {
    margin: 20px 0;
  }

  .alert-history-table {
    flex: 1 0 0;
  }
}

/*
  Version Number
  -----------------------------------------------------------------------------
*/
.version-number {
  text-align: center;
  margin: 20px 0;
  font-family: $code-font;
  color: $g11-sidewalk;
  font-size: 13px;
}

/*
  View TICKscript Overlay
  -----------------------------------------------------------------------------
*/
$tick-script-overlay-margin: 30px;
.tick-script-overlay {
  max-width: 960px;
  margin: 0 auto $tick-script-overlay-margin auto;
  height: calc(100% - #{$tick-script-overlay-margin});
  position: relative;

  .write-data-form--body {
    height: calc(100% - 60px);
    display: flex;
    flex-direction: column;
  }
}
.tick-script-overlay--sample {
  margin: 0;
  white-space: pre-wrap;
  font-size: 14px;
  padding: 20px;
  border: 2px solid $g4-onyx;
}

/*
  GROUP BY TIME Dropdown
  -----------------------------------------------------------------------------
*/
.group-by-time {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}
.group-by-time--label {
  white-space: nowrap;
  margin: 0;
  color: $g12-forge;
  padding: 0 6px;
  height: 30px;
  line-height: 30px;
}
.group-by-time--dropdown .dropdown-toggle {
  width: 70px;
}
.group-by-time--dropdown .dropdown-selected,
.group-by-time--dropdown .dropdown-item {
  font-family: $code-font;
}

/*
  Data Explorer download CSV button
  -----------------------------------------------------------------------------
*/
.icon.download.dlcsv:before {
  content: "\e91d";
  font-weight: bold;
  color: #bec2cc;
}
.btn.btn-sm.btn-default.dlcsv {
  margin-left: 10px;
}

/*
  Dropdown clickable area fix
  -----------------------------------------------------------------------------
  TODO: Move this into theme, not sure how this broke
*/

.dropdown .dropdown-menu li.dropdown-item {
  display: block;

  > a {
    display: block;
  }
}

/*
  Dashboard Switcher
  -----------------------------------------------------------------------------
*/
.dropdown.dashboard-switcher {
  margin-right: 4px;
}
.dropdown.dashboard-switcher .btn.dropdown-toggle {
  justify-content: center;
}
.dropdown.dashboard-switcher + h1.page-header--title {
  margin-left: 6px;
}

.dropdown.dashboard-switcher .dropdown-item {
  white-space: nowrap;
}

/*
  Stretch to fit Dropdowns
  -----------------------------------------------------------------------------
*/

div.dropdown.dropdown-stretch,
div.dropdown.dropdown-stretch > div.dropdown-toggle,
div.dropdown.dropdown-stretch > button.dropdown-toggle {
  width: 100%;
}

/*
  Delete Source
  -----------------------------------------------------------------------------
*/
.delete-source {
  display: inline-block;
}

/*
  Add spacing between time format dropdown and input
  -----------------------------------------------------------------------------
*/
.custom-time-format {
  margin-top: 4px;
}

.annotation-selector {
  margin-left: 4px;
}

$deceo-spacing: 20px;

/*
    New CEO/DE Styles
    ----------------------------------------------------------------------------
*/

.deceo--overlay {
  margin: 0 auto;
  position: relative;
  width: calc(100% - 60px);
  height: calc(100% - 30px);
  overflow: hidden;
  border-radius: 0 0 $radius $radius;
  outline: none;
}

.deceo--page {
  margin: 0 auto;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 0 0 $radius $radius;
}

.deceo {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;

  .page-header {
    padding: 0 $deceo-spacing;
  }
}

.deceo--container {
  height: calc(100% - 120px);
  position: relative;
}

.deceo--top {
  width: 100%;
  height: 100%;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  @include gradient-v($g2-kevlar, $g0-obsidian);
}

.deceo--controls {
  display: flex;
  height: 60px;
  padding: 0 $deceo-spacing;
  background-color: $g2-kevlar;
  align-items: center;

  .csv-export,
  .autorefresh-dropdown {
    margin-right: 5px;
  }

  .autorefresh-dropdown.paused .dropdown {
    margin-right: 4px;
  }
}

.deceo--visualization {
  padding: 0 $deceo-spacing $deceo-spacing $deceo-spacing;
  width: 100%;
  height: 100%;

  .graph-container {
    top: 0;
    height: 100%;
    border-radius: 4px;
    overflow: hidden;
  }
}

.deceo--bottom {
  background-color: $g2-kevlar;
  height: 100%;

  .simple-spinner {
    margin-right: 10px;
  }
}

$deceo--tab-width: 220px;

.deceo--header {
  .page-header--left,
  .page-header--right {
    flex: 1 0 calc(50% - #{$deceo--tab-width / 2});
  }
}

.deceo--header-tabs {
  flex: 1 0 $deceo--tab-width;
}

.unexpected-error {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.kapacitor-switcher {
  margin-left: 6px;
}
