/* ==========================================================================
   Global: disable transitions (anti-flicker on theme switch)
   ========================================================================== */
.btn,
.nav-pills .nav-link,
.navbar .nav-link,
.navbar .dropdown-toggle,
.nav-item .nav-link,
.dropdown-menu,
.dropdown-item,
.form-control,
.form-select {
  transition: none !important;
}

/* ==========================================================================
   Global: shared rules (same in dark & light)
   ========================================================================== */

#themeDropdown:focus,
#themeDropdown:focus-visible,
.nav-item a:focus,
.nav-item a:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.navbar {
  --bs-navbar-toggler-focus-width: none;
}

.btn-close {
  --bs-btn-close-focus-shadow: none;
}

/* ==========================================================================
   Theme: dropdown (toggle + menu)
   ========================================================================== */

/* --- Dark --- */
html[data-bs-theme="dark"] #themeDropdown {
  color: #fff !important;
}

html[data-bs-theme="dark"] #themeDropdown + .dropdown-menu {
  background-color: #0a0a0a !important;
  border-color: #303030 !important;
}

html[data-bs-theme="dark"] #themeDropdown + .dropdown-menu .dropdown-item {
  color: #fff !important;
}

html[data-bs-theme="dark"] #themeDropdown + .dropdown-menu .dropdown-item:hover,
html[data-bs-theme="dark"] #themeDropdown + .dropdown-menu .dropdown-item:focus,
html[data-bs-theme="dark"] #themeDropdown + .dropdown-menu .dropdown-item.active {
  background-color: #0a0a0a !important;    
}

html[data-bs-theme="dark"] #themeDropdown + .dropdown-menu .dropdown-item[aria-pressed="true"] {
  background-color: #191919 !important;
  color: #fff !important;
}

/* --- Light --- */
html[data-bs-theme="light"] #themeDropdown {
  color: #0a0a0a !important;
}

html[data-bs-theme="light"] #themeDropdown + .dropdown-menu {
  background-color: #fff !important;
  border-color: #bbb !important;
}

html[data-bs-theme="light"] #themeDropdown + .dropdown-menu .dropdown-item {
  color: #0a0a0a !important;
}

html[data-bs-theme="light"] #themeDropdown + .dropdown-menu .dropdown-item:hover,
html[data-bs-theme="light"] #themeDropdown + .dropdown-menu .dropdown-item:focus,
html[data-bs-theme="light"] #themeDropdown + .dropdown-menu .dropdown-item.active {
  background-color: #fff !important;    
}

html[data-bs-theme="light"] #themeDropdown + .dropdown-menu .dropdown-item[aria-pressed="true"] {
  background-color: #f4f4f4 !important;
  color: #0a0a0a !important;
}

/* ==========================================================================
   Theme: base text & background
   ========================================================================== */

/* --- Dark --- */
html[data-bs-theme="dark"] body {
  color: #fff !important;
}

html[data-bs-theme="dark"] html,
html[data-bs-theme="dark"] body,
html[data-bs-theme="dark"] .navbar,
html[data-bs-theme="dark"] .modal-content {
  background-color: #0a0a0a !important;
}

/* --- Light --- */
html[data-bs-theme="light"] body {
  color: #0a0a0a !important;
}

html[data-bs-theme="light"] html,
html[data-bs-theme="light"] body,
html[data-bs-theme="light"] .navbar {
  background-color: #fff !important;
}

/* ==========================================================================
   Theme: typography helpers
   ========================================================================== */

/* --- Dark --- */
html[data-bs-theme="dark"] h5.modal-title,
html[data-bs-theme="dark"] .form-label {
  color: #fff;
}

html[data-bs-theme="dark"] .dark-gray {
  color: #696969;
}

html[data-bs-theme="dark"] .light-gray {
  color: #909090;
}

/* --- Light --- */
html[data-bs-theme="light"] h5.modal-title,
html[data-bs-theme="light"] .form-label {
  color: #0a0a0a;
}

html[data-bs-theme="light"] .dark-gray {
  color: #afafaf !important;
}

html[data-bs-theme="light"] .light-gray {
  color: #d6d6d6 !important;
}

/* ==========================================================================
   Theme: links
   ========================================================================== */

/* --- Dark --- */
html[data-bs-theme="dark"] a {
  color: #fff !important;
  text-decoration: none !important;
}

/* --- Light --- */
html[data-bs-theme="light"] a {
  color: #0a0a0a !important;
  text-decoration: none !important;
}

/* ==========================================================================
   Theme: buttons
   ========================================================================== */

/* --- Dark --- */
html[data-bs-theme="dark"] .btn-primary {
  background-color: #191919 !important;
  border-color: #303030 !important;
  color: #fff !important;
}

