/* ---------------------
   RESET / GLOBAL STYLES
------------------------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* ---------------------
     BODY / PAGE BACKGROUND
  ------------------------ */
body {
  background-color: #f5f5f5;
}

/* ---------------------
     NAVBAR / HEADER
  ------------------------ */
.navbar {
  /* Already responsive due to Bootstrap classes */
}

/* ---------------------
     CHAT TITLE
  ------------------------ */
.chat-title {
  margin-top: 1rem;
}

/* ---------------------
     CHAT PANEL (WHITE BOX)
  ------------------------ */
.chat-panel {
  width: 100%;
  max-width: 600px; /* Constrains width on larger screens */
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---------------------
     MESSAGES CONTAINER
  ------------------------ */
.messages-container {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  max-height: 500px; /* Optional: keep chat from growing too tall */
}

/* MESSAGE BUBBLES */
.message {
  display: inline-block;
  clear: both;
  margin-bottom: 0.8rem;
  padding: 0.6rem 1rem;
  border-radius: 16px;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
  max-width: 80%;
}

/* USER (RIGHT) MESSAGES */
.user-message {
  float: right;
  background-color: #0d6efd; /* Bootstrap "primary" color */
  color: #fff;
  border-bottom-right-radius: 0;
}

/* AI (LEFT) MESSAGES */
.ai-message {
  float: left;
  background-color: #e9ecef; /* Light gray */
  color: #333;
  border-bottom-left-radius: 0;
}

/* ---------------------
     MESSAGE SCROLLBAR (OPTIONAL)
  ------------------------ */
.messages-container::-webkit-scrollbar {
  width: 8px;
}
.messages-container::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.messages-container::-webkit-scrollbar-thumb {
  background: #c4c4c4;
  border-radius: 4px;
}

/* ---------------------
     MOBILE MEDIA QUERIES
  ------------------------ */
@media screen and (max-width: 576px) {
  /* For very small screens, reduce border radius for a more full-width feel */
  .chat-panel {
    border-radius: 0;
    margin: 0 0.5rem; /* slight side padding */
  }

  /* Let message bubbles take more width on small screens */
  .message {
    max-width: 90%;
  }
}
