.container-fluid {
  padding-left: 30px;
  padding-right: 30px;
}

.navbar {
  height: $navbar-height;
  border: none;
  justify-content: flex-start;
  font-size: 1rem;

  .nav-link > i {
    font-size: 20px;
  }

  .input-group {
    width: 245px;
  }

  .form-control {
    line-height: 1.7;
    padding: 0.6rem 0.85rem;
  }
}

.progress-bar {
  @include box-shadow(none);
}

.progress {
  height: $spacer * 1.3;
  margin-bottom: $spacer / 2;
  background: theme-color('default');
}

.progress-sm {
  height: 10px;
}

.progress-xs {
  height: 5px;
}

.input-group {
  .input-group-append,
  .input-group-prepend {
    .btn {
      border: none;
    }
  }
}

.form-control {
  font-family: $font-family-base;
  box-shadow: none;
  transition: border-color ease-in-out 0.15s, background-color ease-in-out 0.15s;
  font-weight: $font-weight-thin;

  &:focus {
    box-shadow: none;
  }
}

legend {
  display: block;
  width: 100%;
  padding: 0;
  margin-bottom: $spacer;
  line-height: inherit;
  color: $text-muted;
  border: 0;
  border-bottom: 1px solid $border-color;
  font-size: 15px;
  font-weight: $font-weight-normal;
}

.input-sm {
  font-size: $font-size-sm;
}

.alert {
  font-size: $font-size-sm;

  .close {
    color: $text-color;
  }
}

.alert-sm {
  padding: 10px 15px;

  .close {
    font-size: 20px;
    top: 0;
    right: -8px;
  }
}

.alert-dismissible {
  padding-right: 1.25rem;
}

/*  Badge */
// Add colors for badges
.badge {
  padding: 4px 8px;
  font-weight: $font-weight-semi-bold;
  font-size: 12px;
}

.badge {
  color: $header-color;

  .list-group-item > & {
    margin-top: 2px;
  }
}

.badge-light,
.badge-secondary {
  color: $gray-300;
}

// Dark theme table styling
.table {
  --bs-table-bg: transparent;
  --bs-table-color: #{$text-color};
  --bs-table-border-color: #{$border-color};
  color: $text-color;

  > thead {
    color: $header-color;

    > tr > th {
      border-bottom-color: $border-color;
      background-color: rgba(0, 0, 0, 0.2);
    }
  }

  > tbody {
    > tr > td {
      border-bottom-color: $border-color;
      color: $text-color;
    }
  }

  th, td {
    vertical-align: middle;
  }
}

.table-striped {
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);

  > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.03);
    color: $text-color;
  }
}

.table-hover {
  --bs-table-hover-bg: rgba(255, 255, 255, 0.075);

  > tbody > tr:hover > * {
    background-color: rgba(255, 255, 255, 0.075);
    color: $text-color;
  }
}

.table-bordered {
  --bs-table-border-color: #{$border-color};

  > :not(caption) > * > * {
    border-color: $border-color;
  }
}

// Pagination dark theme
.pagination {
  --bs-pagination-bg: #{$widget-bg};
  --bs-pagination-color: #{$text-color};
  --bs-pagination-border-color: #{$border-color};
  --bs-pagination-hover-bg: rgba(255, 255, 255, 0.1);
  --bs-pagination-hover-color: #{$header-color};
  --bs-pagination-hover-border-color: #{$border-color};
  --bs-pagination-active-bg: #{theme-color('primary')};
  --bs-pagination-active-border-color: #{theme-color('primary')};
  --bs-pagination-disabled-bg: #{$widget-bg};
  --bs-pagination-disabled-color: #{$text-muted};
  --bs-pagination-disabled-border-color: #{$border-color};

  .page-link {
    background-color: $widget-bg;
    border-color: $border-color;
    color: $text-color;

    &:hover {
      background-color: rgba(255, 255, 255, 0.1);
      color: $header-color;
    }
  }

  .page-item.active .page-link {
    background-color: theme-color('primary');
    border-color: theme-color('primary');
    color: $white;
  }

  .page-item.disabled .page-link {
    background-color: $widget-bg;
    border-color: $border-color;
    color: $text-muted;
  }
}