html[data-bs-theme="dark"] .btn-primary:focus,
html[data-bs-theme="dark"] .btn-primary.focus,
html[data-bs-theme="dark"] .nav-pills .nav-link:focus {
  box-shadow: none !important;
}

/* --- Light --- */
html[data-bs-theme="light"] .btn-primary {
  background-color: #f4f4f4 !important;
  border-color: #bbb !important;
  color: #0a0a0a !important;
}

html[data-bs-theme="light"] .btn-primary:focus,
html[data-bs-theme="light"] .btn-primary.focus,
html[data-bs-theme="light"] .nav-pills .nav-link:focus {
  box-shadow: none !important;
}

/* ==========================================================================
   Theme: nav pills
   ========================================================================== */

/* --- Dark --- */
html[data-bs-theme="dark"] .nav-pills .nav-link {
  color: #fff;
  background-color: transparent;
  border: 1px solid #0a0a0a !important;
}

html[data-bs-theme="dark"] .nav-pills .nav-link.active,
html[data-bs-theme="dark"] .nav-pills .show > .nav-link {
  background-color: #191919 !important;
  border: 1px solid #303030 !important;
  color: #fff !important;
  opacity: 1 !important;
}

html[data-bs-theme="dark"] .nav-pills .nav-link.active:hover {
  opacity: 1 !important;
  background-color: #191919 !important;
}

/* --- Light --- */
html[data-bs-theme="light"] .nav-pills .nav-link {
  color: #0a0a0a;
  background-color: transparent;
  border: 1px solid #fff !important;
}

html[data-bs-theme="light"] .nav-pills .nav-link.active,
html[data-bs-theme="light"] .nav-pills .show > .nav-link {
  background-color: #f4f4f4 !important;
  border: 1px solid #bbb !important;
  color: #0a0a0a !important;
  opacity: 1 !important;
}

html[data-bs-theme="light"] .nav-pills .nav-link.active:hover {
  opacity: 1 !important;
  background-color: #f4f4f4 !important;
}

/* ==========================================================================
   Theme: forms
   ========================================================================== */

/* --- Dark --- */
html[data-bs-theme="dark"] .form-select {
  color: #909090 !important;
  background-color: #0a0a0a !important;
  border-color: #303030 !important;
}

html[data-bs-theme="dark"] .form-control {
  border-color: #303030 !important;
  background-color: #0a0a0a !important;
}

html[data-bs-theme="dark"] .form-control:focus,
html[data-bs-theme="dark"] .form-select:focus {
  color: #fff !important;
  border-color: #fff !important;
  box-shadow: none !important;
}

html[data-bs-theme="dark"] .form-control::placeholder {
  color: #696969 !important;
}

/* --- Light --- */
html[data-bs-theme="light"] .form-select {
  color: #696969 !important;
  background-color: #fff !important;
  border-color: #bbb !important;
}

html[data-bs-theme="light"] .form-control {
  color: #0a0a0a !important;
  border-color: #bbb !important;
  background-color: #fff !important;
}

html[data-bs-theme="light"] .form-control:focus,
html[data-bs-theme="light"] .form-select:focus {
  color: #0a0a0a !important;
  border-color: #0a0a0a !important;
  box-shadow: none !important;
}

html[data-bs-theme="light"] .form-control::placeholder {
  color: #909090 !important;
}

/* ==========================================================================
   Theme: selection
   ========================================================================== */

/* --- Dark --- */
html[data-bs-theme="dark"] ::selection {
  background: #82898f;
  color: #fff;
}

html[data-bs-theme="dark"] ::-moz-selection {
  background: #82898f;
  color: #fff;
}

/* --- Light --- */
html[data-bs-theme="light"] ::selection {
  background: #cfcfcf;
  color: #0a0a0a;
}

html[data-bs-theme="light"] ::-moz-selection {
  background: #cfcfcf;
  color: #0a0a0a;
}

/* ==========================================================================
   Theme: borders / cards
   ========================================================================== */

/* --- Dark --- */
html[data-bs-theme="dark"] .border-secondary,
html[data-bs-theme="dark"] .card,
html[data-bs-theme="dark"] .card-header,
html[data-bs-theme="dark"] .card-footer {
  border-color: #303030 !important;
}

/* --- Light --- */
html[data-bs-theme="light"] .border-secondary,
html[data-bs-theme="light"] .card,
html[data-bs-theme="light"] .card-header,
html[data-bs-theme="light"] .card-footer {
  border-color: #bbb !important;
}

/* ==========================================================================
   Theme: modal
   ========================================================================== */

/* --- Dark --- */
html[data-bs-theme="dark"] .btn-close {
  color: #bbb !important;
}

