/* 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 {
  /* Light mode colors */
  --text-color: #222;
  --subheading-color: #a0a0a0;
  --placeholder-color: #6c6c6c;
  --primary-color: #fff;
  --secondary-color: #e9eef6;
  --secondary-hover-color: #dbe1ea;
}

.dark_mode {
  /* Dark mode colors */
  --text-color: #e3e3e3;
  --subheading-color: #828282;
  --placeholder-color: #a6a6a6;
  --primary-color: #242424;
  --secondary-color: #383838;
  --secondary-hover-color: #444;
}

body {
  background: var(--primary-color);
}

.header,
.typing-form {
  margin: 0 auto;
  max-width: 980px;
}

.header {
  margin-top: 1rem;
  padding: 1rem;
  overflow-x: hidden;
}

body.hide-header .header {
  margin: 0;
  display: none;
}

.header :where(.title, .subtitle) {
  color: var(--text-color);
  font-weight: 500;
  line-height: 4rem;
}

.header .title {
  text-align: center;
  font-size: 3rem;
  background: linear-gradient(to right, #4285f4, #d96570);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header .subtitle {
  text-align: center;
  font-size: 2.6rem;
  color: var(--subheading-color);
}

.suggestion-list {
  width: 100%;
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin-top: 2.8rem;
  flex-wrap: wrap;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  justify-content: center;
}

.suggestion-list .suggestion {
  cursor: pointer;
  padding: 1.25rem;
  width: 45%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: left;
  border-radius: 0.75rem;
  justify-content: space-between;
  background: var(--secondary-color);
  transition: 0.2s ease;
}

.suggestion-list .suggestion:hover {
  background: var(--secondary-hover-color);
}

.suggestion-list .suggestion :where(.text, .icon) {
  font-weight: 400;
  color: var(--text-color);
}

.suggestion-list .suggestion .icon {
  width: 42px;
  height: 42px;
  display: flex;
  font-size: 1.3rem;
  align-self: flex-end;
  align-items: center;
  border-radius: 50%;
  justify-content: center;
  color: var(--text-color);
  background-color: var(--primary-color);
}

.chat-list .message .message-content {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.chat-list .message .text {
  color: var(--text-color);
  white-space: pre-wrap;
}

.chat-list .message.error .text {
  color: #e55865;
}

.chat-list .message.loading .text {
  display: none;
}

.chat-list .message .avatar {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  align-self: flex-start;
  margin-left: 1rem;
}

.chat-list .message.loading .avatar {
  animation: rotate 3s linear infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

.chat-list .message .icon {
  color: var(--text-color);
  cursor: pointer;
  height: 35px;
  width: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  font-size: 1.25rem;
  margin-left: 3.5rem;
  visibility: hidden;
}

.chat-list .message .icon.hide {
  visibility: hidden;
  height: 0;
}

.chat-list .message:not(.loading, .error):hover .icon:not(.hide) {
  visibility: visible;
}

.chat-list .message .icon:hover {
  background: var(--secondary-hover-color);
}

.chat-list .message .loading-indicator {
  display: none;
  gap: 0.8rem;
  width: 100%;
  flex-direction: column;
}

.chat-list .message.loading .loading-indicator {
  display: flex;
}

.chat-list .message .loading-indicator .loading-bar {
  height: 11px;
  width: 100%;
  border-radius: 0.135rem;
  background-position: -800px 0;
  background: linear-gradient(to right, #4285f4, var(--primary-color), #4285f4);
  animation: loading 3s linear infinite;
}

.chat-list .message .loading-indicator .loading-bar:last-child {
  width: 70%;
}

@keyframes loading {
  0% {
    background-position: -800px 0;
  }

  100% {
    background-position: 800px 0;
  }
}

.typing-area {
  position: fixed;
  width: 100%;
  left: 0;
  bottom: 0;
  padding: 1rem;
  background: var(--primary-color);
}

.typing-area :where(.typing-form, .action-buttons) {
  display: flex;
  gap: 0.75rem;
}

.typing-form .input-wrapper {
  width: 100%;
  height: 56px;
  display: flex;
  position: relative;
}

.typing-form .typing-input {
  height: 100%;
  width: 100%;
  max-height: 6rem;
  border: none;
  outline: none;
  overflow: hidden;
  resize: none;
  scrollbar-width: none;
  font-size: 1rem;
  color: var(--text-color);
  padding: 1.1rem 4rem 1.1rem 1.5rem;
  border-radius: 2rem;
  background: var(--secondary-color);
}

.typing-form .typing-input:focus {
  background: var(--secondary-hover-color);
  border-radius: 0.8rem;
  overflow-y: auto;
}

.typing-form .typing-input::placeholder {
  color: var(--placeholder-color);
}

.typing-area .icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  font-size: 1.4rem;
  color: var(--text-color);
  align-items: center;
  justify-content: center;
  background: var(--secondary-color);
  transition: 0.2s ease;
}

.typing-area .icon:hover {
  background: var(--secondary-hover-color);
}

.typing-form #send-message-button {
  position: absolute;
  right: 0;
  outline: none;
  border: none;
  transform: scale(0);
  background: transparent;
  transition: transform 0.2s ease;
}

.typing-form .typing-input:valid ~ #send-message-button {
  transform: scale(1);
}

.typing-area .disclaimer-text {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 1rem;
  color: var(--placeholder-color);
}

/* Responsive media query code for small screen */
@media (max-width: 768px) {
  .header :is(.title, .subtitle) {
    font-size: 2rem;
    line-height: 2.6rem;
  }

  .header .subtitle {
    font-size: 1.7rem;
  }

  .typing-area :where(.typing-form, .action-buttons) {
    gap: 0.4rem;
  }

  .typing-form .input-wrapper {
    height: 50px;
  }

  .typing-form .typing-input {
    padding: 1.1rem 3.5rem 1.1rem 1.2rem;
  }

  .typing-area .icon {
    height: 50px;
    width: 50px;
  }

  .typing-area .disclaimer-text {
    font-size: 0.75rem;
    margin-top: 0.5rem;
  }
}

@media (max-width: 600px) {
  .chat-list .message .avatar {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 50%;
    align-self: flex-start;
  }
  .chat-list {
    font-size: 0.85rem;
    max-width: 100%;
  }
  .typing-form .typing-input {
    font-size: 0.85rem;
  }
  .typing-form .typing-input::placeholder {
    font-size: 0.8rem;
  }
  .suggestion-list h4 {
    font-size: 1rem;
  }
}

@media (max-width: 500px) {
  .suggestion-list .suggestion {
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: center;
  }
  .suggestion-list .suggestion h4 {
    font-size: 14px;
  }
  .suggestion-list .suggestion .icon {
    display: contents;
    margin: auto;
    background-color: transparent;
    justify-content: right;
  }
  .suggestion-list {
    margin-top: 1.7rem;
    gap: 0.7rem;
  }
  .header {
    margin-top: 0;
  }
}

/*customize the message.incoming and .outgoing*/
.chat-list {
  padding: 0 0.5rem 0rem 0.5rem;
  max-height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
  margin-top: 1.5rem;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.chat-list::after {
  content: ""; /* Required to make the pseudo-element appear */
  display: block; /* Allows you to apply spacing with margin */
  margin-bottom: 10rem; /* Adjust this value for the desired space */
}

.message.outgoing {
  background: var(--secondary-color);
  margin-top: 1rem;
  padding: 1rem 1rem 1rem 0;
  border-radius: 0 2rem 2rem 2rem;
  width: max-content;
  max-width: 90%;
  margin-left: auto;
}

.message.incoming {
  background: var(--secondary-color);
  border-radius: 2rem 0 2rem 2rem;
  padding: 1.3rem 1rem 1.3rem 0;
  margin-top: 1rem;
  width: max-content;
  min-width: 87%;
  max-width: 100%;
  margin-right: auto;
}

.chat-list,
.message,
.message-content,
.message.incoming,
.message.outgoing,
.text {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.message.incoming {
  max-width: 100%;
}

/*css text animations*/
.dancing_text {
  animation: hu__hu__ infinite 2s ease-in-out;
}
@keyframes hu__hu__ {
  50% {
    transform: translateY(10px);
  }
}

.manual-copy-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
}

.manual-copy-dialog {
  width: min(520px, 100%);
  max-height: 85vh;
  padding: 20px;
  overflow: auto;

  color: #222222;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35);
}

.manual-copy-dialog h2 {
  margin: 0 0 10px;
  color: #222222;
  font-size: 20px;
}

.manual-copy-dialog p {
  margin: 0 0 12px;
  color: #444444;
  line-height: 1.5;
}

.manual-copy-dialog textarea {
  display: block;
  width: 100%;
  min-height: 220px;
  padding: 12px;

  color: #222222;
  background: #f8f9fa;
  border: 1px solid #cccccc;
  border-radius: 8px;

  font: inherit;
  line-height: 1.6;
  resize: vertical;
}

.manual-copy-close {
  display: block;
  margin: 14px 0 0 auto;
  padding: 9px 18px;

  color: #ffffff;
  background: #0d6efd;
  border: 0;
  border-radius: 7px;

  font: inherit;
  cursor: pointer;
}

.manual-copy-close:hover {
  background: #0b5ed7;
}

.chat-list {
  scroll-padding-top: 16px;
  scroll-behavior: smooth;
}

.chat-list .message .text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
}

.message.outgoing .avatar {
  width: 40px;
  height: 40px;
  padding: 4px;
  object-fit: contain;
  background-color: #ffffff;
  border-radius: 50%;
}
