* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  width: 100%;
  height: 100%;
  font-family: 'Open Sans', sans-serif;
  font-weight: 300;
}

#background {
  position: fixed;
  width: 110%;
  height: 110%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: blur(4px);
  z-index: -2;
  top: -5%;
  left: -5%;
  opacity: 0;
  transition: opacity 5s;
}

#overlay {
  position: fixed;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: -1;
  opacity: 0;
  transition: opacity 8s;
}

#input-placeholder {
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translate(-50%, 0);
  color: rgba(255, 255, 255, 0.6);
  font-weight: 300;
  font-size: 18px;
  opacity: 0;
  transition: opacity 0.5s;
}

#input-container {
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translate(-50%, 0);
  width: 60%;
  opacity: 0;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.80);
}

#wave {
  position: absolute;
  top: calc(85% - 53.97px);
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.5s;
}

#user-input {
  position: absolute;
  bottom: 15%;
  left: 50%;
  font-weight: 300;
  font-family: 'Open Sans', sans-serif;
  transform: translate(-50%, 0);
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: rgba(255, 255, 255, 0.70);
  font-size: 18px;
  text-align: center;
}

#response-container {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translate(-50%, 0);
  width: 60%;
  max-height: 60%;
  overflow-y: auto;
  display: flex; /* Flexbox for stacking messages vertically */
  flex-direction: column; /* Stack messages vertically */
  align-items: center; /* Center align messages */
  text-align: center; /* Center text within messages */
  color: rgba(255, 255, 255, 0.90);
  font-weight: 300;
  font-size: 18px;
  opacity: 1; /* Ensure it's visible */
  transition: opacity 0.8s;
  padding: 10px;
  border-radius: 8px;
  background: transparent; /* Transparent background */
}

/* Individual Messages */
.message {
  margin: 10px 0;
  padding: 10px;
  max-width: 80%;
  word-wrap: break-word;
}

/* User Messages */
.message.user {
  font-weight: bold; /* Bold text */
  /* Center alignment is handled by parent flexbox and text-align */
}

/* System Messages */
.message.system {
  font-weight: normal; /* Normal text */
  /* Center alignment is handled by parent flexbox and text-align */
}

/* Scrollbar Styling (optional) */
#response-container::-webkit-scrollbar {
  width: 8px;
}

#response-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

#response-container::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

#credits {
  position: absolute;
  bottom: 2%;
  left: 50%;
  transform: translate(-50%, 0);
  color: rgba(255, 255, 255, 0.6);
  font-weight: 300;
  font-size: 10px;
  opacity: 0;
  transition: opacity 5s;
}

a {
  color: white;
  text-decoration: none;
}

.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

#user-input.fade-out {
  animation: fadeOut 0.5s forwards;
}

#user-input::placeholder {
  color: transparent;
}

@keyframes waveAnimation {
  0% {
    transform: translateX(-50%) scale(0.2);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 0;
  }
}

/* Markdown Styling */
.message.system p h1,
.message.system p h2,
.message.system p h3,
.message.system p h4,
.message.system p h5,
.message.system p h6 {
    color: #ffffff;
    margin-bottom: 10px;
}

.message.system p a {
    color: #1e90ff;
    text-decoration: none;
}

.message.system p a:hover {
    text-decoration: underline;
}

.message.system p ul {
    list-style-type: disc;
    padding-left: 20px;
}

.message.system p blockquote {
    border-left: 4px solid #ccc;
    padding-left: 10px;
    color: #777;
    margin: 10px 0;
}

/* Additional styles for better readability */
.message.system p code {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
}

.message.system p pre {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
}
