/* Import Google font - Poppins */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}
:root {
  --text-color: #000000;
  --icon-color: #0a0a0a;
  --icon-hover-bg: #eeeeee;
  --placeholder-color: #0f0e0e;
  --outgoing-chat-bg: #ffffff;
  --incoming-chat-bg: #f7f7f7;
  --outgoing-chat-border: #f9f5f6;
  --incoming-chat-border: #f9faff41;
  --typing-chat-bg: #f1f1f1;
  --typing-chat-border: #e2e2e2;
  --code-bg: #ececec;
  --code-color: black;
  --face: transparent;
  --lowlight: #111;
  --side: black;
  --side-dark: black;
}
.light-mode {
  --text-color: #000000;
  --icon-color: #0a0a0a;
  --icon-hover-bg: #eeeeee;
  --placeholder-color: #0f0e0e;
  --outgoing-chat-bg: #ffffff;
  --incoming-chat-bg: #f7f7f7;
  --outgoing-chat-border: #f9f5f6;
  --incoming-chat-border: #f9faff41;
  --typing-chat-bg: #f1f1f1;
  --typing-chat-border: #e2e2e2;
  --code-bg: #ececec;
  --code-color: black;
}
.dark-mode {
  --text-color: #f0f0f0; /* Light gray for readable text */
  --icon-color: #b0b0b0; /* Subtle gray for icons */
  --icon-hover-bg: #333333; /* Dark gray for icon hover */
  --placeholder-color: #a9a9a9; /* Medium gray for placeholders */
  --outgoing-chat-bg: #2d2d2d; /* Dark gray for outgoing chat */
  --incoming-chat-bg: #3a3a3a; /* Slightly lighter dark gray for incoming chat */
  --outgoing-chat-border: #2d2d2d; /* Match outgoing chat background */
  --incoming-chat-border: #3a3a3a; /* Match incoming chat background */
  --typing-chat-bg: #1f1f1f; /* Very dark gray for typing area */
  --typing-chat-border: #2b2b2b; /* Slightly lighter gray for typing area border */
  --background-color: #121212; /* Background for the entire dark mode */
  --code-bg: #ececec;
  --code-color: black;
}

.default-text {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 86vh;
  padding: 0 10px;
  text-align: center;
  color: white; /* Use your preferred --text-color variable if defined */
}

.default-text h1 {
  font-size: 4rem;
  border-radius: 0.5cm;
  display: flex;
  align-items: center;
  gap: 10px;
}

.default-text h2 {
  margin-top: 10px;
  font-size: 1.5rem;
  background: var(--text-color);
  color: var(--outgoing-chat-bg);
  padding: 12px;
  border-radius: 0.5cm;
}

.idtech {
  width: 200px;
}

body {
  background: var(--outgoing-chat-bg);
  height: 100vh;
  width: 100vw;
}

.api_key {
  display: inline-flex;
  margin: 6px;
  float: right;
}
.api_key span,
input {
  display: inline-flex;
  margin-left: 3px;
  margin-right: 3px;
}

#Api_Key {
  display: inline-flex;
}

#Api_Key.disabled {
  display: none;
}

#pdf-btn,
#api-btn,
#api-btn1,
#fullscreen-btn {
  color: var(--text-color);
}

/* Chats container styling */
.chat-container {
  overflow-y: auto;
  height: calc(100vh - 132px);
  width: 100vw;
  position: relative;
}

:where(.chat-container, textarea)::-webkit-scrollbar {
  width: 6px;
}
:where(.chat-container, textarea)::-webkit-scrollbar-track {
  background: var(--incoming-chat-bg);
  border-radius: 25px;
}
:where(.chat-container, textarea)::-webkit-scrollbar-thumb {
  background: var(--icon-color);
  border-radius: 25px;
}

.chat-container .chat {
  padding: 25px 10px;
  display: flex;
  justify-content: center;
  color: var(--text-color);
  position: relative;
}
.chat-container .chat.outgoing {
  background: var(--outgoing-chat-bg);
  border: 1px solid var(--outgoing-chat-border);
}
.chat-container .chat.incoming {
  background: var(--incoming-chat-bg);
  border: 1px solid var(--incoming-chat-border);
}
.chat .chat-content {
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  overflow: hidden;
}
span.material-symbols-rounded {
  user-select: none;
  cursor: pointer;
}
.chat .chat-content span {
  cursor: pointer;
  font-size: 1.3rem;
  color: var(--icon-color);
  visibility: hidden;
}
.chat:hover .chat-content:not(:has(.typing-animation), :has(.error)) span {
  visibility: visible;
}
.chat .chat-details {
  display: flex;
  align-items: center;
  width: 100%;
}

.chat .chat-details img {
  width: 35px;
  height: 35px;
  align-self: flex-start;
  object-fit: cover;
  border-radius: 2px;
  border-radius: 50%;
}

