@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;700&family=Roboto+Condensed:wght@400;700&display=swap');

* {
  box-sizing: border-box;
}


#header {
  text-align: center;
  margin: 3rem auto;
}


#header img {
  width: 5rem;
  height: 5rem;
  object-fit: contain;
  background-color: transparent;
}

#header h1 {
  font-size: 1.5rem;
}

#user-input {
  padding: 1rem;
  max-width: 30rem;
  margin: 2rem auto;
  border-radius: 4px;
  background: linear-gradient(180deg, #307e6c, #2b996d);
}

input::placeholder{
  color: #e1eeeb;
}

.input-group {
  display: block;
  justify-content: space-evenly;
  gap: 1.5rem;
  margin: 10px 2px
}

#user-input label {
  display: block;
  margin-bottom: 0.25rem;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 0.5rem;
  font-weight: bold;
  text-transform: uppercase;
}
.flex{
  display: flex !important;
}

.justify-center{
  justify-content: center;
}

.justify-between{
  justify-content: space-between;
}

.justify-around{
  justify-content: space-around;
}

/* between j */

#user-input input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #76c0ae;
  border-radius: 0.25rem;
  background-color: transparent;
  color: #c2e9e0;
  font-size: 1rem;
}

#result {
  max-width: 50rem;
  margin: 2rem auto;
  padding: 1rem;
  table-layout: fixed;
  border-spacing: 1rem;
  text-align: right;
}

#result thead {
  font-size: 0.7rem;
  color: #83e6c0;
}

#result tbody {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 0.85rem;
  color: #c2e9e0;
}

.center {
  text-align: center;
}

/* Assuming #chats is the container for messages */
#chats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    max-width: 90%; /* Full width with some padding */
    margin: 0 auto;
    max-height: 500px; /* Limit height for scrolling */
    overflow-y: auto; /* Enable vertical scrolling */
}

.sent {
    align-self: flex-end;
    background-color: #dcf8c6; /* Light green for sent */
    color: #303030;
    padding: 0.75rem 1rem;
    border-radius: 18px 18px 4px 18px; /* Bubble shape */
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    max-width: 90%;
    word-wrap: break-word;
    position: relative;
    margin-left: 36px;
    margin-right: 0;
}

.received {
    align-self: flex-start;
    background-color: #ffffff; /* White for received */
    color: #303030;
    padding: 0.75rem 1rem;
    border-radius: 18px 18px 18px 4px; /* Bubble shape */
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    max-width: 90%;
    word-wrap: break-word;
    position: relative;
    margin-right: auto;
    margin-left: 0;
}


/* Optional: Add a small tail for more realism */
.sent::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid #dcf8c6;
    border-bottom: 8px solid transparent;
}

.received::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-right: 8px solid #ffffff;
    border-bottom: 8px solid transparent;
}


/* Resize the chats panel to make it smaller */
#chats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    max-width: 400px; /* Reduced from 600px to make it smaller */
    margin: 0 auto;
}

/* Add styles for a new panel to view and group chats per user (e.g., a sidebar) */
#user-chat-panel {
    display: flex;
    height: 100vh; /* Full height for the panel */
}

#user-list {
    width: 250px; /* Sidebar width */
    background-color: #f4f4f4;
    padding: 1rem;
    border-right: 1px solid #ddd;
    overflow-y: auto; /* Scroll if needed */
}

#user-list .user-group {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#user-list .user-group:hover {
    background-color: #e9ecef;
}

#user-list .user-group h4 {
    margin: 0;
    font-size: 1rem;
}

#chat-area {
    flex: 1; /* Takes remaining space */
    display: flex;
    flex-direction: column;
}
