/* Page background */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #dff3ff, #f5fbff);
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #1a1a1a;
}

/* Main container */
.container {
  width: 100%;
  max-width: 650px;
  margin: 20px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 35px rgba(0, 120, 200, 0.18);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Title */
h1 {
  text-align: center;
  color: #1976d2;
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Chat box */
#chat {
  border: 1px solid #d6ebff;
  background: #f7fbff;
  padding: 14px;
  height: 380px;
  overflow-y: auto;
  border-radius: 12px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

/* Messages */
.msg {
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 75%;
  line-height: 1.4;
  word-wrap: break-word;
  font-size: 14px;
  animation: fadeIn 0.15s ease-in-out;
}

/* Smooth message appearance */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* User messages */
.user {
  background: linear-gradient(135deg, #d9ecff, #cfe6ff);
  color: #0d47a1;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  text-align: left;
}

/* Bot messages */
.bot {
  background: #e8f5e9;
  color: #1b5e20;
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}

/* Input area */
.input-area {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

/* Input field */
#input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #b3ddff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
  background: #ffffff;
}

#input:focus {
  border-color: #1e88e5;
  box-shadow: 0 0 0 3px rgba(30,136,229,0.2);
}

/* Send button */
#send {
  padding: 12px 18px;
  border: none;
  background: linear-gradient(135deg, #42a5f5, #1e88e5);
  color: white;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

#send:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(30,136,229,0.25);
}

#send:active {
  transform: scale(0.97);
}

/* Optional: nicer scrollbar (Chrome/Edge) */
#chat::-webkit-scrollbar {
  width: 8px;
}

#chat::-webkit-scrollbar-thumb {
  background: #c6e3ff;
  border-radius: 10px;
}

#chat::-webkit-scrollbar-track {
  background: transparent;
}

#clear {
  margin: 10px auto;
  display: block;
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  background: #ff5252;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

#clear:hover {
  background: #ff1744;
  transform: translateY(-1px);
}

