html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: white;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-image: url("image3.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body {
  margin: 0;          /* remove auto centering */
  height: 100vh;
  width: 100vw;       /* full viewport width */
  display: flex;
  flex-direction: column;
  align-items: center; /* if you want centered children, else remove */
}

h1 {
  color: #800020;
  text-align: center;
  margin: 1rem 0;
  flex-shrink: 0;
}

/* Chat container fills most of the viewport */
#chat {
  flex-grow: 1;
  width: 60%;
  background-color: rgba(253, 253, 253, 0.90);
  border: 2px solid #800020;
  border-radius: 8px;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse; /* newest at bottom */
  gap: 0.5rem;
  scroll-behavior: smooth;
  box-sizing: border-box;
  /* Make sure it’s tall but leaves space for input */
  max-height: 500px;
  /* Minimum height just in case */
  min-height: 200px;
  padding-right: 1rem;
}

/* Input container fixed at bottom */
#input-container {
  display: flex;
  width: 60%;
  padding: 0.5rem 0.75rem;
  border-top: 2px solid #800020;
  background-color: white;
  box-sizing: border-box;
  flex-shrink: 0;
  padding-left: 1rem;
  background-color: rgba(255, 255, 255, 0.90);
}

/* Input box style */
#question {
  flex-grow: 1;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border: 1px solid #800020;
  border-radius: 20px 0 0 20px;
  outline: none;
  box-sizing: border-box;
  background-color: rgba(255, 255, 255, 0.90);
}

/* Send button styled to connect to input */
#send {
  padding: 0 1.5rem;
  font-size: 1rem;
  background-color: #800020;
  color: white;
  border: none;
  border-radius: 0 20px 20px 0;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#send:hover {
  background-color: #a32638;
}

/* Message bubbles base style */
.message {
  max-width: 70%;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  word-wrap: break-word;
  font-size: 0.9rem;
  line-height: 1.3;
  display: inline-block;
  clear: both;
  background-color: rgba(255, 255, 255, 0.85);
}

/* User message: right aligned, blue bubble */
.user-message {
  background-color: #d1e7ff; /* light blue */
  color: #003366; /* dark blue */
  border-bottom-right-radius: 5px;
  align-self: flex-end;
  text-align: right;
}

/* Helper message: left aligned, burgundy bubble */
.helper-message {
  background-color: #f8d7da; /* very light pink */
  color: #800020; /* burgundy */
  border-bottom-left-radius: 5px;
  font-style: italic;
  align-self: flex-start;
  text-align: left;
}

/* Blinking typing indicator */
@keyframes blink {
  0% { opacity: 0.2; }
  50% { opacity: 1; }
  100% { opacity: 0.2; }
}

#typing-indicator {
  animation: blink 1s infinite;
}
