/* Pi-hole: A black hole for Internet advertisements
*  (c) 2020 Pi-hole, LLC (https://pi-hole.net)
*  Network-wide ad blocking via your own hardware.
*
*  This file is copyright under the latest version of the EUPL.
*  Please see LICENSE file for your rights under this license.
*
*  The colors used in this theme has been inspired by
*  https://github.com/anvyst/adminlte-skin-midnight */

:root {
  --datatable-selected-bg: rgba(60, 141, 188, 0.6);
  --overlay-bgcolor: rgba(64, 76, 88, 0.8);

  /* Dashboard graphic bars */
  --allowed-color: #12b660;
  --blocked-color: #822d21;
  --cached-color: #44649c;
  --other-color: #969798;

  /* Base theme colors, reused throughout this file */
  --theme-text: #bec5cb;
  --theme-bg: #353c42;
}

/* fix #2554: browser not detecting dark mode */
html {
  color-scheme: dark;
}

body {
  background-color: var(--theme-bg);
  color: var(--theme-text);
}
h4 {
  color: #3c8dbc;
}
/* Tone down Bootstrap's bright accent fills, which are too saturated on the
  dark background (the active page link and the filled coloured card headers
  such as the query-log "Advanced filtering" box). */
.page-item.active > .page-link {
  background-color: #3c8dbc;
  border-color: #3c8dbc;
}
.card-info {
  --lte-card-variant-bg: #256170;
  --lte-card-variant-bg-rgb: 37, 97, 112;
  --lte-card-variant-color: #d6eef5;
  --lte-card-variant-color-rgb: 214, 238, 245;
}
.card-primary {
  --lte-card-variant-bg: #285a7a;
  --lte-card-variant-bg-rgb: 40, 90, 122;
  --lte-card-variant-color: #d6e5f2;
  --lte-card-variant-color-rgb: 214, 229, 242;
}
.callout h4 {
  color: inherit;
}
.content-header > .breadcrumb > li > a {
  color: var(--theme-text);
}
.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td,
.table > tfoot > tr > td {
  border-top: 0;
}
.table > thead > tr.odd,
.table > tbody > tr.odd,
.table > tfoot > tr.odd {
  background-color: #2a2f34;
}
.table > thead > tr.odd:hover,
.table > tbody > tr.odd:hover,
.table > tfoot > tr.odd:hover,
.table > thead > tr.even:hover,
.table > tbody > tr.even:hover,
.table > tfoot > tr.even:hover {
  background-color: #1e2226;
}
.table-bordered,
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > td,
.table-bordered > tfoot > tr > td {
  border: 1px solid var(--theme-bg);
}
.app-wrapper,
.app-sidebar {
  background-color: #272c30;
}
.user-panel > .info,
.user-panel > .info > a {
  color: #fff;
}
.sidebar-menu > li.nav-header {
  color: #8e989d;
  background-color: #1e2225;
}
.sidebar-menu > li > a {
  border-left: 3px solid transparent;
}
.sidebar-menu > li:hover > a,
.sidebar-menu > li > a:focus,
.sidebar-menu > li.active > a {
  color: #fff;
  background-color: #22272a;
  border-color: #3c8dbc;
}
.sidebar-menu > li > .nav-treeview {
  margin: 0 1px;
  background-color: #32393e;
}
.sidebar a {
  color: var(--theme-text);
}
.sidebar a:hover {
  text-decoration: none;
}
.nav-treeview > li > a {
  color: #949fa8;
}
.nav-treeview > li.active > a,
.nav-treeview > li > a:hover,
.nav-treeview > li > a:focus {
  color: #fff;
}
.card,
.card-body,
.card-footer,
.card-header {
  border-color: var(--theme-bg);
  color: var(--theme-text);
  background-color: #272c30;
  box-shadow: none;
}
.info-box {
  color: var(--theme-text);
  background-color: #272c30;
}
.card-footer {
  border-top: 1px solid var(--theme-bg);
}
.card-header.with-border {
  border-bottom: 1px solid var(--theme-bg);
}
.card > .card-header {
  color: var(--theme-text);
}
.card.card-info {
  border-top-color: #00c0ef;
}
.card.card-primary {
  border-top-color: #075383;
}
.card.card-success {
  border-top-color: #00a65a;
}
.card.card-warning {
  border-top-color: #ff851b;
}
.card.card-danger {
  border-top-color: #dd4b39;
}
.app-header.navbar {
  background-color: #272c30;
}
.app-header.navbar .nav > li > a,
.app-header.navbar .nav > li > .navbar-text {
  color: var(--theme-text);
  height: 50px;
  padding: 15px;
}
.app-header.navbar .nav > li > a:hover,
.app-header.navbar .nav > li > a:active,
.app-header.navbar .nav > li > a:focus,
.app-header.navbar .nav .open > a,
.app-header.navbar .nav .open > a:hover,
.app-header.navbar .nav .open > a:focus,
.app-header.navbar .nav > .active > a {
  background-color: rgba(0, 0, 0, 0.1);
  color: #f6f6f6;
}
.app-header.navbar .sidebar-toggle {
  color: var(--theme-text);
}
.app-header.navbar .sidebar-toggle:hover {
  color: #f6f6f6;
  background-color: rgba(0, 0, 0, 0.1);
}
.timeline li .timeline-item {
  color: var(--theme-text);
  background-color: #272c30;
  border-color: var(--theme-bg);
}
.timeline li .timeline-header {
  border-bottom-color: var(--theme-bg);
}
.app-main {
  background-color: var(--theme-bg);
}
.app-footer,
.nav-tabs-custom {
  background-color: #272c30;
  border-top-color: var(--theme-bg);
  color: var(--theme-text);
}
.app-footer .nav-tabs,
.nav-tabs-custom .nav-tabs {
  background-color: #30383f;
  border-bottom-color: #2f363b;
}
.app-footer .tab-content,
.nav-tabs-custom .tab-content {
  background-color: #30383f;
}
.nav-tabs-custom > .nav-tabs {
  background: rgba(64, 72, 80, 0.666);
}
.nav-tabs-custom > .nav-tabs > li {
  margin-right: 1px;
  color: var(--theme-text);
}
.nav-tabs-custom > .nav-tabs > li.active > a,
.nav-tabs-custom > .nav-tabs > li.active:hover > a {
  border-left-color: #30383f;
  border-right-color: #30383f;
  background-color: #30383f;
  color: var(--theme-text);
}
.nav-tabs-custom > .nav-tabs > li:not(.active):hover {
  border-top-color: #d2d6de;
  background-color: transparent;
}
.nav-tabs-custom > .nav-tabs > li > a {
  color: #8e959b;
}
.nav-tabs-custom > .nav-tabs > li > a:focus {
  color: #3c8dbc;
}
.nav-tabs-custom > .nav-tabs > li:hover > a,
.nav-tabs-custom > .nav-tabs > li.active:hover > a {
  background-color: var(--theme-bg);
  color: var(--theme-text);
}

