@import "bootstrap-variables-override";
@import "bootstrap";
@import "daterangepicker-override";
@import "daterangepicker";
@import "dygraph";
@import "../js/highlightjs/default";

@each $color, $value in $theme-colors {
  @include bg-variant(".bg-#{$color}-light", lighten($value, 43));
}

html {
  font-size: 14px;
}

.navbar {
  padding: 0;
}

.navbar-brand {
  padding: 0;
  padding-right: 15px;
}

.nav-tabs {
  /* always leave space under tabs */
  margin-bottom: 10px;
}

.bg-light2 {
  background-color: $table-accent-bg;
}

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

@include media-breakpoint-up(lg) {
  $sidebar-width: 270px;
  $sidebar-width-collapsed: 60px;
  .sidebar-fixed-width {
    width: inherit;
    transition: max-width .2s ease;
    & > div {
      min-width: $sidebar-width - $grid-gutter-width / 2;
      max-width: $sidebar-width - $grid-gutter-width / 2;
    }
    position:relative;
    overflow: auto;

    .sidebar-collapsed & {
      overflow: hidden;
      min-width: $sidebar-width-collapsed;
      max-width: $sidebar-width-collapsed;

      .info {
        visibility: hidden;
      }
      .nav-item span {
        display: none;
      }
    }
    .sidebar-collapsed &:hover {
      max-width: $sidebar-width + $grid-gutter-width / 2;
      box-shadow: 0 16px 10px 0 rgba(0,0,0,0.14), 0 11px 18px 0 rgba(0,0,0,0.12), 0 13px 5px -1px rgba(0,0,0,0.2);

      .info {
        visibility: visible;
      }
      .nav-item span {
        display: inline;
      }
    }
    z-index: 2;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
  }

  .sidebar-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 52px;
    height: calc(100vh - 52px);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .main {
    width: calc(100% - #{$sidebar-width});
    max-width: none;

    .sidebar-collapsed & {
      width: calc(100% - #{$sidebar-width-collapsed});
    }
  }
}

.chart-h-min {
  min-height: 100px;
}

@include media-breakpoint-up(xl) {
  .chart-h-min-xl-0 {
    min-height: 0;
  }
}

/**
 * Home page instance list
 */
.instance-list {
  .sparkline-container {
    height: 30px;

    .dygraph-axis-label {
      color: $text-muted;
    }
  }
}

/**
 * This rule can be useful for plugins for which we don't need the full width.
 * Should be used just like Bootstrap's `.container` (ie. with rows and col-xx
 * inside).
 */
.limiter {
  max-width: 1000px;
}

.canvas-wrapper {
  width: 100%;
  height: 100%;
}

.card-body table {
  width: 100%;
}

.dashboard .card-body {
  height: 190px;
}

table.dashboard-information {
  th {
    font-weight: normal;
  }
  td {
    font-weight: bold;
  }
}

.popover-title {
  font-size: 12px;
  font-weight: bold;
  min-width: 200px;
  padding-top: 2px;
  padding-bottom: 2px;
}
.popover-content {
  font-size: 11px;
  min-width: 200px;

  table {
    width: 100%;
    padding: 5px;
  }
}

.panel-default > .panel-heading {
  border-bottom: 0px;

  &.panel-heading-inverse {
    background-color: $primary;
  }
}

#alert-configuration {

  p {
    padding-top: 0px;
  }

  h2 {
    font-size: 18px;
    padding: 0px;
    margin-top: 10px;
  }
}


#error-configuration {
  p {
    padding-top: 0px;
  }

  h2 {
    font-size: 18px;
    padding: 0px;
    margin-top: 10px;
  }
}



#ok-configuration {
  p {
    padding-top: 0px;
  }

  h2 {
    font-size: 18px;
    padding: 0px;
    margin-top: 10px;
  }

  table {
    margin: 0px;
  }
}


#configuration-row {
  margin-top: 20px;
}

.navbar .navbar-left table tr td {
  color: #666;
}

#logo {
  margin: 0px;
  padding: 10px 0px 10px 10px;
  font-size: 24px;
  color: #fff;
}

#panelLogin {
  margin-top: 20px;
}

table.dataTable thead {
  .sorting,
  .sorting_asc,
  .sorting_desc {
    &::before,
    &::after {
      float: right;
      font-family: fontawesome;
      right: 0 !important;
      content: '';
    }
  }
  .sorting_asc::before {
    content: "\f0de";
  }
  .sorting_desc::after {
    content: "\f0dd";
  }
  .sorting::after {
    content: "\f0dc";
  }
}



table.table-activity {
  border-collapse: collapse !important;

  &.table-sm th {
    padding-right: 10px !important;
    &.sorting_disabled {
      padding-right: $table-cell-padding-sm !important;
    }
  }
}

