/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
}

body {
  background: linear-gradient(to right, #1f1c2c, #928dab);
  color: #fff;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.navbar {
    height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  padding: 0.7rem 2rem;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo img {
  height: 70px;
}


.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.nav-links li a {
  text-decoration: none;
  color: white;
  position: relative;
  background: linear-gradient(to right,#0000ff,#5e2c91);
  padding: 0.5rem;
  border-radius: 10px 0px;
}
.nav-links li a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  left: 0;
  bottom: -4px;
  background: linear-gradient(to right, #ff00cc, #3333ff);
  transition: width 0.4s ease;
}
.nav-links li a:hover::after {
  width: 100%;
}

/* Layout */
.container {
  display: flex;
  height: 95vh;
  width: 95vw;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
}

.sidebar {
  width: 250px;
  background: #1e1e2f;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
}

.profile {
  text-align: center;
  margin-bottom: 1rem;
}

.profile-pic {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid #ff00cc;
  transition: 0.3s ease;
}
.profile-pic:hover {
  opacity: 0.8;
  box-shadow: 0 0 10px #ff00cc;
}

#username {
  margin-top: 0.5rem;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  color: #ffffff;
}

.new-chat {
  margin-top: 1rem;
  padding: 0.5rem;
  background: linear-gradient(to right, #ff00cc, #3333ff);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  color: white;
  font-weight: bold;
  transition: 0.3s ease;
}
.new-chat:hover {
  background: linear-gradient(to right, #e600ac, #0000ff);
}

.chat-history {
  margin-top: 1rem;
  overflow-y: auto;
  flex-grow: 1;
}
.chat-history div {
  background-color: #29294d;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 5px;
  cursor: pointer;
  transition: 0.2s;
  font-size: 0.95rem;
}
.chat-history div:hover {
  background-color: #3a3a6a;
}

/* Chat Area */
.chat-area {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background-color: #2e2e4d;
}

.messages {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 1rem;
  margin-bottom: 1rem;
}
.messages::-webkit-scrollbar,
.chat-history::-webkit-scrollbar {
  width: 8px;
}
.messages::-webkit-scrollbar-thumb,
.chat-history::-webkit-scrollbar-thumb {
  background: #ff00cc;
  border-radius: 10px;
}

.message {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 10px;
  max-width: 75%;
  line-height: 1.5;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  word-wrap: break-word;
  white-space: pre-wrap;
}
.message.user {
  background:linear-gradient(to right,#3333ff,#fff);
  align-self: flex-end;
}
.message.bot {
  background-color: #5e2c91;
  align-self: flex-start;
}

/* Input Area */
.input-area {
  display: flex;
  gap: 0.5rem;
}
#user-input {
  flex-grow: 1;
  padding: 1rem;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  background-color: #1a1a2e;
  color: white;
}
#user-input:focus {
  outline: 2px solid #ff00cc;
  background-color: #111122;
}
#send-btn {
  background:linear-gradient(to right,#ff00cc,#0000ff);
  color: white;
  padding: 1rem 1.2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
}
#send-btn:hover {
  background:linear-gradient(to right,#ce4cb4,#4e4eb8);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    height: auto;
    padding: 0.5rem;
  }

  .chat-area {
    padding: 0.5rem;
  }

  .messages {
    height: 50vh;
  }
}