.list-group {
  color: var(--theme-text);
  background-color: #272c30;
}
.list-group .list-group-item {
  border-color: var(--theme-bg);
  background-color: #272c30;
}
.input-group .input-group-addon {
  border-right: 1px solid #272c30;
}
.select2 .select2-selection {
  background-color: var(--theme-bg);
  color: var(--theme-text);
  border: 1px solid var(--theme-bg);
}
.select2 .select2-selection .select2-container--default,
.select2 .select2-selection .select2-selection--single,
.select2 .select2-selection .select2-selection--multiple,
.select2 .select2-selection .select2-selection__rendered {
  color: var(--theme-text);
}
.select2-dropdown {
  background-color: var(--theme-bg);
  color: var(--theme-text);
  border: 1px solid var(--theme-bg);
}
.select2-dropdown .select2-search__field {
  background-color: #272c30;
  color: var(--theme-text);
  border: 1px solid var(--theme-bg);
}
.select2-container--default.select2-container--open {
  background-color: #272c30;
}

.layout-boxed {
  background: url("../../img/boxed-bg-dark.png") repeat fixed;
}

.graphs-grid {
  background-color: rgba(255, 255, 255, 0.2);
}
.graphs-ticks {
  color: #b8c7ce;
}

.progress {
  background-color: #333;
}

kbd {
  color: var(--theme-bg);
  background-color: var(--theme-text);
  box-shadow: inset -1px -1px 2px 0 rgba(0, 0, 0, 0.5);
  vertical-align: middle;
}

code,
pre {
  padding: 2px 4px;
  font-size: 90%;
  color: var(--theme-text);
  background-color: var(--theme-bg);
  border-radius: 4px;
}

/* Used in the Query Log table */
.text-green-light {
  color: #5ca314 !important;
}
.text-green {
  color: #00aa60 !important;
}
.text-orange {
  color: #b1720c !important;
}
.text-red {
  color: #bd2c19 !important;
}
td.highlight {
  background-color: rgba(255, 204, 0, 0.333);
}
.btn-default {
  box-shadow: none;
  background-color: #3e464c;
  color: var(--theme-text);
  border: 1px solid var(--theme-bg);
}

/* Used in debug log page */
.log-red {
  color: #ff4038;
}
.log-green {
  color: #4c4;
}
.log-yellow {
  color: #fb0;
}
.log-blue {
  color: #48f;
}
.log-purple {
  color: #b8e;
}
.log-cyan {
  color: #0df;
}
.log-gray {
  color: #999;
}

