:root {
  --selection-color: var(--color-text-light);
}

#react_qb_viz {
  flex-grow: 1;
}

/* @layout */
.QueryBuilder {
  transition: margin-right 0.35s;
}

.QueryBuilder--showSideDrawer {
  margin-right: 300px;
}

.QueryHeader-details {
  display: flex;
  align-items: center;
}

/* a section of the graphical query itself */
.Query-section {
  display: flex;
  align-items: center;
}

.Query-section.Query-section--right {
  justify-content: flex-end;
}

.QueryName {
  font-weight: 200;
  margin-top: 0;
  margin-bottom: 0;
  font-size: 1.2rem;
}

.Query-label {
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-medium);
}

.Query-filters {
  max-width: 400px;
}

.Query-filterList {
  display: flex;
  overflow-y: hidden;
  white-space: nowrap;
}

.Filter-section {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.Query-filter .input {
  border-radius: 0;
  border: none;
  font-size: inherit;
  background-color: transparent;
  width: 150px;
  padding: 0;
}

.TooltipFilterList .Query-filter {
  padding-left: 0 !important;
  padding-bottom: 0 !important;
}

.TooltipFilterList .Query-filterList {
  flex-direction: column;
}

.TooltipFilterList .Query-section {
  margin-left: -0.5rem;
}

/*
    @selectionmodule
*/
.SelectionModule {
  color: var(--color-brand);
}

.SelectionList {
  padding-top: 5px;
  overflow-y: auto;
  max-height: 340px;
}

.SelectionItems {
  max-width: 320px;
}

.SelectionItems.SelectionItems--open {
  opacity: 1;
  transition: opacity 0.3s linear;
  pointer-events: all;
}

.SelectionItems.SelectionItems--expanded {
  max-height: inherit;
}

.SelectionItem {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.75rem 1.5rem 0.75rem 0.75rem;
  background-color: var(--color-bg-white);
}

.SelectionItem:hover {
  background-color: currentColor;
}

.SelectionItem .Icon {
  margin-left: 0.5rem;
  margin-right: 0.75rem;
  color: currentcolor;
}

.SelectionItem .Icon-check {
  opacity: 0;
}

.SelectionItem .Icon-chevrondown {
  opacity: 1;
}

.SelectionItem:hover .Icon {
  color: var(--color-text-white) !important;
}

.SelectionItem:hover .SelectionModule-display {
  color: var(--color-text-white);
}

.SelectionItem:hover .SelectionModule-description {
  color: var(--color-text-white);
}

.SelectionItem.SelectionItem--selected .Icon-check {
  opacity: 1;
}

.SelectionModule-display {
  color: currentColor;
  margin-bottom: 0.25em;
}

.SelectionModule-description {
  color: var(--color-text-medium);
  font-size: 0.8rem;
}

.Visualization {
  transition: background 0.3s linear;
}

.Visualization.Visualization--loading {
  transition: background 0.3s linear;
}

.Visualization.Visualization--error {
  justify-content: center;
}

.Visualization--scalar {
  justify-content: center;
  font-size: 8rem;
  font-weight: 200;
}

.Loading {
  background-color: color-mod(var(--color-bg-white) alpha(-28%));
  transition: opacity 0.5s;
}
.Loading.Loading--hidden {
  background-color: transparent;
}
.Dirty {
  background-color: color-mod(var(--color-bg-white) alpha(-28%));
  transition: opacity 0.5s;
}
.Dirty.Loading--hidden {
  background-color: transparent;
}

/* query errors */
.QueryError {
  flex-direction: column;
  justify-content: center;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.QueryError-image {
  background-repeat: no-repeat;
  margin-bottom: 1rem;
}

.QueryError-image--noRows {
  width: 120px;
  height: 120px;
  background-image: url("~assets/img/no_results.svg");
}

.QueryError-image--queryError {
  width: 120px;
  height: 120px;
  background-image: url("~assets/img/no_understand.svg");
}

.QueryError-image--serverError {
  width: 120px;
  height: 148px;
  background-image: url("~assets/img/blown_up.svg");
}

.QueryError-image--timeout {
  width: 120px;
  height: 120px;
  background-image: url("~assets/img/stopwatch.svg");
}

.QueryError-messageText {
  line-height: 1.4;
}

.QueryError-adminEmail {
  position: relative;
  display: inline-block;
  border-radius: var(--default-border-radius);
  border: 1px solid var(--color-border);
  margin-top: var(--margin-2);
  padding: var(--padding-1) var(--padding-4) var(--padding-1) var(--padding-4);
}

.QueryError-adminEmail:before {
  content: "Admin Email";
  font-size: 10px;
  text-align: center;
  text-transform: uppercase;
  background-color: white;
  padding-left: var(--padding-1);
  padding-right: var(--padding-1);

  position: absolute;
  top: -0.75em;
  left: 50%;
  margin-left: -41px; /* ugh */
}

.QueryError2 {
  padding-top: 4rem;
  margin-left: auto;
  margin-right: auto;
}

.QueryError2-details {
  max-width: 500px;
}

.QueryError2-detailBody {
  background-color: var(--color-bg-light);
  max-height: 15rem;
  overflow: auto;
}

/* GUI BUILDER */

.GuiBuilder {
  position: relative;
  display: flex;
  flex-direction: column;
  font-size: 0.9em;
  z-index: 2;
  background-color: var(--color-bg-white);

  border: 1px solid var(--color-border);
}

/* for medium breakpoint only expand if data reference is not shown */
@media screen and (--breakpoint-min-md) {
  .GuiBuilder {
    font-size: 1em;
  }
}

/* un-expanded (default) */
.GuiBuilder-row {
  border-bottom: 1px solid var(--color-border);
}
.GuiBuilder-row:last-child {
  border-bottom-color: transparent;
}
.GuiBuilder-data {
  border-right: 1px solid var(--color-border);
}
.GuiBuilder-filtered-by {
  border-right: 1px solid transparent;
}
.GuiBuilder-view {
  border-right: 1px solid var(--color-border);
}
.GuiBuilder-sort-limit {
  border-left: 1px solid var(--color-border);
}

/* expanded */
.GuiBuilder.GuiBuilder--expand {
  flex-direction: row;
}
.GuiBuilder.GuiBuilder--expand .GuiBuilder-row:last-child {
  border-right-color: transparent;
  border-bottom-color: var(--color-border);
}
.GuiBuilder.GuiBuilder--expand .GuiBuilder-filtered-by {
  border-right-color: var(--color-border);
}

.GuiBuilder-section {
  position: relative;
  min-height: 55px;
  min-width: 100px;
}

.GuiBuilder-section-label {
  background-color: white;
  position: absolute;
  top: -7px;
  left: 10px;
  padding-left: 10px;
  padding-right: 10px;
}

/* @transitions */

.AddToDashSuccess {
  max-width: 260px;
  text-align: center;
}

/* DATA SECTION */

.GuiBuilder-data {
  z-index: 1; /* moved the arrow thingy above the filter outline */
}

/* FILTER BY SECTION */

.Filter-section-sort-field.selected .QueryOption,
.Filter-section-sort-direction.selected .QueryOption {
  color: inherit;
}

/* SORT/LIMIT SECTION */

.GuiBuilder-sort-limit {
  min-width: 0px;
}

.EllipsisButton {
  font-size: 3em;
  position: relative;
  top: -0.8rem;
}

/* NATIVE */

.NativeQueryEditor .GuiBuilder-data {
  border-right: none;
}

.NativeQueryEditorDragHandleWrapper {
  position: absolute;
  height: 8px;
  width: 100%;
  bottom: -4px;
  cursor: row-resize;
  display: flex;
  justify-content: center;
  align-items: center;
}

.NativeQueryEditorDragHandle {
  background: color-mod(var(--color-border) blackness(3%));
  width: 100px;
  height: 5px;
  border-radius: 4px;
}

/* VISUALIZATION SETTINGS */

.VisualizationSettings .GuiBuilder-section {
  border-right: none !important;
}

.ChartType-button {
  width: 38px;
  height: 38px;
  border-radius: 38px;
  background-color: white;
  border: 1px solid var(--color-border);
}

.ChartType-popover {
  min-width: 15em !important;
}

.ChartType--selected {
  color: white;
  background-color: var(--color-brand);
}

.ChartType--notSensible {
  opacity: 0.5;
}

.ColorWell {
  width: 18px;
  height: 18px;
  margin: 3px;
  margin-right: 0.3rem;
}

.RunButton {
  opacity: 1;
  transition: transform 0.25s, opacity 0.25s;
}

.RunButton.RunButton--compact {
  padding: 16px 32px;
}

.RunButton.RunButton--hidden {
  transform: translateY(-20px);
  opacity: 0;
}

@media (prefers-reduced-motion) {
  .RunButton,
  .RunButton.RunButton--compact,
  .RunButton.RunButton--hidden {
    transition-duration: 10ms;
  }
}

/* DATA REFERENCE */

.SideDrawer {
  z-index: -1;
  position: absolute;
  top: 0;
  right: -300;
  width: 300px;
  height: 100%;
  background-color: var(--color-bg-light);
  border-left: 1px solid var(--color-border);
  overflow: hidden;
  opacity: 0;
}

.SideDrawer--show {
  z-index: 0;
  right: 0;
  opacity: 1;
  transition: all 0.5s;
}

.DataReference h1 {
  font-size: 20pt;
}

.DataReference-paneCount {
  padding-right: 0.6em;
}

.ObjectJSON {
  max-height: 200px;
  overflow: scroll;
  padding: 1em;
  background-color: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  white-space: pre-wrap;
}

.PopoverBody.AddToDashboard {
  min-width: 25em;
}

.List-item:not(.List-item--disabled):hover .FieldList-grouping-trigger,
.List-item--selected .FieldList-grouping-trigger {
  visibility: visible;
}

.QuestionTooltipTarget {
  color: var(--color-text-light);
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 99px;
  width: 20px;
  height: 20px;
  display: flex;

  align-items: center;
  justify-content: center;
  opacity: 0.7;

  cursor: pointer;
}

.QuestionTooltipTarget:after {
  content: "?";
  font-size: 13px;
  font-weight: bold;
}

.FilterInput:hover .FilterRemove-field {
  opacity: 1;
}

/* need to do this ugliness to override the locally scoped font size from Scalar.css */
.QueryBuilder .ScalarValue {
  font-size: 5em;
}

.sql-code {
  font-size: 90%;
  line-height: 1.2em;
  font-family: "Courier 10 Pitch", Courier, monospace;
  white-space: pre;
  white-space: pre-wrap;
  white-space: -moz-pre-wrap;
  white-space: -o-pre-wrap;
  background-color: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.ParameterValuePickerNoPopover input {
  font-size: 16px;
  color: var(--color-text-dark);
  border: none;
}

.ParameterValuePickerNoPopover--selected input {
  font-weight: bold;
  color: var(--color-brand);
}

.ParameterValuePickerNoPopover input:focus {
  outline: none;
  color: var(--color-text-dark);
}

.ParameterValuePickerNoPopover input::-webkit-input-placeholder {
  color: var(--color-text-medium);
}


.Question-main--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 100px;
  margin-bottom: 100px;
}

.Question-main--empty img {
  width: 300px;
}

.Question-main--empty h3 {
  font-size: 36px;
  font-weight: bold;
  color: #3d414c;
  margin-top: 32px;
}

.Question-main--empty p {
  color: #3d414c;
  text-align: center;
  line-height: 23px;
  font-size: 20px;
  margin: 12px 0;
}

.Question-main--empty-button {
  height: 48px;
  color: #3434b2;
  border-radius: 4px;
  border-color: #3434b2;
  background-color: transparent;
  font-weight: 700;
  font-size: 16px;
}

.Question-header-btn {
  width: 32px;
  height: 32px;
  font-size: 14px;
  color: #7a819b;
  border-radius: 4px;
}

.Question-header-btn-new {
  height: 32px;
  line-height: 32px;
  font-size: 14px;
  color: #7a819b;
  border-radius: 4px;
  padding: 0 var(--footprint-spacing-s);
}

.Question-header-btn-with-text {
  height: 32px;
  font-size: 14px;
  color: #7a819b;
  border-radius: 4px;
  padding: 0px 10px;
}

.Question-header-btns {
  display: flex;
  align-items: center;
}

.Question-header-btns .Question-header-btn:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 0;
}

.Question-header-btns .Question-header-btn:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 0;
}

.Question-header-btn--auto {
  width: auto;
  padding: 0 10px;
}

.Question-header-btn--full {
  width: 100%;
  padding: 0;
  border: 0;
  margin-bottom: 5px;
}

.Question-header-btn--full > div {
  justify-content: flex-start;
}

.Question-header-btn--primary {
  background-color: #3434b2;
  border: 0;
  color: #fff;
}

.Question-header-btn--primary-new {
  background-color: #3434b2;
  color: #fff;
}

.Question-header-btn--primary-new svg {
  color: #fff;
}

.Question-header-btn--primary svg {
  color: #fff;
}

.Question-header-btn--info {
  background-color: #acacb2;
  border: 0;
}

.Question-header-btn--info svg {
  color: #fff;
}