.chat .chat-details #msg {
  font-size: 0.9rem;
  margin: 0px 12px;
  color: var(--text-color);
  word-break: break-word;
  flex-grow: 1;
  width: 100%;
}
.chat .chat-details #msg p {
  padding: 0px;
}

.chat .chat-details #msg.error {
  color: #e55865;
}

.chat .typing-animation {
  padding-left: 25px;
  display: inline-flex;
}
.typing-animation .typing-dot {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  margin: 0 3px;
  opacity: 0.7;
  background: var(--text-color);
  animation: animateDots 1.5s var(--delay) ease-in-out infinite;
}
.typing-animation .typing-dot:first-child {
  margin-left: 0;
}
@keyframes animateDots {
  0%,
  44% {
    transform: translateY(0px);
  }
  28% {
    opacity: 0.4;
    transform: translateY(-6px);
  }
  44% {
    opacity: 0.2;
  }
}

.bottom-container {
  position: fixed;
  bottom: 0;
  width: 100%;
  min-height: 70px;
  border-top: 1px solid var(--typing-chat-border);
  background: var(--typing-chat-bg);
  padding: 20px 10px;
}

/* Typing container styling */
.typing-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.long-text-splitter {
  display: flex;
  margin: 0px;
  padding: 0px;
  width: 100%;
  align-items: flex-start;
}

#send-chunk-btn {
  background-color: #4caf50;
  flex-basis: min-content;
  margin: 10px;
  padding: 10px;
  border: none;
  cursor: pointer;
  color: white;
  text-align: center;
  font-size: 13px;
}

#send-chunk:hover {
  background-color: #3e8e41;
}

.typing-container .typing-content {
  display: flex;
  max-width: 950px;
  width: 100%;
  align-items: flex-end;
}
.typing-container .typing-textarea {
  width: 100%;
  display: flex;
  position: relative;
}
.typing-textarea textarea {
  resize: none;
  height: 55px;
  min-height: 55px;
  width: 100%;
  border: none;
  padding: 15px 45px 15px 20px;
  color: var(--text-color);
  font-size: 1rem;
  border-radius: 4px;
  max-height: 250px;
  overflow-y: auto;
  background: var(--outgoing-chat-bg);
  outline: 1px solid var(--outgoing-chat-border);
}
.typing-textarea textarea::placeholder {
  color: var(--placeholder-color);
}
.typing-content span {
  width: 55px;
  height: 55px;
  display: flex;
  border-radius: 4px;
  font-size: 1.35rem;
  align-items: center;
  justify-content: center;
  color: var(--icon-color);
}
.typing-textarea span {
  position: absolute;
  right: 0;
  bottom: 0;
  visibility: hidden;
}
.typing-textarea textarea:valid ~ span {
  visibility: visible;
}
.typing-controls {
  display: flex;
  margin-right: 7px;
}
.typing-controls span {
  margin-left: 7px;
  font-size: 1.4rem;
  background: var(--outgoing-chat-bg);
  outline: 1px solid var(--outgoing-chat-border);
}
.typing-controls span:hover {
  background: var(--icon-hover-bg);
}

/* Reponsive Media Query */
@media screen and (max-width: 600px) {
  .default-text h1 {
    font-size: 2.3rem;
  }
  :where(.default-text p, textarea, .chat p) {
    font-size: 0.95rem !important;
  }
  .chat-container .chat {
    padding: 20px 10px;
  }
  .chat-container .chat img {
    height: 16px;
    width: 16px;
  }
  .chat .chat-content:not(:has(.typing-animation), :has(.error)) span {
    visibility: visible;
  }
  .typing-container {
    padding: 15px 10px;
  }
  .typing-textarea textarea {
    height: 35px;
    padding: 10px 40px 10px 10px;
  }
  .typing-content span {
    height: 45px;
    width: 45px;
    margin-left: 5px;
  }
  span.material-symbols-rounded {
    font-size: 1.25rem !important;
  }
  .bottom-container {
    /* background: red; */
  }
}

.code-container {
  position: relative; /* Position relative to allow absolute positioning of button */
}

.copy-code-button {
  background-color: #4caf50;
  color: white;
  border: none;
  padding: 5px 10px;
  margin: 5px 0;
  cursor: pointer;
  border-radius: 3px;
  position: absolute; /* Position the button absolutely within the container */
  bottom: 0px; /* Distance from the bottom */
  right: 10px; /* Distance from the right */
}

.copy-code-button:hover {
  background-color: #45a049;
}

pre {
  margin: 5px;
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
  max-width: 100%;
  background-color: var(--code-bg);
  color: var(--code-color);
  border: 1px solid lightgray;
}

iframe {
  background-color: transparent;
  min-height: 420px;
  width: 100%;
  margin: 6px;
}

#fullscreen-iframe-btn {
  background-color: #007bff;
  display: none;
  color: white;
}