.table-no-border {
  margin-left: -$table-cell-padding;
  margin-right: -$table-cell-padding;

  > thead > tr > th,
  > thead > tr > td,
  > tbody > tr > th,
  > tbody > tr > td,
  > tfoot > tr > th,
  > tfoot > tr > td {
    border-top: 0;
  }
}

.table-sm {
  font-size: $font-size-sm;

  > thead > tr > th,
  > thead > tr > td,
  > tbody > tr > th,
  > tbody > tr > td,
  > tfoot > tr > th,
  > tfoot > tr > td {
    padding: 6px;
  }

  &.table-no-border {
    margin-left: -4px;
    margin-right: -4px;
  }
}

.table > :not(:first-child) {
  border-top: none;
}

.small,
small {
  font-size: 85%;
}

///////// Buttons //////////

[class*='btn-outline'] {
  background-image: none;
}

.btn-link {
  &:focus {
    box-shadow: none;
  }
}

.btn {
  &,
  &:hover,
  &.disabled,
  &:disabled {
    color: $header-color;
  }
}

.btn-default {
  border: none;
}

.btn-secondary {
  color: #333 !important;

  &:hover,
  &:focus,
  &:active,
  &.active {
    color: #333 !important;
  }

  i {
    color: #333;
  }
}

.btn-xs {
  padding: 1px 5px;
  font-size: $font-size-index;
  line-height: 1.5;
  border-radius: $border-radius-sm;
}

.btn {
  font-family: $font-family-sans-serif;

  .glyphicon {
    top: 3px;
  }
}

.btn,
.btn-inverse,
.btn-gray {
  &:not(.active) {
    box-shadow: none !important;
  }
}

.btn-rounded {
  @include border-radius(6px);
}

.btn-rounded-f {
  @include border-radius(50px);
}

.btn-outline {
  @include button-variant(transparent, $text-color);

  @include hover-focus() {
    background-color: rgba($white, 0.1);
  }
}

///////// Dropdowns //////////

.dropdown {
  &.show {
    .dropdown-menu {
      top: 100%;
      display: block;
    }
  }
}

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

.dropdown-toggle::after {
  font-family: 'Line Awesome Free';
  content: '\F107';
  border: none;
  width: auto;
  height: auto;
  vertical-align: baseline;
  opacity: 0.8;
  font-size: 85%;
  font-weight: $font-weight-semi-bold;
}

.dropdown-toggle-no-caret:after {
  content: none;
}

.nav-item.dropdown {
  &.show {
    .nav-link.active {
      background: $navbar-link-active-bg;
      color: $navbar-link-active-color;
    }
  }
}

.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  vertical-align: middle;
  border-top: 4px dashed;
  border-top: 4px solid;
  // IE8
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

///////// Alerts //////////

.alert {
  border: none;

  .btn {
    border: none;
  }

  button.close {
    z-index: 2;
    background-color: transparent;
    border: 0;
    font-weight: $font-weight-thin;
    text-shadow: none;
    color: $text-color;
    outline: none;
    padding: 0;
    position: static;
    float: right;
    font-size: 1.5rem;
    line-height: 1;
    opacity: .5;
  }
}

.alert-white button.close {
  color: $gray-600;
}

.alert-rounded {
  border-radius: 50px;
}

@mixin alert($color) {
  background: theme-color($color);
  color: $header-color;

  &.alert-transparent {
    color: theme-color($color);
    background: rgba(theme-color($color), $alert-transparent);
  }

  .btn:not(.btn-default) {
    background: rgba($header-color, 0.8);
    color: theme-color($color);
  }
}

.alert-success {
  @include alert('success');
}

