/*!
 * Tabler (v0.9.0): _dark.scss
 * Copyright 2018-2021 The Tabler Authors
 * Copyright 2018-2021 codecalm
 * Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
 */

// stylelint-disable declaration-no-important
body:not(.theme-dark) .hide-theme-light {
  display: none !important;
}

@include dark-mode {
  & {
    --#{$variable-prefix}body-color: #{$dark-mode-text};
    --#{$variable-prefix}body-color-rgb: #{to-rgb($dark-mode-text)};

    --#{$variable-prefix}body-bg: #{$dark-mode-darken};
    --#{$variable-prefix}body-bg-rgb: #{to-rgb($dark-mode-darken)};

    --#{$variable-prefix}card-bg: #{$dark};
    --#{$variable-prefix}card-bg-rgb: #{to-rgb($dark)};

    --#{$variable-prefix}border-color: #{$dark-mode-border-color};
    --#{$variable-prefix}border-color-light: #{$dark-mode-border-color-light};

    --#{$variable-prefix}btn-color: #{$dark};

    color: $dark-mode-text;
    background-color: $dark-mode-darken;
  }

  .page {
    color: $dark-mode-text;
  }

  .hide-theme-dark {
    display: none !important;
  }

  .text-body {
    color: $dark-mode-text!important;
  }

  .card,
  .card-footer,
  .card-stacked::after,
  .footer:not(.footer-transparent),
  .modal-content,
  .modal-header,
  .dropdown-menu,
  .alert:not(.alert-important) {
    background-color: $dark;
    color: inherit;
  }

  .card {
    border-color: transparent;
  }

  .card-tabs .nav-tabs .nav-link {
    background-color: $dark-mode-darken;
    color: inherit;
  }

  pre {
    background-color: $dark-mode-darken;
    border-color: $dark-mode-border-color;
  }

  .card-tabs .nav-tabs .nav-link.active {
    background-color: $dark;
    color: inherit;
  }

  .btn-white,
  .form-file-button {
    //@include button-variant($dark-mode-lighten, $border-color, $dark-mode-text, rgba($dark, 0), $border-color, $dark-mode-text);
    background-image: none;
  }

  .form-check-input:not(:checked),
  .form-select,
  .form-file-text,
  .form-control,
  .form-selectgroup-label,
  .form-selectgroup-check,
  .form-imagecheck-figure:before {
    background-color: $dark-mode-darken;
    color: $dark-mode-text;
    border-color: $dark-mode-border-color;
  }

  .form-control-plaintext {
    color: $dark-mode-text;
  }

  .input-group-flat .input-group-text {
    background-color: $dark-mode-darken;
  }

  .input-group-text {
    border-color: $dark-mode-border-color;
  }

  .highlight {
    background-color: $dark-mode-darken;
  }

  .avatar {
    --#{$variable-prefix}avatar-bg: #{$dark-mode-lighten};
  }

  .avatar-list-stacked .avatar {
    box-shadow: 0 0 0 2px $dark;
  }

  .markdown,
  .markdown>*,
  .accordion-button {
    color: inherit;
  }

  .btn-close,
  .accordion-button:after {
    filter: $btn-close-white-filter;
  }

  .apexcharts-text {
    fill: $dark-mode-text;
  }

  .apexcharts-gridline {
    stroke: var(--#{$variable-prefix}border-color);
  }

  .apexcharts-legend-text {
    color: inherit !important;
  }

  .apexcharts-tooltip {
    background: $dark !important;
    border: 1px solid $dark-mode-border-color !important;
    box-shadow: 2px 2px 6px -4px $dark-mode-darken !important;

    .apexcharts-tooltip-title {
      background: $dark !important;
      border-bottom: 1px solid $dark-mode-border-color !important;
    }
  }

  .navbar-brand-autodark {
    @include autodark-image;
  }

  .table thead th,
  .input-group-text {
    background: transparent;
  }

  .list-group-header {
    background: $dark-mode-darken;
  }

  .list-group-item {
    border-color: $border-color-transparent;
  }

  .list-group-item:not(.disabled):not(:disabled) {
    color: $dark-mode-text;
  }

  .list-group-item {
    &.disabled,
    &:disabled {
      color: $gray-600;
    }
  }

  .apexcharts-radialbar-area {
    stroke: $dark-mode-border-color;
  }

  .form-control.is-invalid,
  .was-validated .form-control:invalid {
    border-color: var(--#{$variable-prefix}danger);
  }

  .form-control.is-valid,
  .was-validated .form-control:valid {
    border-color: var(--#{$variable-prefix}success);
  }
}
