html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
}

.controls {
  width: 600px;
  max-width: 90%;
  text-align: center;
  margin-bottom: 16px;
}

#new-chat {
  background: #0039a6;
  border: none;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 57, 166, 0.2);
}

#new-chat:hover {
  background: #002d7a;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 57, 166, 0.3);
}

.chat-container {
  width: 600px;
  max-width: 90%;
  height: 70vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  border: 1px solid #e0e0e0;
}

#chat-box {
  padding: 16px;
  flex-grow: 1;
  overflow-y: auto;
  border-bottom: 1px solid #ddd;
  background: #fafafa;
}

.message {
  display: flex;
  align-items: flex-end;
  width: 100%;
  padding: 12px 0 0 0;
  margin-bottom: 12px;
  clear: both;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
  font-size: 1rem;
}

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

.message.bot {
  justify-content: flex-start;
}

.message.user {
  display: flex;
  flex-direction: row-reverse;
  float: right;
}

.message .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #0039a6;
}

.message.bot .avatar {
  margin-right: 8px;
}

.message.user .avatar {
  margin-left: 8px;
}

.message.bot .text {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  color: #333;
}

.message.user .text {
  background: #0039a6;
  color: #ffffff;
}

.message .text {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 16px;
  max-width: 80%;
  position: relative;
  line-height: 1.4;
}

#chat-form {
  display: flex;
  width: 100%;
}

#chat-form input {
  flex: 1;
  font-size: 1rem;
  padding: 0.7em;
}

#chat-form button {
  font-size: 1.2rem;
  cursor: pointer;
}

#message {
  flex-grow: 1;
  border: none;
  padding: 12px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 8px;
  outline: none;
  color: #333;
}

#message::placeholder {
  color: #999;
}

button[type="submit"] {
  border: none;
  background: #0039a6;
  color: #fff;
  padding: 0 16px;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button[type="submit"]:hover {
  background: #002d7a;
}

.chat-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #000000;
  color: #ffffff;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.chat-header .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-right: 10px;
  border: 2px solid #0039a6;
}

.title {
  font-weight: 600;
  color: #ffffff;
  font-size: 1.3rem;
}

#chat-box::-webkit-scrollbar {
  width: 6px;
}

#chat-box::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 3px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .chat-container, .controls {
    width: 95%;
    max-width: 95%;
  }
  
  .message .text {
    font-size: 0.9rem;
    max-width: 85%;
  }
}