.alert-info {
  @include alert('info');
}

.alert-warning {
  @include alert('warning');
}

.alert-danger {
  @include alert('danger');
}

.alert-default {
  @include alert('default');
}

///////// Jumbotron //////////
.widget {
  .jumbotron {
    background: transparent;
  }
}

.jumbotron {
  @include border-radius($widget-border-radius);
}

.container-fluid .jumbotron, .container .jumbotron {
  border-radius: 6px;
  padding-left: 15px;
  padding-right: 15px;
}

@media screen and (min-width: 768px)
{
  .jumbotron, .jumbotron {
    padding-left: 60px;
    padding-right: 60px;
  }
}

@media screen and (min-width: 768px)
{
  .jumbotron {
    padding-bottom: 48px;
    padding-top: 48px;
  }
}

.jumbotron {
  margin-bottom: 30px;
  //padding: 30px 60px;
  //background: theme-color('dark-main');
  background: $widget-bg;
}

///////// Breadcrumbs //////////

.breadcrumb {
  color: $text-color;
  margin-bottom: 1.5rem;
  margin-top: 0;

  a {
    color: inherit;
  }

  > .active {
    font-weight: $font-weight-semi-bold;
  }

  padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: '>';
  color: $text-color;
}

///////// Glyphicons //////////

.glyphicon {
  vertical-align: baseline;
}

///////// Font Awesome //////////

.navbar {
  .fa {
    &.fa-lg {
      line-height: 19px;
    }
  }
}

///////// Tooltips //////////

.bs-tether-target.show {
  display: inline-block !important;
}

.tooltip.in {
  opacity: 1;
}

.tooltip-inner {
  @include border-radius(3px);
}

///////// List Group //////////

.list-group {
  .list-group-item {
    background-color: transparent;
  }
}

.list-group-lg {
  .list-group-item {
    padding: 1.25rem;
  }
}

.list-group:not(.list-group-sortable) .list-group-item {
  border-left: none;
  border-right: none;
}

.list-group-item {
  @include transition(background 0.15s ease-in-out);

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

  &:last-child {
    border-bottom: none;
  }

  &:hover {
    background: $addition-bg;
  }

  &,
  &:hover {
    color: $text-color;
  }
}

////////// Headings //////////

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  color: $header-color;

  small,
  .small {
    font-weight: $font-weight-thin;
    font-size: 75%;
    color: $text-muted;
  }
}

// Popovers

.popover {
  border: none;

  @include box-shadow(none);
}

.popover-content {
  padding: 20px;
}

.popover-header,
.popover-body {
  color: $gray-700;
}

// Modals
// -------------------------------------------------
.modal {
  .modal-footer,
  .modal-header {
    border-width: $input-border-width;
  }
  button.close {
    z-index: 2;
    background-color: transparent;
    border: 0;
    font-weight: $font-weight-thin;
    text-shadow: none;
    color: $text-color;
    outline: none;
    padding: 0;
    position: static;
    float: right;
    font-size: 1.5rem;
    line-height: 1;
    opacity: .5;
  }
}

// Navs
// --------------------------------------------------

.nav-tabs {
  &.nav-item + .nav-item {
    margin-left: 0;
  }

  border-bottom: none;

  > .nav-item {
    margin-bottom: 0;

    > .nav-link {
      padding: 12px 18px;
      border: none;
      color: $text-muted;

      .label {
        margin-bottom: -2px;
      }

      @include transition(color 0.15s ease-in-out);

      &:hover {
        background-color: transparent;
        color: $text-color;
      }
    }

    .nav-link.open {
      &,
      &:hover,
      &:focus {
        background-color: $nav-tabs-active-link-hover-bg;
        color: $nav-tabs-active-link-hover-color;
      }
    }

    .nav-link.active {
      &,
      &:hover,
      &:focus {
        background-color: $nav-tabs-active-link-hover-bg;
        color: $nav-tabs-active-link-hover-color;
        border: none;
        font-weight: $font-weight-semi-bold;

        @include box-shadow(none);
      }
    }
  }
}

