:root {
  --bg-color: #1e1e1e;
  --text-color: #e3e3e3;
  --input-bg: #2c2c2c;
  --border-color: #3a3a3a;
  --gray: #888;
  --font: "Courier Prime", monospace;
  --bubble-bg-ai: #2a2a2a;
  --bubble-bg-user: #3c3c3c;
  --modal-bg: rgba(0, 0, 0, 0.7);
  --modal-content-bg: #2a2a2a;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  font-family: var(--font);
  color: var(--text-color);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.terminal-window {
  width: 90%;
  max-width: 800px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-color);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 0 10px #000;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2c2c2c;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.terminal-controls {
  display: flex;
  gap: 8px;
}

.terminal-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
  font-size: 0.9em;
  color: var(--gray);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.red { background-color: #ff5f56; }
.yellow { background-color: #ffbd2e; }
.green { background-color: #27c93f; }

.title {
  margin-left: auto;
  margin-right: auto;
  font-weight: bold;
  color: var(--gray);
  font-size: 0.9em;
}

.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch; /* tambahkan ini */
  gap: 15px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.message {
  display: flex;
  flex-direction: column;
  width: fit-content;
  max-width: 80%;
}

.message-bubble {
  background: var(--bubble-bg-ai);
  padding: 12px 16px;
  border-radius: 20px;
  line-height: 1.2;
  word-wrap: break-word;
}

.user-message {
  align-self: flex-end;
  text-align: right;
}

.user-message .message-bubble {
  background: var(--bubble-bg-user);
  border-bottom-right-radius: 0;
}

.ai-message {
  align-self: flex-start;
  text-align: left;
}

.ai-message .message-bubble {
  background: var(--bubble-bg-ai);
  border-bottom-left-radius: 0;
}

pre {
  background-color: #1d1d1d;
  color: #ddd;
  padding: 10px;
  border-radius: 6px;
  overflow-x: auto;
  position: relative;
  font-family: var(--font);
}

.copy-button {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--border-color);
  color: white;
  border: none;
  padding: 3px 6px;
  font-size: 0.75em;
  cursor: pointer;
  border-radius: 3px;
}

.chat-input-area {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border-color);
  background: var(--input-bg);
  padding: 10px;
}

#user-input {
  flex: 1;
  background: transparent;
  color: var(--text-color);
  border: none;
  font-family: var(--font);
  font-size: 1em;
  padding: 10px;
  outline: none;
}

#send-button {
  background: var(--border-color);
  color: white;
  border: none;
  font-size: 1.2em;
  padding: 10px;
  cursor: pointer;
  margin-left: 10px;
  border-radius: 6px;
}

.typing-dots {
  display: flex;
  gap: 6px;
  padding: 8px 0;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background-color: var(--gray);
  border-radius: 50%;
  animation: blink 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--modal-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: var(--modal-content-bg);
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  color: var(--text-color);
  box-shadow: 0 0 10px #000;
}

#reset-button {
  margin-top: 20px;
  padding: 10px 20px;
  background: var(--border-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font);
}

.hljs {
  background: none;
  color: inherit;
}

.scroll-button {
  position: absolute;
  bottom: 100px;
  right: 30px;
  background: var(--border-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: none;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
}