:root {
  --bg-color: #0d1117;
  --chat-bg: #161b22;
  --text-color: #c9d1d9;
  --bot-bg: #21262d;
  --user-bg: #7c3aed;
  --input-bg: #0d1117;
}

body.light {
  --bg-color: #f9f9f9;
  --chat-bg: #ffffff;
  --text-color: #111;
  --bot-bg: #f0f0f0;
  --user-bg: #7c3aed;
  --input-bg: #ffffff;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.chat-container {
  width: 100%;
  max-width: 700px; /* increased from 400px */
  height: 90vh;     /* give it more height */
  background-color: var(--chat-bg);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  overflow: hidden;
  margin: 20px;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #1f2937;
  border-bottom: 1px solid #30363d;
}

.left {
  display: flex;
  align-items: center;
}

.avatar {
  background: #3ab4ed;
  padding: 10px;
  border-radius: 50%;
  margin-right: 12px;
  font-size: 20px;
  color: white;
}

.status {
  font-size: 0.85rem;
  color: #3fb950;
}

.chat-box {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.collapsed {
  max-height: 150px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.collapsed::after {
  content: "Click to expand";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, var(--chat-bg), transparent);
  text-align: center;
  font-size: 0.8rem;
  color: #7c3aed;
  padding-top: 10px;
}


.message {
  max-width: 85%;
  padding: 10px 14px;
  margin: 8px 0;
  border-radius: 12px;
  word-wrap: break-word;
  font-size: 16px; /* bump this up too if needed */
  line-height: 1.5;
  word-break: break-word;
}

.user-msg {
  align-self: flex-end;
  background-color: var(--user-bg);
  color: white;
}

.bot-msg {
  align-self: flex-start;
  background-color: var(--bot-bg);
  color: var(--text-color);
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #30363d;
  background-color: var(--chat-bg);
}

.chat-input-area input {
  flex-grow: 1;
  border: 1px solid #30363d;
  background: var(--input-bg);
  color: var(--text-color);
  padding: 10px;
  border-radius: 8px;
}

.chat-input-area button {
  background-color: #7c3aed;
  color: white;
  border: none;
  padding: 0 16px;
  font-size: 1.2rem;
  border-radius: 8px;
  cursor: pointer;
}

/* Toggle Switch 
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 34px;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
} */

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background-color: var(--bot-bg);
  color: var(--text-color);
  border-radius: 12px;
  max-width: fit-content;
}

.typing-indicator .dot {
  height: 8px;
  width: 8px;
  background-color: var(--text-color);
  border-radius: 50%;
  animation: bounce 1s infinite ease-in-out;
}

.typing-indicator .dot:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-indicator .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}





input:checked + .slider {
  background-color: #7c3aed;
}
input:checked + .slider:before {
  transform: translateX(18px);
}
