body {
  /* background: #f7f7f8; */
  background: white;
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

#chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

#chat-output {
  max-height: 0;
  overflow-y: hidden;
  transition: max-height 2.5s ease, opacity 2s ease;
  opacity: 0;
  padding: 0 1rem;
}

#chat-output.expanded {
  max-height: 70vh;
  opacity: 1;
  overflow-y: auto;
  padding-top: 1rem;
}

.message {
  margin: 1rem 0;
  white-space: pre-wrap;
  line-height: 1.5;
}

.user {
  text-align: right;
  color: #222;
  font-weight: bold;
}

.assistant {
  text-align: left;
  color: #222;
}

#input-area {
  padding: 0.75rem 1rem;
  background: white;
  box-shadow: 0 -1px 5px rgba(0,0,0,0.05);
  z-index: 1;
}

/* 
.info-text {
  color: darkblue;
  background: #f0f4ff;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  border-left: 4px solid darkblue;
}
*/

.info-text {
  background: white;
  color: #555;
  margin-top: 1vh;
  margin-bottom: 1.5vh;
  border-radius: 0px;
  font-size: 0.9rem;
}

#input-box {
  display: flex;
  align-items: flex-end;  /* ✅ aligns input & button to bottom */
  /* background: #fff; */
  background: rgb(248, 248, 248);
  border: 1px solid #ccc;
  border-radius: 2rem;
  padding: 0.5rem 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

#messageInput {
  flex-grow: 1;
  border: none;
  outline: none;
  resize: none;
  min-height: 10vh;
  font-size: 0.85rem;
  background: transparent;
  padding: 0.5rem;
}

#messageInput,
#messageInput * {
  color: darkblue !important;
  -webkit-text-fill-color: darkblue !important;
}

.send-icon {
  padding-top: 0;
}

.topic-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  margin-top: 4vh;
  margin-left: 4vw;
  margin-right: 4vw;
  align-items: center;
  justify-content: center;
  transition: max-height 1s ease, opacity 1s ease;
}

@media screen and (max-width: 600px) {
  .topic-buttons {
    justify-content: left;
  }
}

.topic-buttons button {
  background: #e7e7e7;
  border: none;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
  font-size: 15px;
}

.topic-buttons button:hover {
  background: #cfcfcf;
}

#topic-buttons.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.choices-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-left: 1rem;
  margin-right: 1rem;
  margin-bottom: 1rem;
  margin-top: 5vh;
  justify-content: center; /* optional: center-align like topic buttons */
}

.choices-buttons button {
  background: #e7e7e7!important;
  border: none;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
}

.choices-buttons button:hover {
  background: #cfcfcf!important;
}

.choices-buttons button.selected {
  background-color: #8d8d8d!important;
  border: 1px solid #cfcfcf;
}

#instructions {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 10px;
  margin-top: 10px;
  padding: 0 10px;
  text-align: center;
  transition: opacity 1s ease;
}

#instructions.fade {
  opacity: 0;
  transition: opacity 1s ease;
}

/* so far */

/* Button wrapper to control layout inside input box */
#send-button-wrapper {
  display: flex;
  align-items: flex-end;  /* Align to bottom */
  margin-left: auto;
  margin-right: -0.5rem;
  margin-bottom: 0.2rem;
}

/* The button itself */
#sendButton {
  background-color: rgb(63, 63, 63);
  /* background-color: #007aff; */
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  padding: 0;  /* ensure SVG centers */
  position: relative;
}

#sendButton:hover {
  background-color: rgb(163, 163, 163);
}

/* SVG and spinner share the same parent space */
.send-icon svg {
  width: 22px;
  height: 22px;
  stroke: white;
  fill: none;
  display: block;
  margin-top: 2px;  /* 👈 subtle downward tweak */
}

/* Spinner perfectly centered in same space */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#intro-wrapper {
  transition: max-height 1s ease, opacity 1s ease;
  overflow: hidden;
}

#intro-wrapper.collapsed {
  max-height: 0;
  opacity: 0;
}

.send-button-wrapper {
  display: flex;
  align-items: flex-end; /* Or center, or flex-start, depending on vertical needs */
  padding-left: 0.5rem;
  padding-bottom: 0.25rem; /* tweak for exact alignment */
}

#restart-area {
  text-align: center;
  padding: 1rem 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

#restart-area.visible {
  opacity: 1;
}

#restartButton {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: bold;
  background-color: #e1e1e1;
  color: white;
  border: none;
  border-radius: 1.5rem;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(0,0,0,0.1);
  transition: background-color 0.3s ease;
}

#restartButton:hover {
  background-color: #adadad;
}