table.table-query {
  td, th {
    white-space: nowrap;
    box-sizing: content-box;
  }

  th.query {
    width: 50%; /* query should be the widest column */
  }

  td.query {
    max-width: 0;
    overflow: hidden;
    vertical-align: middle;
    cursor: pointer;
  }

  pre, code {
    margin: 0;
    padding: 0;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .hljs {
    background: none;
    white-space: nowrap;
  }

  .detail {
    .hljs {
      max-height: 400px;
      white-space: pre-wrap;
      overflow: auto;
    }
  }
}

.popover.sql {
  max-width: 500px;

  pre {
    margin: 0;

    code {
      white-space: pre-wrap;
    }
  }
}

.alert-restricted {
  margin-top: 10px;
  padding: 10px;
}

.no-sort::after { display: none!important; }

.no-sort {
  pointer-events: none!important;
  cursor: default!important;
}

.modal-header {
  background-color: #f6f6f6;
}

.modal-body {
  padding-bottom: 0px;
}

.title-setting {
  font-weight: bold;
  color: #000;
}

.chart-small {
  height: 80px;
}

.monitoring-chart {
  width: 100%;
  height: 300px;

  .alert-ok,
  .alert-warning,
  .alert-critical,
  .alert-undef {
    border: 0;
    background-color: transparent;
    font-size: 1rem !important;
  }
  .alert-ok {
    color: $success !important;
  }
  .alert-warning {
    color: $warning !important;
  }
  .alert-critical {
    color: $danger !important;
  }
  .alert-undef {
    color: $undef !important;
  }

  .dygraph-annotation {
    cursor: pointer;
  }
}

.legend-chart, .visibility-chart {
  font-size: 12px;
}

#charts-container .card-body {
  position: relative;
}

.nodata-chart {
  position: absolute;
  z-index: 3;
  top: 50px;
  margin-left: auto;
  margin-right: auto;
  left: 0;
  right: 0;
  width: 200px;
}

.picker-dropdown-panel {
  right: 0;
  z-index: $zindex-dropdown;
}

#divNotif10 {
  margin-top: 2px;
  width: 100%;
  overflow-y: auto;
}

ul.notifications {
  list-style: none;
  padding: 0;
  margin: 0;

  li {
    width: 100%;
    line-height: 1.8em;
    color: #333;
  }

  & > li > span.date-notification-db {
    color: #337AB7;
  }
}

td.date {
  color: #337AB7;
}

$glow-color-start: white;
$glow-color-end: lighten($primary, 30%);
@keyframes glowing {
  0% { box-shadow: 0 0 3px $glow-color-start; }
  50% { box-shadow: 0 0 10px $glow-color-end; }
  100% { box-shadow: 0 0 3px $glow-color-start; }
}

.glow {
  animation: glowing 1500ms infinite;
}

.table-no-margin {
  margin-bottom: 0;
}

// dataTables wraps the table in a fluid container
// This adds margins. Here we remove them.
.row .dataTables_wrapper {
  padding-right: 0;
  padding-left: 0;
}

.top-0 {
  top: 0;
}

.right-0 {
  right: 0;
}

canvas {
  height: 20px;
}

.collapse-toggle.dropdown-toggle {
  &::after {
    border-top: none;
    border-bottom: .3em solid;
  }
  &.collapsed::after {
    border-top: .3em solid;
    border-bottom: none;
  }
}

.columns-2 {
  columns: 2;
  -webkit-columns: 2;
  -moz-columns: 2;
}

.sortable-ghost {
  opacity: 0.8;
  .card-body {
    background-color: $light;
  }
}

.sortable-drag {
  .card-body > * {
    opacity: 0;
  }
}
[v-cloak] {
  display: none !important;
}

.striped {
  background-image: linear-gradient(45deg,rgba(255,255,255,.5) 5%,transparent 5%,transparent 50%,rgba(255,255,255,.5) 50%,rgba(255,255,255,.5) 75%,transparent 75%,transparent);
  background-size: 1rem 1rem;
}

/* Util to truncate long text in table cell */
table td.auto-width {
  max-width: 0;
  div {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.progress-no-size {
  height: inherit;
  font-size: inherit;
}

@mixin gradient-striped-small($color: rgba($white, .5), $angle: 45deg) {
  background-image: linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
}

.progress-bar-striped-small {
  @include gradient-striped-small();
  background-size: $progress-height/3*2 $progress-height/3*2;
}

*:fullscreen {
  background-color: white;
}

*:-moz-full-screen {
  background-color: white;
}

.d-fullscreen {
  display: none;

  // Note: doesn't work if grouped
  *:fullscreen & {
    display: initial;
  }
  *:-webkit-full-screen & {
    display: initial;
  }
  *:-moz-full-screen & {
    display: initial;
  }
}

*:-webkit-full-screen  {
  width: 100% !important;
  height: 100%;
}

.multiselect-container {
  >li>a>label {
    padding-left: 10px;
  }

  .dropdown-item.active {
    background-color: #dfdfdf;
  }
}
