:root {
  --background-primary: #ecedee;
  --background-secondary: #96bea4;
  --background-tertiary: #f7f6f6;
  --accent-primary: #d5c4a1;
  --accent-secondary: #ebdbb2;
  --text-primary: #000;
  --text-secondary: #d5c4a1;
  --text-link: #b8bb26;
  --error: #fb4934;
  --warning: #fabd2f;
  --blue: #83a598;
  --purle: #d3869b;
  --header-height: 75px;
}

html {
  font-size: 16px;
}

.navbar {
  padding: 1em;
}
/* * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--background-primary);
}

button {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--background-tertiary);
  border: none;
  cursor: pointer;
} */
/* 
button:hover {
  background-color: var(--background-secondary);
}

a {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-link);
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Roboto', sans-serif;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-secondary);
}

p {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
}
*/

.textarea#chat, #chat {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  border: 1px solid var(--accent-primary);
  background-color: var(--background-tertiary);
  padding: 0.5rem;
  border-radius: 5px;
  margin: auto;
  max-width: 70ch;
  width: 70ch;
}

textarea:active, textarea:focus {
  outline: none;
  border: 2px solid var(--accent-primary);
} 


.spinner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  display: none;
  background-color: black;
  justify-content: center;
  align-items: center;
}

#spinner {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  animation: spin 2s ease-in-out infinite;
}

body {
  display: grid;
  grid-template-areas:   "header sidebar"
                          "content sidebar";
  grid-template-rows:    var(--header-height) 1fr;
  grid-template-columns: 1fr 250px;

  /* grid-template-columns: 1fr 4fr 2fr; */
  height: 100%;
  max-height: 100vh;
  overflow-y: hidden;
}

body.app {
  display: grid;
  grid-template-areas:   "content sidebar";
  grid-template-columns: 1fr 250px;

  /* grid-template-columns: 1fr 4fr 2fr; */
  height: 100%;
  max-height: 100vh;
  overflow-y: hidden;
}

header {
  grid-area: header;
}

nav {
  background-color: var(--background-secondary);
  padding: 1rem;
  height: 100vh;
}
nav header {
  display:flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 1rem;
}
nav main h4 {
  text-align: center;
  padding-bottom: 1rem;
}
nav ul {
  list-style: none;
  padding: 0;
}
nav ul li {
  padding: 0.5rem;
  margin: 0.5rem;
  background-color: var(--background-tertiary);
  border-radius: 5px;
}

section {
  height: calc(100vh - var(--header-height));
  grid-area: content;
  display: grid;
  grid-template-rows: 1fr 100px;
  position: relative;
}

sidebar {
  grid-area: sidebar;
  background-color: var(--background-secondary);
  /* padding: 1rem; */
  /* height: calc(100vh - var(--header-height)); */
  /* max-height: 100vh; */
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.sb-history {
  flex-grow:1;
  overflow-y: scroll;
}

.sb-item {
  max-height: 20px;
}


.chat-history {
  padding: 1rem;
  max-height: calc(100vh - 125px - var(--header-height));
  overflow-y: scroll;
}
.message {
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  flex-direction: row;
  column-gap: 1rem;
}
.message-content {
  /* max-width: 99ch; */
  flex: 1;
  padding: .4rem;
  border-radius: 5px;
  /* background-color: var(--background-tertiary); */
}
.message-content ul, .message-content ol {
  margin-left: 1rem;
  margin-block: 0.5rem;
}
.message-content li {
  margin-left: 0.25rem;
}
.usr {
  flex: 0 0 auto;
  width: 8em;
  font-size: 12px;
  padding: .4rem;
  text-transform: uppercase;
  font-weight: bold;
  border-radius: 5px;
  background-color: var(--background-tertiary);
}
.message-bot, .msg-asst {
  /* position: relative; */
  padding: 1rem;
  
}

.msg-asst::before, .msg-user::before {
  color: rgb(100, 100, 100); /* Set the color of the content */
  background-color: #f3f3f3;
  padding: .6rem;
  border-radius: 5px;
  font-size: .8rem;
  font-weight: bold;
  width: 8em;
  text-transform: uppercase;
}

.msg-asst::before {
  content: "Assistant";
}
.msg-user::before {
  content: "User";
}
.message-user, .msg-user{
  padding: 1rem;
  font-size: 1rem;
}

.msg-user .message-content {
  border: 1px solid #f3f3f3;
  white-space: break-spaces;
}

.input-area {
  display: flex;
  padding: 1rem;
}
.input-container {
  margin: auto;
  position: relative;
}

sidebar .settings {
  padding-inline: 1rem;
}

sidebar button {
  padding: 0.5rem;
  margin: 0.5rem;
  margin-inline: auto;
  border-radius: 5px;
  border: 1px solid var(--background-tertiary);

}

/* sidebar ul { 
  margin-left: 1rem;
  padding-block: 1rem;
}
sidebar li {
  margin-left: 0.25rem;
} */
.edit-name {
  width: inherit;
  padding: 0;
  margin: 0;
}
.htmx-indicator {
    position:absolute;
    top:10px;
    right:10px;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}
.htmx-request .lds-facebook{
    opacity:1
}
.htmx-request.lds-facebook{
    opacity:1
}

.lds-facebook {
  height: 12px;
  width: 12px;
  position:absolute;
  top:-8px;
  right:75px;
}
.lds-facebook div {
  display: inline-block;
  position: absolute;
  left: 8px;
  width: 16px;
  background: var(--accent-secondary);
  animation: lds-facebook 1.2s cubic-bezier(0, 0.5, 0.5, 1) infinite;
}
.lds-facebook div:nth-child(1) {
  left: 8px;
  animation-delay: -0.24s;
}
.lds-facebook div:nth-child(2) {
  left: 32px;
  animation-delay: -0.12s;
}
.lds-facebook div:nth-child(3) {
  left: 56px;
  animation-delay: 0;
}
@keyframes lds-facebook {
  0% {
    top: 8px;
    height: 64px;
  }
  50%, 100% {
    top: 24px;
    height: 32px;
  }
}
.codehilite {
  position: relative;
}

.copy-button {
  background: #272822; 
  position: absolute;
  font-size: 1.5rem;
  top: 5px;
  right: 5px;
}

pre {
  padding-bottom: 2rem;
  white-space: pre-wrap;       /* Since CSS 2.1 */
  white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
  white-space: -pre-wrap;      /* Opera 4-6 */
  white-space: -o-pre-wrap;    /* Opera 7 */
  word-wrap: break-word;       /* Internet Explorer 5.5+ */
}


.tab-list button {
  padding-inline: 1rem;
  padding-block: 0.5rem;
  background-color: var(--background-primary);
}
.selected {
  background-color: var(--background-tertiary) !important;
}
#tab-content {
  padding: 1rem;
  background-color: var(--background-secondary);
}