:focus {
  outline: none !important;
  box-shadow: none !important;
  border-color: none !important;
}

:active {
  outline: none;
  box-shadow: none;
}

* {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: "Lato", sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-secondary) var(--bg-secondary);
}

html {
  scroll-behavior: smooth;
  transition: 0.5s;
}

@supports selector(::-webkit-scrollbar) {

  html,
  body,
  * {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }

  ::-webkit-scrollbar {
    width: .5rem;
    height: .5rem;
  }

  ::-webkit-scrollbar-track {
    background-color: var(--bg-secondary);
  }

  ::-webkit-scrollbar-thumb {
    background-color: var(--bg-secondary);
    border: 2px solid var(--bs-border-color);
    border-radius: 999px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background-color: var(--bg);
  }
}

@media screen and (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

html,
body {
  font-variant-ligatures: none;
  font-feature-settings:
    "liga" 0,
    "clig" 0;
}

/* Utility classes */
.h-max {
  height: max-content;
}

/* Material Symbol */
.material-symbols-rounded {
  --icon-fill: 0;
  --icon-weight: 200;
  --icon-grade: -25;
  --icon-optical-size: 24;
  font-family:
    "Material Symbols Sharp",
    "Material Symbols Rounded";
  font-variation-settings:
    "FILL" var(--icon-fill),
    "wght" var(--icon-weight),
    "GRAD" var(--icon-grade),
    "opsz" var(--icon-optical-size);
  vertical-align: middle;
  line-height: 1;
  position: relative;
  top: -2px;
}

button .material-symbols-rounded {
  top: 0;
}

.btn span.material-symbols-rounded {
  top: 0;
  font-size: 1.5rem;
}

/* Spinner icon */
.spinner-icon {
  display: inline-block;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Toast alert */
.toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast,
.alert {
  border-radius: var(--bs-border-radius);
}

.toast.has-timer,
.alert.has-timer {
  --toast-time: 5000ms;
  position: relative;
  overflow: hidden;
  min-width: 280px;
  pointer-events: auto;
}

/* Bottom timer bar */
.toast.has-timer::after,
.alert.has-timer::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 100%;
  background-color: currentColor;
  opacity: 0.35;
  transform: scaleX(0);
  transform-origin: left;
  animation: toast-timer var(--toast-time) linear forwards;
}

.toast.has-timer.paused::after {
  animation-play-state: paused;
}

/* Status color tuning */
.toast.bg-success.has-timer::after,
.alert-success.has-timer::after {
  background-color: #198754;
}

.toast.bg-danger.has-timer::after,
.alert-danger.has-timer::after {
  background-color: #dc3545;
}

.toast.bg-warning.has-timer::after,
.alert-warning.has-timer::after {
  background-color: #ffc107;
}

.toast.bg-info.has-timer::after,
.alert-info.has-timer::after {
  background-color: #0dcaf0;
}

/* Animation */
@keyframes toast-timer {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.has-timer::after {
  animation-play-state: running;
}

.has-timer.paused::after {
  animation-play-state: paused;
}

/* Dropdown */
.dropdown-menu {
  --bs-dropdown-spacer: .125rem;
  --bs-dropdown-divider-margin-y: .5rem;
  background-color: var(--bg-secondary);
  border-radius: var(--bs-dropdown-border-radius);
  box-shadow: 0 .5rem 1rem rgb(var(--theme-secondary-hard-rgb) / 0.1);
  min-width: 10rem;
  margin: .3rem 0 0 !important;
  padding: 0;
}

.dropdown-menu li a.dropdown-item {
  padding: .45rem 1rem;
}

.dropdown-menu li:first-child a.dropdown-item {
  border-top-left-radius: var(--bs-border-radius);
  border-top-right-radius: var(--bs-border-radius);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.dropdown-menu li:last-child a.dropdown-item {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: var(--bs-border-radius);
  border-bottom-right-radius: var(--bs-border-radius);
}

.dropdown-menu li a.dropdown-item:disabled {
  background-color: transparent;
}

.list-group {
  --bs-list-group-bg: transparent;
}

/* Accordion */
.accordion {
  --bs-accordion-bg: var(--bs-border-color);
}

.accordion-button:focus {
  box-shadow: none;
}

.accordion-button:not(.collapsed) {
  box-shadow: none;
}

/* Accordion Default */
.accordion .accordion-item:nth-child(even) {
  background-color: var(--bg-secondary);
  border: 1px solid var(--bs-border-color);
}

.accordion .accordion-item .accordion-header {
  background-color: transparent;
}

.accordion .accordion-item .accordion-header button {
  font-weight: bold;
  background-color: transparent;
}

/* Image */
.img-thumbnail {
  padding: 0rem;
}

/* Forms */
.form-control,
.form-check-input,
.form-select {
  color: var(--text);
  background-color: var(--bg);
  border-radius: var(--bs-border-radius);
}

.form-control:focus,
.form-select:focus {
  color: var(--text);
  background-color: var(--bg);
  border: 1px solid var(--accent-dark);
  box-shadow: none !important;
}

.form-control:disabled,
.form-check-input:disabled,
.form-select:disabled {
  box-shadow: none !important;
}

.form-switch .form-check-input {
  width: 2em;
  margin-left: -2.5em;
  background-color: var(--bg, #fff);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28108, 117, 125, 1%29'/%3e%3c/svg%3e");
  background-position: left center;
  border: 1px solid var(--bs-border-color, #6c757d);
  border-radius: 2em;
  transition: background-position .15s ease-in-out;
}

.form-switch .form-check-input:checked {
  background-color: var(--primary, var(--bs-primary));
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
  background-position: right center;
  border-color: var(--primary, var(--bs-primary));
}

.form-check-input:focus {
  border-color: var(--primary, var(--bs-primary)) !important;
  box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--primary, var(--bs-primary)) 22%, transparent) !important;
}

.form-check-input:disabled {
  background-color: var(--bs-secondary-color, #6c757d);
  border-color: var(--bs-secondary-color, #6c757d);
  cursor: not-allowed;
  opacity: 1;
}

.form-check-input:checked:disabled {
  background-color: #6c757d;
  border-color: #6c757d;
}

.input-group-text {
  color: var(--text);
  background: rgb(var(--theme-secondary-hard-rgb) / .05);
  border-radius: var(--bs-border-radius);
}

/* Password toggle */
.password-toggle button .material-symbols-rounded {
  font-size: 1.25rem;
  line-height: 1;
  vertical-align: middle;
}

/* Badge */
a.badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.25rem;
  text-decoration: none;
}

.badge {
  border-radius: var(--bs-border-radius);
}

/* App Mode Banner */
.app-mode-banner {
  width: 100%;
  text-align: center;
  padding: 0.5rem 0;
  color: rgb(var(--theme-secondary-rgb));
  background-color: rgb(var(--theme-primary-rgb));
}