/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import 'dropdown-submenu';

$panel-background: #f5f5f5;
$placeholder-color: #aaa;
$border-color: #ddd;

@-webkit-keyframes fadeIn {
  0% {opacity: 0;}
  100% {opacity: 1;}
}

@keyframes fadeIn {
  0% {opacity: 0;}
  100% {opacity: 1;}
}

.fadeIn {
  -webkit-animation-name: fadeIn;
          animation-name: fadeIn;
}

@-webkit-keyframes fadeOut {
  0% {opacity: 1;}
  100% {opacity: 0;}
}

@keyframes fadeOut {
  0% {opacity: 1;}
  100% {opacity: 0;}
}

.fadeOut {
  -webkit-animation-name: fadeOut;
          animation-name: fadeOut;
}

#content {
  padding: 20px 0;
}

#index-content {
  display: flex;
}

#visual-explain, #tez-ui {
  position: absolute;
  left: 0;
  width: 0;
  z-index: 99;
  background: white;
}

#alerts-container {
  position: absolute;
  left: 15px;
  right: 15px;
  z-index: 1100;
}

aside  hr {
  margin: 10px 0;
}

.halfed {
  width: 50%;
}

.no-padding {
  padding: 0;
}

.no-margin {
  margin: 0;
}

.toolbox {
  margin: 15px 15px 0 0;

  insert-udfs {
    display: inline-block;
  }
}

.form-control::-moz-placeholder {
  color: $placeholder-color;
}

.form-control:-ms-input-placeholder {
  color: $placeholder-color;
}

.form-control::-webkit-input-placeholder {
  color: $placeholder-color;
}

.form-group {
  margin-bottom: 0;
}

.secondary-row {
  background: $panel-background;
}

.btn-group {
  .dropdown-menu {
    right: 0;
    left: auto;
  }
}

.CodeMirror {
  border: 0 1px solid $border-color;
}

.grip {
  height: 20px;
  border: 0 1px 1px solid $border-color;
  background-color: $panel-background;
  color: #bbb;
  text-align: center;
  font-size: inherit;
}

.slider {
  min-width: 200px;
}

.slider-labels {
  font-size: 10px;
}

.modal-backdrop {
  background-color: white;
}

.UNKNOWN {
  color: gray;
}

.RUNNING, .PENDING, .INITIALIZED, .fa-edit {
  color: orange;
}

.SUCCEEDED {
  color: green;
}

.CANCELED, .ERROR {
  color: red;
}

dropdown .fa-remove {
  color: red;
}

.CLOSED {
  color: blue;
}

.query-container {
  position: relative;
  padding-right: 0;
}

.main-content {
  flex-grow: 1;
}

.query-menu {
  margin-top: 57px;

  span, popover {
    cursor: pointer;
    overflow: hidden;
    display: block;
    border-bottom: 1px solid $border-color;
    padding: 10px;
  }
}

.queries-icon {
  font-size: 20px;

  &.active {
    color: #428bca;
  }

  &.text-icon {
    font-size: 12px;
    font-weight: 800;
  }
}

.alert {
  margin-bottom: 5px;
  padding-bottom: 10px;
  padding-top: 10px;

  .alert-message {
    max-height: 250px;
    overflow-y: auto;
  }
}

body {
  a, i {
    cursor: pointer;  }

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

  tabs {
    ul li{
      background: $panel-background;
    }
  }

  table {
    tbody tr {
      border: 1px solid #ccc;
    }

    td *{
      white-space: nowrap;
    }
  }

  column-filter {
    display: -webkit-inline-flex; /* Safari */
    display: inline-flex;

    .slider {
      margin-top: 10px;
    }

    .btn {
      padding: 0;
      border: 0;
    }

    .form-control {
      width: auto;
    }

    .fa {
      padding: 10px 0;
    }
  }
}

.CodeMirror-hints {
  min-width: 200px;
}

.spinner {
  width: 36px;
  height: 36px;
  background: url("/img/spinner.gif");
  background-repeat: no-repeat;
  margin: 0 auto;

  &.small {
    background-size: 20px;
    width: 20px;
    height: 20px;
  }
}

.databases {
  max-height: 500px;
  overflow-y: auto;

  .tables {
    padding-left: 10px;

    .columns {
      padding-left: 10px;
    }
  }
}

.selectize-control.plugin-remove_button [data-value] {
  padding-right: 0 !important;
}

.query-editor-panel .panel-body {
  position: relative;
  padding-right: 0;
}

.settings-containers-toggle {
  position: absolute;
  top: 0;
  right: 25px;
  cursor: pointer;
}

.settings-container {
  width: 100%;
  overflow-y: scroll;
  height: calc(100% - 41px);
  top: 41px;
  left: 0;
  background-color: #fff;
  position: absolute;
  padding: 0 15px;
  z-index: 1000;

  border: 1px solid $border-color;
  -webkit-animation-duration: .5s;
          animation-duration: .5s;
  -webkit-animation-fill-mode: both;
          animation-fill-mode: both;
}
.settings-container .close-settings {
  float: right;
  font-size: 18px;
  cursor: pointer;
  line-height: 24px;
}

.setting {
  float: left;
  padding-right: 10px;
  padding-top: 10px;

  .input-group {
    width: 100%;
  }
  .input-group-addon {
    text-align: justify;
    width: 50%;
  }
}

.setting .remove {
  line-height: 30px;
  font-size: 18px;
  cursor: pointer;
  position: absolute;
  right: -5px;
  top: -10px;
}

tabs {
  display: block;
  position: relative;
}

tree-view ul li {
  padding-left: 10px;
}