.nav-pills {
  padding: 0;

  .nav-link {
    color: transparentize($text-color, 0.3);

    &:hover {
      color: $nav-pills-link-active-color;
    }

    &.active {
      font-weight: $font-weight-semi-bold;
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }
  }
}

.tab-content {
  position: relative;
  z-index: 1;
  background-color: $widget-bg;

  > .tab-pane {
    padding: $spacer * 2;
  }
}

// Code
// -----------------

code {
  font-size: 85%;
  background-color: rgba($primary, 0.3);
  border-radius: $border-radius-sm;
  color: $success;
  padding: $spacer / 10;
}

pre {
  display: block;
  padding: 6.5px;
  margin: 0 0 (1rem / 2);
  font-size: $font-size-sm;
  line-height: 1rem;
  word-break: break-all;
  word-wrap: break-word;
  color: $pre-color;
  background-color: $pre-bg;
  border: 1px solid $pre-border;
  border-radius: $border-radius;
  white-space: pre-line; /* css-3 */
  white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
  white-space: -pre-wrap; /* Opera 4-6 */
  white-space: -o-pre-wrap; /* Opera 7 */

  // Account for some code outputs that place code tags in pre tags
  code {
    padding: 0;
    font-size: inherit;
    color: inherit;
    white-space: pre-wrap;
    background-color: transparent;
    border-radius: 0;
  }
}

//
// Accordion
// --------------------------------------------------

.accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;

  .fa {
    transition: $transition-base;

    &.expanded {
      transform: rotate(180deg);
    }
  }
}

//
// Font Awesome
// --------------------------------------------------

.circle {
  .fa {
    vertical-align: baseline;
  }
}

///// V Select //////
.v-select {
  .open-indicator:before {
    border-width: 1px 1px 0 0 !important;
    border-color: $text-color !important;
    width: 5px !important;
    height: 5px !important;
    color: $text-color !important;
  }

  .dropdown-toggle .clear {
    font-weight: $font-weight-thin;
    font-size: 18px !important;
    color: $text-color !important;
  }

  li > a {
    color: $text-color !important;
  }

  .selected-tag {
    color: $text-color !important;
  }

  .dropdown-toggle {
    border-color: $input-border-color !important;
    border-width: $input-border-width !important;
    background-color: $input-bg !important;

    &:after {
      content: none !important;
    }
  }

  .dropdown-menu {
    background: $dropdown-bg !important;
  }
}

///// Vue Dropzone //////
.dropzone.vue-dropzone {
  border: 2px dashed $widget-bg;
  font-family: $font-family-base;
  background-color: transparent;
  border-radius: $widget-border-radius;
  color: $text-color;

  &:hover {
    background-color: rgba(0, 0, 0, 0.1);
  }
}

///// Vue Form Wizard //////
.vue-form-wizard .wizard-nav-pills > li > a {
  position: static !important;
}

///// Vue Input Tag /////
.vue-input-tag-wrapper {
  appearance: none;
  height: max-content;

  .input-tag {
    border-radius: $border-radius;
    background-color: $purple;
    color: $text-color;
    border-color: darken($purple, 10%);

    .remove:before {
      content: ' ×' !important;
      color: $text-color;
    }
  }

  .input-tag,
  .new-tag {
    margin: 2px;
  }
}

////// VUE TOASTED //////
.toasted-container {
  .toasted.toasted-primary {
    box-shadow: none;
    font-size: $font-size-sm;
    border-radius: $border-radius;

    &.default {
      background: theme-color('default');
      color: theme-color('secondary');
    }

    &.error {
      background: theme-color('error');
    }

    &.success {
      background: theme-color('success');
    }

    &.info {
      background: theme-color('info');
    }

    &.warning {
      background: theme-color('warning');
    }

    .action {
      color: white;
    }
  }
}

