:root {
  --header-height: 4rem;
  --footer-height: 4rem;
}
#chat-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 800px;
  margin: 0 auto;
  padding-top: calc(var(--header-height) + 1rem);
  padding-bottom: calc(var(--footer-height) + 1rem);

  max-height: calc(100vh);
  height: calc(100vh);
}

#messages {
  flex: 1;
  flex-shrink: 3;
  overflow-y: auto;
  /*background-color: var(--bg-light-subtle);*/
  min-height: 200px;
  /*border: var(--messages-border-width) solid var(--messages-border-color);*/
  margin-bottom: 20px;

  display: flex;
  flex-direction: column;
}

#input-container {
}

#user-input:disabled {
  cursor: not-allowed;
}

.message {
  max-width: 70%;
  position: relative;
  padding: 0.8rem;
  margin: 0.5rem;
  border-radius: 10px;
  word-wrap: break-word;
}

.message > p:last-child {
  margin-bottom: 0;
}

.assistant {
  background-color: #e9e8eb;
  place-self: start;
  border-bottom-left-radius: 2px;
}

.user {
  background: linear-gradient(rgba(0, 150, 130, 0.5), rgba(0, 150, 130, 0.8));
  place-self: end;
  border-bottom-right-radius: 2px;
}
.system {
  background-color: var(--bs-warning-bg-subtle);
  color: var(--bs-warning-text-emphasis);
  border-color: var(--bs-warning-border-subtle);
  border: 1px solid;
  font-style: italic;
  text-align: center;
  margin: 10px auto;
}

#action-buttons-row {
  float: right;
  padding-top: 0.1rem;
}

#feedback-notice {
  padding-top: 0.5rem;
}

#send-button.danger {
  color: red;
  background-color: #f8d7da;
  border: 0;
}

#send-button:not(:disabled):not(.danger) {
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.5);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
  }
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.5);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 255, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 0, 0);
  }
}

#audio-input {
  position: relative;
}

#navbar {
  max-height: var(--header-height);
}

#navbar-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.navbar-brand {
}

#navbar-before,
#navbar-buttons {
  flex-grow: 1;
  flex-basis: 0;
  display: flex;
  justify-content: flex-end; /* Push buttons to the right */
  align-items: center; /* Vertically center the buttons */
}

#navbar-buttons button {
  margin-top: auto;
  margin-bottom: auto;
  float: right;
  margin-right: 1rem;
}

#navbar-before button {
  float: left;
  margin-left: 1rem;
}

/* Definition of "thinking" animation  */
.thinkingAnimation {
  width: 0.8rem;
  aspect-ratio: 1;
  border-radius: 50%;
  animation: movingDots 1s infinite linear alternate;
  margin-left: 0.7rem;
  margin-right: 0.7rem;
  --dot-grey: #6a6a6a;
}

@keyframes movingDots {
  0% {
    box-shadow: 20px 0 var(--dot-grey), -20px 0 #0002;
    background: var(--dot-grey);
  }
  33% {
    box-shadow: 20px 0 var(--dot-grey), -20px 0 #0002;
    background: #0002;
  }
  66% {
    box-shadow: 20px 0 #0002, -20px 0 var(--dot-grey);
    background: #0002;
  }
  100% {
    box-shadow: 20px 0 #0002, -20px 0 var(--dot-grey);
    background: var(--dot-grey);
  }
}

/* Light Theme Colors */
[data-bs-theme="dark"] {
  .assistant {
    background-color: var(--bg-color-dark);
    place-self: start;
  }
}

/* Logo Light/Dark Switch */
[data-bs-theme="dark"] #lightlogo {
  display: none !important;
}

[data-bs-theme="dark"] #darklogo {
  display: inline-block !important;
}

[data-bs-theme="dark"] .darkelem {
  display: block !important;
}

[data-bs-theme="dark"] .lightelem {
  display: none !important;
}

[data-bs-theme="light"] .darkelem {
  display: none !important;
}

[data-bs-theme="light"] .lightelem {
  display: block !important;
}

/* Kit Button theming */
.btn-primary {
  --bs-btn-color: #ffffff;
  --bs-btn-bg: rgb(0, 120, 100);
  --bs-btn-border-color: rgb(0 120 100);
  --bs-btn-hover-color: #ccc;
  --bs-btn-hover-bg: rgb(0 150 130);
  --bs-btn-hover-border-color: rgb(0 60 50);
  --bs-btn-focus-shadow-rgb: 49, 132, 253;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: rgb(0 60 50);
  --bs-btn-active-border-color: rgb(0 60 50);
  --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  --bs-btn-disabled-color: #dff;
  --bs-btn-disabled-bg: rgb(0 60 50);
  --bs-btn-disabled-border-color: rgb(0 60 50);
}
.btn-outline-primary {
  --bs-btn-color: rgb(0, 120, 100);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: rgb(0 120 100);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: rgb(0 120 100);
  --bs-btn-hover-border-color: rgb(0 120 100);
  --bs-btn-focus-shadow-rgb: 49, 132, 253;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: rgb(0 120 100);
  --bs-btn-active-border-color: rgb(0 120 100);
  --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  --bs-btn-disabled-color: #dff;
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: rgb(0 120 100);
}

/* Force circle buttons to be actually a circle */
.btn.rounded-circle {
  width: 2.625rem;
  height: 2.625rem;
}

a {
  --bs-link-color-rgb: 0, 120, 100;
  --bs-link-hover-color-rgb: 0, 100, 80;
}

.footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: var(--footer-height);
  line-height: var(--footer-height); /* Vertically center the text there */
  z-index: 1000; /* Place it on top */
}

#bibki_icon_link {
  margin-right: 1rem;
  text-decoration: none;
}

#bibki_icon_link:hover {
  filter: brightness(0.8);
}

#input-textarea-wrapper {
  width: 100%;
  margin: 0rem 0.5rem;
  padding: 0.5rem 0.5rem 0rem 0.5rem;
}

.invisible-textarea {
  border: none;
  background: transparent;
  height: auto;
  max-height: 10rem;
  overflow-y: auto;
  resize: none;
  padding: 0.5rem;
  width: 100%;
}

::-webkit-scrollbar {
  width: 8px; /* For vertical scrollbars */
  height: 8px; /* For horizontal scrollbars */
  background-color: transparent; /* Optional: Make the background transparent */
}

/* Target the scrollbar thumb (the draggable part) */
::-webkit-scrollbar-thumb {
  background-color: #888; /* Color of the thumb */
  border-radius: 4px; /* Rounded corners for the thumb */
  border: 2px solid transparent; /* Optional: Creates a padded effect around the thumb */
  background-clip: padding-box; /* Ensures border is outside the background-color */
}
/* Target the scrollbar track (the background area) */
::-webkit-scrollbar-track {
  background-color: #f1f1f1; /* Color of the track */
  border-radius: 4px; /* Rounded corners for the track */
}

/* Styles for hover state on the thumb */
::-webkit-scrollbar-thumb:hover {
  background-color: #555;
}

.invisible-textarea:focus {
  outline: none;
  box-shadow: none;
  background: transparent;
}

.invisible-textarea:hover {
  cursor: text;
  background: transparent;
  outline: none;
}

#input-wrapper-orso {
  border: var(--user-input-border-width) solid var(--user-input-border-color);
  display: flex;

  border-radius: 1rem;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#input-buttons {
  display: flex;
  justify-content: end;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  width: 100%;
}

#input-buttons .pull-left {
  margin-right: auto;
}
