/* 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: #FFFFFF;
  --icon-color: #ACACBE;
  --icon-hover-bg: #5b5e71;
  --placeholder-color: #dcdcdc;
  --outgoing-chat-bg: #343541;
  --incoming-chat-bg: #444654;
  --outgoing-chat-border: #343541;
  --incoming-chat-border: #444654;
}
.light-mode {
  --text-color: #343541;
  --icon-color: #a9a9bc;
  --icon-hover-bg: #f1f1f3;
  --placeholder-color: #6c6c6c;
  --outgoing-chat-bg: #FFFFFF;
  --incoming-chat-bg: #F7F7F8;
  --outgoing-chat-border: #FFFFFF;
  --incoming-chat-border: #D9D9E3;
}
body {
  background: var(--outgoing-chat-bg);
}

/* Chats container styling */
.chat-container {
  overflow-y: auto;
  max-height: 100vh;
  padding-bottom: 150px;
}
: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;
}
.default-text {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 70vh;
  padding: 0 10px;
  text-align: center;
  color: var(--text-color);
}
.default-text h1 {
  font-size: 3.3rem;
}
.default-text p {
  margin-top: 10px;
  font-size: 1.1rem;
}
.chat-container .chat {
  padding: 25px 10px;
  display: flex;
  justify-content: center;
  color: var(--text-color);
}
.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;
  max-width: 1200px;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
}
span.material-symbols-rounded {
  user-select: none;
  cursor: pointer;
}
.chat .chat-content span {
  cursor: pointer;
  font-size: 1.3rem;
  color: var(--icon-color);
}
.chat:hover .chat-content:not(:has(.typing-animation), :has(.error)) span {
  visibility: visible;
}
.chat .chat-details {
  display: flex;
  align-items: center;
}
.chat .chat-details img {
  width: 35px;
  height: 35px;
  align-self: flex-start;
  object-fit: cover;
  border-radius: 2px;
}
.chat .chat-details p {
  white-space: pre-wrap;
  font-size: 1.05rem;
  padding: 0 50px 0 25px;
  color: var(--text-color);
  word-break: break-word;
}
.chat .chat-details p.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;
  }
}

/* Typing container styling */
.typing-container {
  position: fixed;
  bottom: 0;
  width: 100%;
  display: flex;
  padding: 20px 10px;
  justify-content: center;
  background: var(--outgoing-chat-bg);
  border-top: 1px solid var(--incoming-chat-border);
}
.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;
  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(--incoming-chat-bg);
  outline: 1px solid var(--incoming-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; */
  visibility: visible;
}
/* .typing-textarea textarea:valid ~ span {
  visibility: visible;
} */

#send-btn[title="Stop generating"] {
  filter: saturate(1.2) contrast(1.1);
}

.typing-controls {
  display: flex;
}
.typing-controls span {
  margin-left: 7px;
  font-size: 1.4rem;
  background: var(--incoming-chat-bg);
  outline: 1px solid var(--incoming-chat-border);
}
.typing-controls span:hover {
  background: var(--icon-hover-bg);
}

#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff; /* You can change the background color */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#loading-screen img {
  width: 100px; /* Adjust the size of the logo as needed */
  height: 100px;
}

.chat-details p a {
  color: #00f7ff;
  text-decoration: underline;
}
.chat-details p a:hover {
  text-decoration: none;
  background: var(--icon-hover-bg);
}

.app-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 60px;
  padding: 0 16px;
  box-sizing: border-box;
  
  background: rgba(255, 255, 255, 0.15); 
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.3);
  color: #cccccc;
}

.toolbar-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-push-right {
  margin-left: auto;
}

.assistant-wrapper {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;         /* grow to fill leftover height */
  width: 100%;
  box-sizing: border-box;
}

.toolbar-link{
  color: var(--text-color);
  font-weight: 500;
  text-decoration: none;
}

/* .toolbar-link:hover {
  text-decoration: underline;
  opacity: 0.9;
} */

.profile-container {
  width: min(980px, 92vw);
  margin: 18px auto;
  display: grid;
  gap: 18px;
}

.card {
  background: var(--secondary-color);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

.card-header h2 {
  margin: 0 0 6px;
  color: var(--text-color);
  font-size: 18px;
}

.card-header p {
  margin: 0 0 16px;
  color: var(--text-color);
  opacity: 0.8;
  font-size: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-color);
  opacity: 0.85;
  font-size: 13px;
}

.form-field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.18);
  color: var(--text-color);
  outline: none;
}

.form-field input:focus {
  border-color: rgba(255,255,255,0.25);
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

.btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: rgba(255,255,255,0.12);
  color: var(--text-color);
}

.btn-primary:hover {
  background: rgba(255,255,255,0.18);
}

.btn-ghost {
  background: transparent;
  color: var(--text-color);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.08);
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-color);
}

.alert-error {
  background: rgba(255, 70, 70, 0.12);
}

.alert-success {
  background: rgba(70, 255, 160, 0.12);
}

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-color);
  font-weight: 500;
  text-decoration: none;
}

.profile-icon {
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
}

/* .profile-link:hover {
  opacity: 0.9;
} */

.toolbar-link.profile-link:hover {
  text-decoration: none !important;
}

/* .profile-link:hover .profile-text {
  text-decoration: underline;
} */

.reactions {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  gap: 10px;
  margin-top: 8px;
  margin-left: 46px;
  user-select: none;
}

.reaction-btn {
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  opacity: 0.75;
  transition: opacity 0.15s ease, transform 0.05s ease;
}

.reaction-btn:hover {
  opacity: 1;
}

.reaction-btn:active {
  transform: scale(0.96);
}

.reaction-btn.selected {
  opacity: 1;
}


/* 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: 32px;
    width: 32px;
  }
  .chat-container .chat p {
    padding: 0 20px;
  }
  .chat .chat-content:not(:has(.typing-animation), :has(.error)) span {
    visibility: visible;
  }
  .typing-container {
    padding: 15px 10px;
  }
  .typing-textarea textarea {
    height: 45px;
    padding: 10px 40px 10px 10px;
  }
  .typing-content span {
    height: 45px;
    width: 45px;
    margin-left: 5px;
  }
  span.material-symbols-rounded {
    font-size: 1.25rem!important;
  }
  .toolbar {
    flex-direction: column;
    gap: 8px;
    height: 100px;
  }
  .toolbar-section {
    justify-content: flex-start;
  }
  .toolbar-section label {
    font-size: 14px;
    margin-left: 10px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

