:root {
  --primary-color: #C2CFE3;
  --secondary-color: #FCF2E0;
  --bot-message-color: #FFFFFF;
  --user-message-color: #C2CFE3;
  --conversation-bg: #FABA99;
  --chat-bg: #ED806B;
  --chat-title-color: #26304A;
  --form-bg: #ED806B;  /* for base of entry field */
  --input-bg: #F6F7FB;
  --input-border: #26304A;
  --button-bg: #C2CFE3;
  --font-family: 'DM Sans', system-ui, sans-serif;
  --radius: 10px;
}
  
  /* Reset and base styles */
  html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--secondary-color);
    font-family: var(--font-family);
  }
  
  /* Layout */
  body {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }
  
  /* Container for chat and title */
  .container {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    max-height: 80%;
    min-height: 380px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 8px;
    padding-bottom: 20px;
    margin-bottom: 100px;
  }
  
  /* Chat title */
  .chat-title {
    font-family: var(--font-family);
    font-size: 2rem;
    font-weight: 700;
    margin: 18px 0 14px 0;
    color: var(--chat-title-color);
    letter-spacing: -0.02em;
    text-align: center;
  }
  
  /* Chat box */
  #chat-container {
    background: #ED806B; /**var(--chat-bg);**/
    border-radius: var(--radius);
   /** box-shadow: 0 2px 16px #26304A; **/
    width: 100%;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  
  /* Conversation area */
  #conversation {
    flex: 1 1 0;
    min-height: 0; /* important for flexbox overflow */
    overflow-y: auto;
    background: #FABA99; /** background color for chat area **/
    border-radius: var(--radius);
    padding: 10px;
    margin: 12px 12px 8px 12px;

  }
  
  /* Message styles */
  .message {
    padding: 12px;
    margin-bottom: 10px;
    border: 2px solid #26304A;
    border-radius: var(--radius);
    max-width: 70%;
    word-wrap: break-word;
    line-height: 1.4em;
    font-size: 1rem;
  }
  .user-message {
    background-color: var(--user-message-color);
    margin-left: auto;
  }
  .bot-message {
    background-color: var(--bot-message-color);
    margin-right: auto;
  }
  
  /* Input area */
  #input-container {
    display: flex;
    padding: 0 12px 10px 12px;
    background: transparent;
   
  }
  #text-input {
    width: 100vw;
    padding: 10px;
    border-radius: 0;
    border: 1px solid #cfcfe4;
    font-size: 1rem;
    outline: none;
    background: #fff;
    color: #241D18;
    box-sizing: border-box;
  }

  .site-footer {
    background: #C2CFE3;
    color: #241D18;
    text-align: center;
    padding: 18px 0 14px 0;
    font-size: .8rem;
    letter-spacing: 0.01em;
    width: 100vw;
    position: fixed;
    margin-top: 300px;  /* Add this or adjust as needed */
    bottom: 0;
    left: 0;
    z-index: 100;
    box-shadow: 0 -1px 8px rgba(0,0,0,0.03);
    border-top: 2px solid #E3D3C2;   /* subtle border for separation */
  }
  .footer-logo {
    height: 28px;     /* Adjust as desired */
    margin-bottom: 10px;
    margin-right: 10px;
    vertical-align: middle;
  }
  .site-footer a:link {
    color: #26304A;          /* Choose a nice color for unvisited links */
    text-decoration: underline;
  }
  
  .site-footer a:visited {
    color: #26304A;          /* Different color for visited links */
  }
  
  .site-footer a:hover,
  .site-footer a:focus {
    color: #803321;          /* Change color on hover/focus for interactivity */
    text-decoration: none;
  }
  
  .site-footer a:active {
    color: #EB5E54;          /* Color when the link is being clicked */
  }
  /* Responsiveness */
  @media (max-width: 600px) {
    /* Layout adjustments */
    .container {
      width: 100vw;
      max-width: 100vw;
      min-width: 0;
      min-height: 100vh;
      max-height: 100vh;
      height: 80%;
      padding: 0 !important;
      margin: 0 !important;
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
      /* Make room for footer */
      padding-bottom: 64px;
    }
    .chat-title {
      font-size: 1.5rem;
      margin: 16px 0 16px 0;
      padding: 0 8px;
      text-align: center;
      margin-top: 60px;
    }
    #chat-container {
      flex: 1 1 auto;
      width: 100vw;
      max-width: 100vw;
      border-radius: 0;
      display: flex;
      flex-direction: column;
      background: var(--chat-bg);
      margin: 0;
      padding: 0;
      min-height: 0;
      max-height: 80%;
    }
    #conversation {
      flex: 1 1 auto;
      min-height: 0;
      max-height: 80%;
      overflow-y: auto;
      background: var(--conversation-bg);
      border-radius: 0;
      padding: 10px 4px 8px 4px;
      margin: 0;
    }
    /* Input area/styling */
    .pill-input-container {
      width: 100%;
      max-width: 100%;
      margin: 0 auto 10px auto;
      height: auto; /* If using textarea, let height be auto */
      min-height: 54px;
      border-radius: var(--radius);
      padding: 0;
    }
    .pill-text-input {
      font-size: 1rem;
      padding: 9px 10px;
      min-height: 38px;
      border-radius: var(--radius) 0 0 var(--radius);
      line-height: 1.5;
      height: auto;
      /* If textarea: limit vertical size */
      max-height: 62px;
      resize: none;
    }
    .pill-submit-btn {
      font-size: 1rem;
      min-width: 68px;
      padding: 0 12px;
      height: auto;
      border-radius: 0 var(--radius) var(--radius) 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    /* Message adjustments */
    .message {
      font-size: 0.98rem;
      padding: 9px;
      margin-bottom: 7px;
      border-radius: var(--radius);
      word-break: break-word;
    }
    /* Footer always visible */
    .site-footer {
      position: fixed;
      left: 0; right: 0; bottom: 0;
      width: 100vw;
      padding: 10px 0 16px 0;
      margin: 0;
      font-size: 1rem;
      z-index: 100;
      border-top: 2px solid #E3D3C2;
      background: var(--primary-color);
    }
    .footer-logo {
      height: 24px;
      margin-bottom: 6px;
    }
  }
  #chat-container {
    background: var(--chat-bg);
    border-radius: var(--radius);
    width: 100%;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
  }
  
  #conversation {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    background: var(--conversation-bg);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 20px;
    margin: 0;
  }
  
  /* Pill-shaped input inside chat container and centered horizontally */
 
