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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #050505;
  color: #ffffff;
  height: 100vh;
  display: flex;
  overflow: hidden;
}

.app-container {
  display: flex;
  width: 100%;
  height: 100%;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: #000000;
  border-right: 1px solid #222222;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 16px;
}

#new-chat-btn {
  width: 100%;
  background: transparent;
  color: #ffffff;
  border: 1px solid #333333;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: background 0.2s;
}

#new-chat-btn:hover {
  background: #111111;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Scrollbar for sidebar */
.sidebar-content::-webkit-scrollbar {
  width: 6px;
}
.sidebar-content::-webkit-scrollbar-thumb {
  background-color: #333;
  border-radius: 10px;
}

.history-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #cccccc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.history-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.history-item:hover {
  background-color: #111111;
}

.history-item.active {
  background-color: #1a1a1a;
  color: #ffffff;
}

.delete-btn {
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  display: none;
  padding: 2px;
  border-radius: 4px;
}

.history-item:hover .delete-btn {
  display: flex;
}

.delete-btn:hover {
  color: #ff4444;
  background-color: rgba(255, 68, 68, 0.1);
}

/* Chat Wrapper */
.chat-wrapper {
  flex: 1;
  background-color: #050505;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header */
.chat-header {
  padding: 20px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid #222222;
}

.chat-header h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: #ffffff;
}

/* Chat Messages */
#chat-box {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

/* Scrollbar */
#chat-box::-webkit-scrollbar {
  width: 6px;
}
#chat-box::-webkit-scrollbar-thumb {
  background-color: #333;
  border-radius: 10px;
}

.message {
  max-width: 85%;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: fadeIn 0.3s ease-out;
}

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

/* Bot message */
.message.bot {
  align-self: flex-start;
  background-color: #000000;
  color: #e5e5e5;
  border: 1px solid #333333;
  border-radius: 16px 16px 16px 4px;
}

/* User message */
.message.user {
  align-self: flex-end;
  background-color: #ffffff;
  color: #000000;
  border-radius: 16px 16px 4px 16px;
  font-weight: 500;
}

/* Footer / Input */
.chat-footer {
  display: flex;
  padding: 24px;
  background-color: #050505;
  gap: 12px;
  align-items: center;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.chat-footer input[type="text"] {
  flex: 1;
  padding: 14px 18px;
  font-size: 15px;
  border-radius: 24px;
  border: 1px solid #333333;
  outline: none;
  background-color: #111111;
  color: #ffffff;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.chat-footer input[type="text"]:focus {
  border-color: #ffffff;
}

.chat-footer input[type="text"]::placeholder {
  color: #666666;
}

#send-btn {
  background-color: #ffffff;
  color: #000000;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

#send-btn:hover {
  transform: scale(1.05);
  background-color: #e5e5e5;
}

/* Code block styles (from highlight.js) */
pre {
  background: #111111 !important;
  border: 1px solid #333333;
  color: #dcdcdc;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin-top: 8px;
  font-size: 13px;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}