/////// CK Editor /////////
.ck-content {
  min-height: 200px;
}

/////// Rickshaw ////////
.rickshaw_graph {
  .x_label {
    color: $gray-900;
  }
}

/////// Vue Bootstrap Slider /////////
/* slider */

$slider-line-height: 8px;
$slider-handle-size: 26px;

.slider {
  display: inline-block;
  vertical-align: middle;
  position: relative;

  .slider-handle {
    position: absolute;
    width: $slider-handle-size;
    height: $slider-handle-size;
    background: $default;
    border: 0 solid transparent;

    @include box-shadow(
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      0 1px 3px rgba(0, 0, 0, 5)
    );

    &:focus {
      outline: 0;
    }

    &.round {
      border-radius: 50%;
    }

    &.triangle {
      background: transparent none;
    }
  }

  .slider-track {
    background-image: none;
    background-color: $dark;
  }

  &.slider-horizontal {
    width: 210px;
    height: $slider-line-height;

    .slider-track {
      height: $slider-line-height/2;
      width: 100%;
      margin-top: -$slider-line-height/4;
      top: 50%;
      left: 0;
    }

    .slider-selection {
      height: 100%;
      top: 0;
      bottom: 0;
    }

    .slider-handle {
      margin-left: -$slider-handle-size/2;
      margin-top: -$slider-handle-size * 3/8;

      &.triangle {
        border-width: 0 $slider-line-height/2 $slider-line-height/2
          $slider-line-height/2;
        width: 0;
        height: 0;
        border-bottom-color: #0480be;
        margin-top: 0;
      }
    }
  }

  &.slider-vertical {
    height: 210px;
    width: $slider-line-height;

    .slider-track {
      width: $slider-line-height/2;
      height: 100%;
      margin-left: -$slider-line-height/4;
      left: 50%;
      top: 0;
    }

    .slider-selection {
      width: 100%;
      left: 0;
      top: 0;
      bottom: 0;
    }

    .slider-handle {
      margin-left: -$slider-handle-size * 3/8;
      margin-top: -$slider-handle-size/2;

      &.triangle {
        border-width: $slider-line-height/2 0 $slider-line-height/2
          $slider-line-height/2;
        width: 1px;
        height: 1px;
        border-left-color: #0480be;
        margin-left: 0;
      }
    }
  }

  &.slider-disabled {
    .slider-track {
      @include gradient-y(#e5e5e5, #e9e9e9);

      cursor: not-allowed;
    }
  }

  input {
    display: none;
  }

  .tooltip-inner {
    white-space: nowrap;
  }
}

.slider-selection {
  position: absolute;
  background: theme-color('primary');

  @include box-shadow(inset 0 -1px 0 rgba(0, 0, 0, 0.15));

  box-sizing: border-box;
  border-radius: $border-radius;
}

.slider-danger .slider .slider-selection {
  background: theme-color('danger'); // $brand-danger;
}

.slider-success .slider .slider-selection {
  background: theme-color('success'); // $brand-success;
}

.slider-warning .slider .slider-selection {
  background: theme-color('warning'); // $brand-warning;
}

.slider-info .slider .slider-selection {
  background: theme-color('info'); // $brand-info;
}

.slider-inverse .slider .slider-selection {
  background: theme-color('inverse'); // $gray;
}

.slider-track {
  position: absolute;
  cursor: pointer;
  border-radius: $border-radius;

  @include gradient-y(#eee, #f8f8f8);
  @include box-shadow(inset 0 1px 2px rgba(0, 0, 0, 0.1));
}

//////// Vue Color /////////
.colorpicker-wrapper {
  position: relative;

  .colorpicker {
    position: absolute;
    z-index: 99999;
    right: 0;
    top: -250px;
  }

  .rect {
    border: 1px solid $white;
    width: 20px;
    height: 20px;
  }
}

//////// Mavon Editor ////////
.v-note-wrapper.markdown-body {
  background: $dark;
  z-index: 50;

  .v-note-op {
    background: $default !important;
    border-width: $input-border-width;

    .v-left-item,
    .v-right-item {
      .op-icon-divider {
        border-color: $dark;
      }

      .op-icon {
        &:hover {
          background: darken($default, 5%);
        }

        &.selected {
          background: darken($default, 10%);
        }

        &,
        &:hover,
        &.selected {
          color: $text-color;
        }

        .popup-dropdown {
          background: $dropdown-bg;
          border-width: $input-border-width;

          .dropdown-item {
            color: $dropdown-link-color;

            &:hover {
              color: $dropdown-link-hover-color;
            }
          }
        }
      }
    }
  }

  .content-input-wrapper,
  .content-input-wrapper .content-input,
  .v-show-content {
    background: $dark !important;
  }

  pre,
  textarea {
    background: $dark;
  }

  .v-note-panel .v-note-edit.divarea-wrapper.scroll-style::-webkit-scrollbar {
    width: 2px;
    background-color: $gray-300;
  }
}

////// Awesome Bootstrap checkbox - Dark theme overrides ///////
.abc-checkbox,
.abc-radio {
  label::before {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.3);
    border-width: 2px;
    border-radius: 5px;
  }

  label::after {
    color: $text-color;
  }

  input[type="checkbox"]:checked + label,
  input[type="radio"]:checked + label {
    &::before {
      background-color: theme-color('default');
      border-color: theme-color('default');
    }
    &::after {
      color: #fff;
    }
  }
}

@include checkbox-variant('.abc-checkbox-default', theme-color('default'));
@include radio-variant('.abc-radio-default', theme-color('default'));

////// CK Editor ///////
.ck.ck-toolbar {
  background: theme-color('default') !important;
  border-width: $input-border-width !important;
}

.ck.ck-button {
  color: $text-color !important;
}

.ck.ck-button:not(.ck-disabled):hover,
a.ck.ck-button:not(.ck-disabled):hover {
  background: rgba(0, 0, 0, 0.2) !important;
}

.ck.ck-button.ck-on,
a.ck.ck-button.ck-on {
  background: rgba(0, 0, 0, 0.4) !important;

  &:hover {
    background: rgba(0, 0, 0, 0.5) !important;
  }
}

.ck.ck-editor__main > .ck-editor__editable {
  background: $input-bg !important;
  border-width: $input-border-width !important;
}

.ck.ck-toolbar__separator {
  display: none;
}

////////// ApexCharts ///////////
.apexcharts-menu {
  background: $dark;
  border: none;
  .apexcharts-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}

////////// Navbar Notifications Dropdown ///////////
.navbar-notifications {
  border: none;

  .list-group-item {
    border: none;

    p {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 5px;

      .btn {
        display: inline-flex;
      }

      time {
        width: 100%;
      }
    }
  }
}

////////// Google Maps ///////////
.gm-style {
  img {
    vertical-align: unset;
  }

  label {
    margin-bottom: 0;
  }
}

////////// Email Page Dropdowns ///////////
.email-dropdown {
  > button,
  > .btn,
  .dropdown-toggle {
    background-color: $default !important;
    border-color: rgba($white, 0.15) !important;
    color: $text-color !important;
    font-weight: 500;
    box-shadow: none !important;

    &:hover,
    &:focus,
    &:active,
    &.show,
    &[aria-expanded="true"] {
      background-color: lighten($default, 5%) !important;
      border-color: rgba($white, 0.2) !important;
      color: $text-color !important;
    }

    &::after {
      margin-left: 12px;
    }
  }

  .dropdown-menu {
    background-color: $default;
    border-color: rgba($white, 0.15);

    .dropdown-item {
      color: $text-color;

      &:hover,
      &:focus {
        background-color: rgba($white, 0.1);
        color: $white;
      }
    }

    .dropdown-divider {
      border-color: rgba($white, 0.15);
    }
  }
}