/* Pill group styling */
.pill-input-container {
  display: flex;
  max-width: 94%;
  margin: 16px auto;
  border-radius: var(--radius);
  border: 2.5px solid var(--border-color);
  background: var(--input-bg);
  height: 54px;
  box-sizing: border-box;
  overflow: hidden;
}

.pill-text-input,
.pill-submit-btn {
  border: none;
  border-radius: var(--radius);
  background: transparent;
  height: 100%;
  box-sizing: border-box;
  font-size: 1.1rem;
  outline: none;
  color: var(--button-color);
  font-family: inherit;
}

.pill-text-input {
  flex: 1 1 0;
  padding: 0 18px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.1rem;
  color: var(--button-color);
  font-family: inherit;
  border-radius: var(--radius) 0 0 var(--radius);  /* only round left corners! */
  border-right: none;
}

.pill-text-input::placeholder {
  color: #26304A;
  opacity: 0.7;
}

/* Create button color and add pill-right shape */
.pill-submit-btn {
  flex: 0 0 130px;
  background: var(--button-bg);
  color: var(--button-color);
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.15s;
  border-left: 1.5px solid var(--border-color);
  border-radius: 0;
  border-top-right-radius: var(--radius);  /* Only right! */
  border-bottom-right-radius: var(--radius);
}

.pill-submit-btn:hover,
.pill-submit-btn:focus {
  background: #b3c1d5;
}

/* Responsive example */
@media (max-width: 700px) {
  .pill-input-container {
    width: 92vw;
    max-width: 100vw;
    border-radius: var(--radius);
    height: 40px;
  }
  .pill-submit-btn {
    flex-basis: 70px;
    font-size: 1rem;
  }
}

.bot-message {
  line-height: 1.6;
}

.bot-message h1,
.bot-message h2,
.bot-message h3 {
  margin: 10px 0 5px;
  color: #26304A;
}

.bot-message strong {
  font-weight: bold;
}

.bot-message a {
  color: #0077FF;
  text-decoration: none;
}

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

.bot-message ul,
.bot-message ol {
  padding-left: 1.5rem;
  margin: 5px 0 5px 15px;
}

.bot-message p {
  margin: 0.5em 0;
}

.bot-message code {
  background: #eee;
  padding: 2px 4px;
  border-radius: var(--radius);
}

.bot-message blockquote {
  border-left: 4px solid rgba(38, 48, 74, 0.3);
  padding-left: 10px;
  margin: 10px 0;
  color: #555;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #C2CFE3;
    --secondary-color: #26304A;
    --bot-message-color: #FFFFFF;
    --user-message-color: #FCF2E0;
    --conversation-bg: #C2CFE3;
    --chat-bg: #E8963B;
    --chat-title-color: #FCF2E0;
    --form-bg: #23232B;
    --input-bg: #23232B;
    --input-border: #7A869A;
    --button-bg: #3B4159;
    --button-color: #FABA99;
  }
  .site-footer {
    background: var(--primary-color);
    color: #241D18;
    border-top: 2px solid #333;
  }
  .site-footer a:link {
    color: #26304A;          /* Choose a nice color for unvisited links */
    text-decoration: underline;
  }
  
  .site-footer a:visited {
    color: #26304A;          /* Different color for visited links */
  }
  
  .site-footer a:hover,
  .site-footer a:focus {
    color: #803321;          /* Change color on hover/focus for interactivity */
    text-decoration: none;
  }
  
  .site-footer a:active {
    color: #EB5E54;          /* Color when the link is being clicked */
  }
  .pill-text-input, .pill-submit-btn {
    color: #FCF2E0;
    background: #803321;
  }
  .message {
    border-color: #484C5C;
  }
}

.typing {
  font-size: 1rem;
  color: #888;
  animation: typing-animation 1.5s infinite;
}

@keyframes typing-animation {
  0%, 100% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
}