html[data-bs-theme="dark"] .modal-content {
  border: 1px solid #303030;
}

/* --- Light --- */
html[data-bs-theme="light"] .btn-close {
  color: #303030 !important;
}

html[data-bs-theme="light"] .modal-content {
  background-color: #fff !important;
  border: 1px solid #bbb !important;
}

/* ==========================================================================
   Theme: navbar text/icon overrides
   ========================================================================== */

/* --- Light --- */
html[data-bs-theme="light"] .navbar a,
html[data-bs-theme="light"] .navbar .nav-link,
html[data-bs-theme="light"] .navbar .navbar-brand,
html[data-bs-theme="light"] .navbar i {
  color: #0a0a0a !important;
}

html[data-bs-theme="light"] .navbar .light-gray {
  color: #a7a7a7 !important;
}

/* ==========================================================================
   Theme: tooltip
   ========================================================================== */

/* --- Dark --- */
html[data-bs-theme="light"] .tooltip {
  --bs-tooltip-bg: #0a0a0a;
  --bs-tooltip-color: #fff;
}

/* --- Light --- */
html[data-bs-theme="dark"] .tooltip {
  --bs-tooltip-bg: #fff;
  --bs-tooltip-color: #0a0a0a;
}

/* ==========================================================================
   Theme: charts
   ========================================================================== */

/* --- Dark --- */
html[data-bs-theme="dark"] .diamond {
  background-color: #fff;
}

html[data-bs-theme="dark"] .reconciler,
html[data-bs-theme="dark"] .houseChart {
  border: 1px solid #303030;
}

html[data-bs-theme="dark"] .shieldChart .col,
html[data-bs-theme="dark"] .houseChart .col {
  border-left: 1px solid #303030;
  border-top: 1px solid #303030;
}

html[data-bs-theme="dark"] .shieldChart .col:last-child,
html[data-bs-theme="dark"] .houseChart .col:last-child {
  border-right: 1px solid #303030;
}

html[data-bs-theme="dark"] .shieldChart .row:last-child .col,
html[data-bs-theme="dark"] .houseChart .row:last-child .col {
  border-bottom: 1px solid #303030;
}

html[data-bs-theme="dark"] .dots {
  border-bottom: 1px solid #282828;
}

/* --- Light --- */
html[data-bs-theme="light"] .diamond {
  background-color: #0a0a0a;
}

html[data-bs-theme="light"] .reconciler,
html[data-bs-theme="light"] .houseChart {
  border: 1px solid #bbb !important;
}

html[data-bs-theme="light"] .shieldChart .col,
html[data-bs-theme="light"] .houseChart .col {
  border-left: 1px solid #bbb !important;
  border-top: 1px solid #bbb !important;
}

html[data-bs-theme="light"] .shieldChart .col:last-child,
html[data-bs-theme="light"] .houseChart .col:last-child {
  border-right: 1px solid #bbb !important;
}

html[data-bs-theme="light"] .shieldChart .row:last-child .col,
html[data-bs-theme="light"] .houseChart .row:last-child .col {
  border-bottom: 1px solid #bbb !important;
}

html[data-bs-theme="light"] .dots {
  border-bottom: 1px solid #e1e1e1 !important;
}

/* ==========================================================================
   Theme: vertical rule
   ========================================================================== */

/* --- Dark --- */
html[data-bs-theme="dark"] .vr {
  background-color: #303030 !important;
  opacity: 1 !important;
}

/* --- Light --- */
html[data-bs-theme="light"] .vr {
  background-color: #bbb !important;
  opacity: 1 !important;
}

/* ==========================================================================
   Theme: selected figures
   ========================================================================== */

/* --- Dark --- */
html[data-bs-theme="dark"] .querent-significator .diamond {
  background-color: #1dacd6 !important;
}

html[data-bs-theme="dark"] .querent {
  color: #1dacd6;
}

html[data-bs-theme="dark"] .quesited-significator .diamond {
  background-color: #ff8800 !important;
}

html[data-bs-theme="dark"] .quesited {
  color: #ff8800;
}

/* --- Light --- */
html[data-bs-theme="light"] .querent-significator .diamond {
  background-color: #007fff !important;
}

html[data-bs-theme="light"] .querent {
  color: #007fff;
}

html[data-bs-theme="light"] .quesited-significator .diamond {
  background-color: #ff7e00 !important;
}

html[data-bs-theme="light"] .quesited {
  color: #ff7e00;
}

/* ==========================================================================
   Theme: perfections
   ========================================================================== */

/* --- Dark --- */
html[data-bs-theme="dark"] .denial {
  color: #cb2821;
}

/* --- light --- */
html[data-bs-theme="light"] .denial {
  color: #ff2400;
}