/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #010409;
  color: #c9d1d9;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* App Container */
.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  border-left: 1px solid #30363d;
  border-right: 1px solid #30363d;
}

/* Header */
.header {
  background-color: #0d1117;
  border-bottom: 1px solid #30363d;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.bot-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-small {
  width: 32px;
  height: 32px;
  background-color: #161b22;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar-small img {
  width: 100%;
  height: 100%;
}

.bot-name {
  font-weight: 600;
  font-size: 16px;
  color: #f0f6fc;
}

.icon-btn {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.icon-btn:hover {
  color: #f0f6fc;
}

/* Chat Container */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background-color: #010409;
}

/* Messages */
.message {
  display: flex;
  gap: 16px;
  max-width: 80%;
  width: fit-content;
  /* Ensure container shrinks to content */
  animation: fadeIn 0.3s ease-in-out;
}

.message.bot {
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
  /* flex-direction: row-reverse; */ /*due to this avatar first and then text was coming*/
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.bot .avatar {
  background-color: #065084;
  padding: 8px;
}

.user .avatar {
  background-color: #1f6feb;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.message-content {
  background-color: #161b22;
  padding: 12px 16px;
  border-radius: 0 12px 12px 12px;
  color: #e6edf3;
  font-size: 15px;
  line-height: 1.6;
  border: 1px solid #30363d;
  position: relative;
  word-wrap: break-word;
  /* Ensure long words wrap */
  word-break: break-word;
  min-width: 0;
  /* Allow flex item to shrink below content size if needed (e.g. long code) */
}

.message.user .message-content {
  background-color: #1f6feb;
  color: #ffffff;
  border-radius: 12px 0 12px 12px;
  border: none;
}


.timestamp {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: #8b949e;
  text-align: right;
}

.user .timestamp {
  color: rgba(255, 255, 255, 0.7);
}

/* Syntax Highlighting & Code Blocks */
.highlight {
  color: #7ee787;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.keyword {
  color: #ff7b72;
}

.function {
  color: #d2a8ff;
}

.string {
  color: #a5d6ff;
}

.code-block {
  background-color: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 16px;
  margin: 12px 0;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

pre {
  margin: 0;
}

/* Input Area */
.input-area {
  background-color: #010409;
  padding: 24px;
  border-top: 1px solid #30363d;
}

.input-wrapper {
  background-color: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f0f6fc;
  font-size: 15px;
  padding: 8px;
  margin-right: 8px;
  font-family: 'Inter', sans-serif;
}

.chat-input:focus {
  outline: none;
}

.attach-btn {
  background: none;
  border: none;
  color: #8b949e;
  cursor: pointer;
  padding: 8px;
  font-size: 18px;
}

.send-btn {
  background-color: #238636;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.send-btn:hover {
  background-color: #2ea043;
}

.disclaimer {
  text-align: center;
  color: #484f58;
  font-size: 12px;
  margin-top: 12px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #010409;
}

::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #8b949e;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}