body {
  min-height: 100vh;
  /* Adds a translucent logo watermark over the page content.
    It's non-interactive so it doesn't interfere with clicks. */
}
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("../../assets/img/icon.png") no-repeat center;
  background-size: 66vmin;
  opacity: 0.05;
  pointer-events: none;
}
@media all and (max-width: 600px) {
  body::before {
    background-size: 75vmin;
  }
}

footer {
  font-size: 0.75rem;
}

.logo {
  max-width: 100px;
  height: auto;
  width: 90%;
}

header .logo {
  max-width: 250px; /* Adjust this initial max-width as per your current logo size */
  height: auto;
  display: block;
  margin: 1rem auto 1rem auto;
  padding: 0 1rem;
  width: 100%;
}

/* Styles the container for API results, ensuring it's readable and preserves formatting like newlines. */
#result-container {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  padding: 1rem;
  min-height: 150px;
  white-space: pre-wrap;
  position: relative;
  /* Styles the placeholder text shown when the result container is empty. */
}
#result-container.is-placeholder::before {
  content: "Hi, I'm Catalyst, your executive function assistant.\aWhenever you're ready, select a tool above, and we'll dive in!";
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  color: var(--bs-secondary-color);
  font-style: italic;
  width: 90%;
  text-align: center;
}

/* Custom Bootstrap Component Overrides */
.btn-danger {
  --bs-btn-color: #fff;
  --bs-btn-bg: #c82333;
  --bs-btn-border-color: #c82333;
  --bs-btn-hover-bg: #9d1b28;
  --bs-btn-hover-border-color: #941a26;
  --bs-btn-active-bg: #871822;
  --bs-btn-active-border-color: #7e1620;
  --bs-btn-focus-shadow-rgb: 200, 35, 51;
}

.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--bs-primary);
  -webkit-box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
          box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Animated Navbar Toggler */
.navbar-toggler {
  border: none;
  background: transparent !important;
}
.navbar-toggler:focus {
  -webkit-box-shadow: none;
          box-shadow: none;
}
.navbar-toggler .toggler-icon {
  width: 25px;
  height: 2px;
  background-color: var(--bs-primary);
  display: block;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
  position: relative;
}
.navbar-toggler .toggler-icon + .toggler-icon {
  margin-top: 5px;
}
.navbar-toggler[aria-expanded=true] .top-bar {
  -webkit-transform: rotate(45deg);
          transform: rotate(45deg);
  top: 7px;
}
.navbar-toggler[aria-expanded=true] .middle-bar {
  opacity: 0;
}
.navbar-toggler[aria-expanded=true] .bottom-bar {
  -webkit-transform: rotate(-45deg);
          transform: rotate(-45deg);
  top: -7px;
}

/* Positions the copy button at the top-right corner of its parent container. */
.copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 10;
}

/* A floating action button to scroll to the bottom of the page, hidden by default. */
.scroll-to-bottom-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  width: 50px;
  height: 50px;
  opacity: 0;
  visibility: hidden;
  -webkit-transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}
.scroll-to-bottom-btn.show {
  opacity: 1;
  visibility: visible;
}

/* Theme-specific overrides */
[data-bs-theme=dark] {
  --bs-secondary-color: #b9c1c8;
  --bs-secondary-rgb: 185, 193, 200;
  --bs-primary: #e9bf96;
  --bs-primary-rgb: 233, 191, 150;
  --bs-link-color: #e9bf96;
  --bs-link-color-rgb: 233, 191, 150;
  --bs-link-hover-color: #f6e6d5;
  --bs-link-hover-color-rgb: 246, 230, 213;
}
[data-bs-theme=dark] body::before {
  -webkit-filter: invert(100%);
          filter: invert(100%);
}
[data-bs-theme=dark] .logo {
  -webkit-filter: invert(100%);
          filter: invert(100%);
}
[data-bs-theme=dark] #result-container {
  background-color: #2b3035;
  border-color: #495057;
}
[data-bs-theme=dark] .form-switch .form-check-input:checked {
  background-color: #e9bf96;
  border-color: #e9bf96;
}
[data-bs-theme=dark] .form-switch .form-check-input:focus:not(:checked) {
  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='%23e9bf96'/%3e%3c/svg%3e");
}
[data-bs-theme=dark] .navbar .form-switch .form-check-label {
  color: #e9bf96;
}
[data-bs-theme=dark] .btn-primary {
  --bs-btn-bg: #e9bf96;
  --bs-btn-border-color: #e9bf96;
  --bs-btn-color: #212529;
  --bs-btn-hover-color: #212529;
  --bs-btn-active-color: #212529;
  --bs-btn-hover-bg: #e0a56c;
  --bs-btn-hover-border-color: #dea063;
  --bs-btn-active-bg: #dc9857;
  --bs-btn-active-border-color: #da934e;
  --bs-btn-focus-shadow-rgb: 233, 191, 150;
}
[data-bs-theme=dark] .accordion {
  --bs-accordion-button-active-bg: #e9bf96;
  --bs-accordion-button-active-color: #212529;
  --bs-accordion-icon-active-color: #212529;
}
[data-bs-theme=dark] .btn-primary:disabled, [data-bs-theme=dark] .btn-primary.disabled {
  background-color: #e9bf96;
  border-color: #e9bf96;
  color: #212529;
}
[data-bs-theme=dark] .btn-outline-secondary:disabled, [data-bs-theme=dark] .btn-outline-secondary.disabled {
  color: #b9c1c8;
  border-color: #b9c1c8;
  background-color: transparent;
}

[data-bs-theme=light] {
  --bs-secondary-color: #5a646c;
  --bs-secondary-rgb: 90, 100, 108;
  --bs-primary: #193b69;
  --bs-primary-rgb: 25, 59, 105;
  --bs-link-color: #193b69;
  --bs-link-color-rgb: 25, 59, 105;
  --bs-link-hover-color: #0a182b;
  --bs-link-hover-color-rgb: 10, 24, 43;
}
[data-bs-theme=light] .navbar {
  --bs-bg-opacity: 1;
  background-color: rgba(var(--bs-light-rgb), var(--bs-bg-opacity)) !important;
}
[data-bs-theme=light] .form-switch .form-check-input:checked {
  background-color: #193b69;
  border-color: #193b69;
}
[data-bs-theme=light] .form-switch .form-check-input:focus:not(:checked) {
  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='%23{str-slice($primary-light, 2)}'/%3e%3c/svg%3e");
}
[data-bs-theme=light] .navbar .form-switch .form-check-label {
  color: #193b69;
}
[data-bs-theme=light] .btn-primary {
  --bs-btn-bg: #193b69;
  --bs-btn-border-color: #193b69;
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
  --bs-btn-hover-bg: #0f2440;
  --bs-btn-hover-border-color: #0d1f38;
  --bs-btn-active-bg: #0a182b;
  --bs-btn-active-border-color: #081423;
  --bs-btn-focus-shadow-rgb: 25, 59, 105;
}
[data-bs-theme=light] .accordion {
  --bs-accordion-button-active-bg: #193b69;
  --bs-accordion-button-active-color: #fff;
  --bs-accordion-icon-active-color: #fff;
}
[data-bs-theme=light] .btn-primary:disabled, [data-bs-theme=light] .btn-primary.disabled {
  background-color: #193b69;
  border-color: #193b69;
  color: #fff;
}
[data-bs-theme=light] .btn-outline-secondary:disabled, [data-bs-theme=light] .btn-outline-secondary.disabled {
  color: #5a646c;
  border-color: #5a646c;
  background-color: transparent;
}