#output {
  border-color: #505458;
  background: #272c30;
}

/* Used by the long-term pages */
.daterangepicker {
  background-color: #3e464c;
  border-radius: 4px;
  border: 1px solid var(--theme-bg);
}
.daterangepicker .ranges li:hover {
  background-color: var(--theme-bg);
}
.daterangepicker .ranges li.active {
  background-color: #1e2226; /* Color also used in table pagination */
}
.daterangepicker .calendar-table {
  background-color: #3e464c;
  border-radius: 4px;
  border: 1px solid var(--theme-bg);
}
.daterangepicker td.off,
.daterangepicker td.off.in-range,
.daterangepicker td.off.start-date,
.daterangepicker td.off.end-date {
  background-color: #485158;
}
.daterangepicker td.available:hover,
.daterangepicker th.available:hover {
  background-color: #1e2226;
}
.daterangepicker td.active,
.daterangepicker td.active:hover,
.daterangepicker td.in-range:hover {
  background-color: #225e92;
}
.daterangepicker td.in-range {
  background-color: #1e2226;
  color: var(--theme-text);
}
input,
select,
select.form-control,
.form-group .input-group-addon,
.input-group .input-group-addon,
.form-group input,
.input-group input,
.form-group textarea,
.input-group textarea,
.daterangepicker select.hourselect,
.daterangepicker select.minuteselect,
.daterangepicker select.secondselect,
.daterangepicker select.ampmselect,
.form-control {
  background-color: var(--theme-bg);
  color: var(--theme-text);
  border: 1px solid #3d444b;
}

/*** Overwrite chrome's input field auto-filling ***/
input:-webkit-autofill,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--theme-text) !important;
  -webkit-box-shadow: 0 0 0px 1000px var(--theme-bg) inset;
  -webkit-transition: background-color 1s ease-in-out 0s;
  transition: background-color 1s ease-in-out 0s;
}
.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
  background-color: var(--theme-bg);
  opacity: 1;
}

.navbar[data-bs-theme="dark"] {
  --bs-border-color: var(--theme-bg);
}

.dropdown-menu {
  background-color: #22282d;
  color: var(--theme-text);
  border: 1px solid #4c5761;
}
.navbar-custom-menu > .navbar-nav > li > .dropdown-menu {
  background-color: #30383f;
  border: 1px solid #171c20;
  box-shadow: none;
}
.navbar-nav > .user-menu > .dropdown-menu > .user-body {
  border-color: var(--theme-text);
}
.navbar-nav > .user-menu > .dropdown-menu > .user-footer {
  background-color: #272c30;
}
.navbar-nav > .user-menu > .dropdown-menu > .user-footer a {
  color: var(--theme-text) !important;
}
.navbar-nav > .user-menu > .dropdown-menu > .user-footer a:hover {
  color: #fff !important;
}
.user-menu hr {
  border-color: var(--theme-text);
}

.table-striped > tbody > tr:nth-of-type(2n + 1) {
  background-color: #2d343a;
}

input[type="password"]::-webkit-caps-lock-indicator {
  filter: invert(100%);
}

.network-never {
  background-color: #661b02;
}
.network-recent {
  background-color: #114100;
}
.network-old {
  background-color: #525200;
}
.network-older {
  background-color: #502b00;
}
.network-gradient {
  background-image: linear-gradient(to right, #114100 0%, #525200 100%);
}

/* Overlay box with spinners as shown during data collection for graphs */
.card .overlay {
  z-index: 50;
  background-color: rgba(53, 60, 66, 0.733);
  border-radius: 3px;
}
.card .overlay > .fa,
.navbar-nav > .user-menu > .dropdown-menu > .user-body a {
  color: var(--theme-text) !important;
}

.modal-content {
  background: #272c30;
}
.modal-header {
  border-bottom-color: var(--theme-bg);
}
.modal-footer {
  border-top-color: var(--theme-bg);
}

.close {
  color: #fff;
  text-shadow: 0 1px 0 #000;
}
.close:focus,
.close:hover {
  color: #fff;
}

.login-page {
  background-image: linear-gradient(#0006, #0006), url("../../img/boxed-bg-dark.png");
}

/*** Fix login input visual misalignment ***/
#loginform,
#loginform input {
  color: rgb(120, 127, 133);
}

/* Group assignment select */
.open > .dropdown-toggle.btn-default,
.open > .dropdown-toggle.btn-default:active {
  background-color: var(--theme-bg);
  color: var(--theme-text);
  border: 1px solid #3d444b;
}
.open > .dropdown-toggle.btn-default:hover {
  color: #fff;
}
