body {
  display: flex;
  font-family: sans-serif;
  justify-content: center;
  align-items: flex-start;
  height: 100vh;
  margin: 0;
  padding: 0;
}

#chat-container {
  max-width: 600px;
  width: 100%;
  background-color: #fff;
  border: 0px solid #ddd;
  padding: 20px;
  margin-top: 20px;
  position: relative;
  padding-bottom: 60px;
}

#input-wrapper {
  display: flex;
  gap: 10px;
  margin: 15px 0;
  align-items: stretch;
}

#chat-input {
  flex: 1;
  height: 40px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
  font-family: sans-serif;  /* Match the font family */
  font-size: 16px;         /* Match the text size */
  line-height: 1.5;        /* Match the line height */
}

#send-button {
  height: 40px;
  padding: 0 20px;
  background-color: #333;
  color: white;
  border: none;
  border-radius: 4px;
  font-family: sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}

#send-button:hover {
  background-color: #555;
}

#send-button:active {
  background-color: #222;
}

#send-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Also ensure the placeholder text matches */
#chat-input::placeholder {
  font-size: 16px;
  font-family: sans-serif;
  color: #666;
}


#response-container {
  width: 100%;
  background-color: #fff;
  border: 1px solid #ddd;
  padding: 10px;
  margin-bottom: 60px;
  max-height: calc(100vh - 350px);  /* Adjusted for new layout */
  overflow-y: auto;
  box-sizing: border-box;
}

.chat-entry {
  margin-bottom: 10px;
  padding: 10px;
  border-bottom: 0px solid #eee;
}

#bessie {
  padding-top: 5px;
  font-family: sans-serif;
  line-height: 1.5;
}

#Q {
  padding-top: 5px;
  font-weight: 800;
  font-family: sans-serif;
  line-height: 1.5;
}

img {
  display: block;
  margin: 0 auto;
  max-width: 600px;
  width: 100%;
  height: auto;
}

#chat-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
} 

#con {
  min-height: 100%;
  position: relative;
}

#content {
  height: auto;
  min-height: 100vh;
  position: relative;
}

#merch {
  text-align: right;
  margin-bottom: 15px;  /* Added more space before input */
}

.copyright {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #fff;
  padding: 10px 0;
  text-align: center;
  border-top: 1px solid #ddd;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);  /* Optional: adds subtle shadow */
}

/* Added styles for better input appearance */
#chat-input:focus {
  outline: none;
  border-color: #999;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

@keyframes blink {
  0% { opacity: .2; }
  20% { opacity: 1; }
  100% { opacity: .2; }
}

.loading-dots span {
  animation-name: blink;
  animation-duration: 2s;  /* Slowed down from 1.4s */
  animation-iteration-count: infinite;
  animation-fill-mode: both;
  font-size: 20px;  /* Make dots more visible */
  padding: 0 2px;   /* Add some space between dots */
  color: #666;      /* Slightly softer color */
}

.loading-dots span:nth-child(2) {
  animation-delay: .4s;  /* Adjusted delay */
}

.loading-dots span:nth-child(3) {
  animation-delay: .8s;  /* Adjusted delay */
}

.loading-dots {
  display: inline-block;
  margin-left: 4px;  /* Space after "Roastie:" */
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  #chat-container {
    max-width: 100%;
    width: 100%;
    padding: 10px;
    margin: 0;
    box-sizing: border-box;
    padding-bottom: 70px;
  }

  img {
    max-width: 70%;
    width: 70%;
    padding: 0;
    margin: 10px auto;
  }

  #input-wrapper {
    flex-direction: row;
    gap: 8px;
    margin: 10px 0;
  }

  #chat-input {
    font-size: 16px; /* Prevents zoom on iOS */
    height: 44px; /* Better touch target */
    min-width: 0;
  }

  #send-button {
    height: 44px; /* Better touch target */
    padding: 0 16px;
    font-size: 15px;
    flex-shrink: 0;
  }

  #response-container {
    max-height: calc(100vh - 550px);
    min-height: 150px;
    font-size: 15px;
  }

  #Q, #bessie {
    font-size: 14px;
    word-wrap: break-word;
  }

  .copyright {
    font-size: 11px;
    padding: 8px 5px;
  }

  #merch {
    font-size: 13px;
    margin-bottom: 8px;
    text-align: center;
  }
}

@media screen and (max-width: 480px) {
  #chat-container {
    padding: 8px;
  }

  img {
    max-width: 65%;
    width: 65%;
    margin: 8px auto;
  }

  #input-wrapper {
    gap: 6px;
  }

  #send-button {
    padding: 0 12px;
    font-size: 14px;
  }

  #response-container {
    padding: 8px;
    max-height: calc(100vh - 500px);
    min-height: 120px;
  }

  .chat-entry {
    padding: 6px;
  }

  #merch {
    font-size: 12px;
  }

  .copyright {
    font-size: 10px;
  }
}

@media screen and (max-width: 430px) {
  img {
    max-width: 60%;
    width: 60%;
  }

  #response-container {
    max-height: calc(100vh - 480px);
  }
}