/* Global overrides: single font stack, no rounding, no shadows, grey 1px borders only */

@import url('https://fonts.googleapis.com/css2?family=Lexend+Tera:wght@400;700&display=swap');

:root {
  --bs-font-stack: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --bs-border-grey: 1px solid #ccc;
}

* {
  border-radius: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* Apply system font - exclude icons, pre/code (Monaco), and Metapsy logo (Lexend Tera) */
*:not(.fa):not([class*="fa-"]):not(.fab):not(.fas):not(.far):not(.bi):not([class^="bi-"]):not(pre):not(code):not(.metapsy-logo) {
  font-family: var(--bs-font-stack) !important;
}

/* Restore icon fonts (Font Awesome and Bootstrap Icons) */
.fa, .fab, .fas, .far, .fa-solid, .fa-regular, .fa-brands,
[class*="fa-"] {
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
}
.fab, .fa-brands, [class*="fa-brands"] {
  font-family: "Font Awesome 6 Brands", "Font Awesome 5 Brands" !important;
}
.bi, [class^="bi-"] {
  font-family: "bootstrap-icons" !important;
}

/* Metapsy logo keeps original font (Lexend Tera) */
.metapsy-logo {
  font-family: "Lexend Tera", sans-serif !important;
}

/* Monaco in pre blocks and for code - higher specificity so it wins over *:not() */
body.bg-dark pre,
body.bg-dark pre *,
body.bg-dark pre code,
body.bg-dark code,
code {
  font-family: Monaco, "Courier New", Consolas, monospace !important;
}

/* Restore borders where shadow was used for separation */
.add-shadow,
.feature-box,
.nav-shadow,
.shadow,
.shadow-sm,
.shadow-lg {
  box-shadow: none !important;
  border: var(--bs-border-grey) !important;
}

.shadow-none {
  border: none !important;
}

/* Shiny checkbox – no top/bottom padding */
.shiny-input-container .checkbox,
.shiny-input-checkbox.shiny-bound-input.shinyjs-resettable,
.shiny-input-checkbox,
.form-group.shiny-input-container:has(input[type="checkbox"]) {
  padding-top: 0;
  padding-bottom: 0;
}

/* Slightly bigger checkbox, square, grey border – target raw input so it always applies */
body input[type="checkbox"],
body .form-check-input[type="checkbox"],
.shiny-input-container input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 1.05em !important;
  height: 1.05em !important;
  min-width: 1.05em !important;
  min-height: 1.05em !important;
  margin-top: 0.15em;
  border-radius: 0 !important;
  border: 1px solid #ccc !important;
  box-shadow: none !important;
  background-color: #fff;
  flex-shrink: 0;
  cursor: pointer;
}

body input[type="checkbox"]:focus,
body .form-check-input[type="checkbox"]:focus,
.shiny-input-container input[type="checkbox"]:focus {
  border-color: #0372b7 !important;
  outline: 1px solid #0372b7;
  outline-offset: 1px;
  box-shadow: none !important;
}

body input[type="checkbox"]:checked,
body .form-check-input[type="checkbox"]:checked,
.shiny-input-container input[type="checkbox"]:checked {
  background-color: #0372b7;
  border-color: #0372b7 !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

.shiny-input-container .checkbox label,
.shiny-input-container label:has(input[type="checkbox"]) {
  cursor: pointer;
  margin-left: 0.25em;
}

/* Shiny radio buttons – same look as checkboxes but round, grey border, no shadow */
.shiny-input-container .radio,
.shiny-input-radiogroup.shiny-bound-input.shinyjs-resettable,
.form-group.shiny-input-container:has(input[type="radio"]) {
  padding-top: 0;
  padding-bottom: 0;
}

body input[type="radio"],
body .form-check-input[type="radio"],
.shiny-input-container input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 0.8em !important;
  height: 0.8em !important;
  min-width: 0.8em !important;
  min-height: 0.8em !important;
  margin-top: 0.15em;
  border-radius: 50% !important;
  border: 1px solid #ccc !important;
  box-shadow: none !important;
  background-color: #fff;
  flex-shrink: 0;
  cursor: pointer;
}

body input[type="radio"]:focus,
body .form-check-input[type="radio"]:focus,
.shiny-input-container input[type="radio"]:focus {
  border-color: #0372b7 !important;
  outline: 1px solid #0372b7;
  outline-offset: 1px;
  box-shadow: none !important;
}

body input[type="radio"]:checked,
body .form-check-input[type="radio"]:checked,
.shiny-input-container input[type="radio"]:checked {
  background-color: #0372b7;
  border-color: #0372b7 !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
}

.shiny-input-container .radio label,
.shiny-input-container label:has(input[type="radio"]) {
  cursor: pointer;
  margin-left: 0.25em;
}

/* Shiny notifications and loading in top right */
.shiny-notification {
  position: fixed !important;
  top: 15px !important;
  right: 15px !important;
  left: auto !important;
  width: 350px;
  z-index: 99999 !important;
}

/* Waiter / loading spinner in top right */
.atebits-loader,
.waiter-overlay-content,
div[id^="waiter-overlay"] > div {
  position: fixed !important;
  top: 15px !important;
  right: 15px !important;
  left: auto !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 99998 !important;
}

/* Shiny progress bar (loading bar) in top right */
.shiny-progress {
  position: fixed !important;
  top: 15px !important;
  right: 15px !important;
  left: auto !important;
  z-index: 99997 !important;
}
