:root {
  --user-bg: #007bff;
  --user-color: #fff;
  --bot-bg: #f1f0f0;
  --bot-color: #222;
  --chat-bg: #f3f3f3;
  --bubble-radius: 18px;
  --avatar-size: 36px;
  --border-radius: 18px;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
  --transition: 0.3s;
}
body {
  margin: 0;
  padding: 0;
  font-family: Tahoma, Arial, sans-serif;
  background: var(--chat-bg);
  transition: background 0.3s;
}
.dark-mode {
  --user-bg: #0d6efd;
  --user-color: #fff;
  --bot-bg: #23272f;
  --bot-color: #f3f3f3;
  --chat-bg: #181a20;
}
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--chat-bg);
  transition: background 0.3s;
}
.chatbox {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  height: 80vh;
  min-height: 420px;
  overflow: hidden;
  position: relative;
  transition: background 0.3s;
}
.dark-mode .chatbox {
  background: #23272f;
}
.chat-header {
  padding: 18px 20px 12px 20px;
  background: transparent;
  text-align: center;
  font-size: 1.3rem;
  color: #007bff;
  font-weight: bold;
  letter-spacing: 1px;
  border-bottom: 1px solid #eaeaea;
}
.dark-mode .chat-header {
  color: #0d6efd;
  border-bottom: 1px solid #333;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 12px 12px 12px;
  background: var(--chat-bg);
  transition: background 0.3s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-input-area {
  display: flex;
  align-items: center;
  padding: 12px 10px;
  background: #fafbfc;
  border-top: 1px solid #eaeaea;
  gap: 8px;
}
.dark-mode .chat-input-area {
  background: #23272f;
  border-top: 1px solid #333;
}
.chat-input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  background: #fff;
  transition: border 0.2s;
}
.dark-mode .chat-input {
  background: #23272f;
  color: #f3f3f3;
  border: 1px solid #444;
}
.send-btn {
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.send-btn:hover {
  background: #0056b3;
}
.toggle-dark {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #eee;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 18px;
  color: #333;
  transition: background 0.2s;
}
.dark-mode .toggle-dark {
  background: #23272f;
  color: #f3f3f3;
}
.bubble {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 2px;
  animation: fadeIn 0.4s;
}
.bubble.user {
  flex-direction: row-reverse;
  justify-content: flex-end;
}
.bubble.bot {
  justify-content: flex-start;
}
.bubble-content {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: var(--bubble-radius);
  font-size: 15px;
  line-height: 1.7;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  word-break: break-word;
  white-space: pre-line;
}
.bubble.user .bubble-content {
  background: var(--user-bg);
  color: var(--user-color);
  border-bottom-right-radius: 4px;
}
.bubble.bot .bubble-content {
  background: var(--bot-bg);
  color: var(--bot-color);
  border-bottom-left-radius: 4px;
}
.avatar {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  color: #888;
  user-select: none;
}
.bubble.user .avatar {
  background: #007bff;
  color: #fff;
}
.bubble.bot .avatar {
  background: #23272f;
  color: #f3f3f3;
}
.typing {
  font-size: 14px;
  color: #888;
  margin: 0 8px 8px 8px;
  animation: blink 1.2s infinite;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@media (max-width: 600px) {
  .chatbox {
    max-width: 100vw;
    min-height: 100vw;
    height: 100vh;
  }
  .chat-header {
    font-size: 1.1rem;
  }
  .bubble-content {
    font-size: 14px;
  }
} 