/**
 * Copyright (c) Forward Email LLC
 * SPDX-License-Identifier: BUSL-1.1
 */

// stylelint-disable no-invalid-position-at-import-rule

@import 'node_modules/bootstrap/scss/functions';
@import 'node_modules/bootstrap/scss/variables';
@import 'variables';

@import 'node_modules/bootstrap/scss/mixins';
@import 'node_modules/@forevolve/bootstrap-dark/scss/bootstrap-prefers-dark';

$input-bg:                              $black;
$input-disabled-bg:                     $dark;

// stylelint-disable scss/at-extend-no-missing-placeholder
@media (prefers-color-scheme: dark) {
  a, .markdown-body a {
    color: $link-color;
    text-decoration: $link-decoration;
    background-color: transparent; // Remove the gray background on active links in IE 10.

    @include hover() {
      color: $link-hover-color;
      text-decoration: $link-hover-decoration;
    }
  }
  .navbar-dark .navbar-toggler {
    color: white !important;
  }
  .btn-outline-dark {
    @extend .text-light;
  }
  .card {
    background-color: #0d1116 !important;
  }
  .bg-dark, .bg-themed, .navbar-themed {
    background-color: #0d1116 !important;
    .btn-outline-dark {
      @extend .text-light;
    }
  }
  code {
    color: $white;
  }
  .markdown-body {
    .bg-dark {
      background-color: $gray-800 !important;
    }
    code {
      background-color: $gray-800 !important;
      color: $white;
    }
    pre code {
      background-color: transparent !important;
      padding: 0 !important;
    }
    .octicon-link {
      fill: white;
    }
    h1, h2, hr {
      border-bottom: 1px solid rgba(255, 255, 255, 0.7) !important;
    }
    table tr {
      border-top: 1px solid rgba(255, 255, 255, 0.7) !important;
    }
  }
  mark, .mark {
    padding: 0;
    color: inherit !important;
    background: none !important;
  }
  pre, .highlight pre {
    padding: 0 !important;
  }
  /*
  .text-themed {
    color: white !important;
    &:hover {
      color: white !important;
    }
  }
  */

  .table-success, .table-warning, .table-danger, .table-secondary {
    code.text-themed {
      color: $dark !important;
    }
  }

  .dropdown-item.active, .dropdown-item:active {
    color: white;
  }

  @import 'node_modules/github-markdown-css/github-markdown-dark';
  @import 'node_modules/@tkrotoff/bootstrap-floating-label/src/bootstrap-floating-label';
  @import 'node_modules/highlight.js/scss/github-dark';
  @import 'swal2-dark';
  @import 'swal2';

  .btn-ubuntu {
    @include button-variant(#e95320, darken(#e95320, 10%));
  }

  // <https://github.com/chakra-ui/chakra-ui/issues/1786>
  input {
    color-scheme: dark;
  }

  // scalar app CSS reset
  // <https://github.com/devinschumacher/css-reset/blob/main/reset.css>
  // <https://github.com/elad2412/the-new-css-reset/blob/main/css/reset.css>
  @import 'scalar-app';
}
