:root {
  --primary: #10a37f;
  --primary-dark: #0d8c6d;
  --secondary: #5436da;
  --bg-dark: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-card: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #475569;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

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

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.logo i {
  font-size: 28px;
  color: var(--primary);
}

.logo h1 {
  font-size: 24px;
  font-weight: 700;
}

.logo-accent {
  color: var(--primary);
}

.new-chat-btn {
  width: 100%;
  padding: 14px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.2s;
}

.new-chat-btn:hover {
  background-color: var(--primary-dark);
}

.conversations-list {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.conversation-item {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.conversation-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.conversation-item.active {
  background-color: rgba(16, 163, 127, 0.15);
  color: var(--primary);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

.user-info, .model-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.03);
}

.model-info {
  margin-top: 12px;
  color: var(--text-secondary);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.menu-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: none;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot.connected {
  background-color: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
}

.welcome-message {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.welcome-icon {
  font-size: 64px;
  color: var(--primary);
  margin-bottom: 24px;
}

.welcome-message h1 {
  font-size: 40px;
  margin-bottom: 16px;
}

.welcome-message p {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.6;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.quick-prompt {
  padding: 14px 24px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.quick-prompt:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

.messages-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.message {
  display: flex;
  gap: 20px;
  padding: 24px;
  border-radius: var(--radius);
  animation: fadeIn 0.3s ease-out;
}

.message.user {
  background-color: rgba(16, 163, 127, 0.1);
  border-left: 4px solid var(--primary);
}

.message.assistant {
  background-color: rgba(30, 41, 59, 0.5);
  border-left: 4px solid var(--secondary);
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message-avatar.user {
  background-color: var(--secondary);
}

.message-content {
  flex: 1;
  line-height: 1.6;
}

.message-content p {
  margin-bottom: 12px;
}

.message-content pre {
  background-color: rgba(0, 0, 0, 0.4);
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 16px 0;
}

.message-content code {
  font-family: 'JetBrains Mono', monospace;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

.typing-indicator {
  display: flex;
  gap: 8px;
  padding: 20px;
}

.typing-indicator span {
  width: 10px;
  height: 10px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

/* Input Area */
.input-area {
  border-top: 1px solid var(--border-color);
  padding: 24px;
  background-color: rgba(30, 41, 59, 0.5);
}

.input-wrapper {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

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

.input-action {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-input-container {
  flex: 1;
}

#message-input {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  resize: none;
  max-height: 200px;
  padding: 16px 0;
  line-height: 1.5;
}

#message-input:focus {
  outline: none;
}

.input-hints {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

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

.send-btn, .stop-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s;
}

.send-btn {
  background-color: var(--primary);
  color: white;
}

.send-btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.stop-btn {
  background-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.stop-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stop-btn:not(:disabled):hover {
  background-color: rgba(239, 68, 68, 0.3);
}

.input-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.copyright {
  margin-top: 8px;
  font-size: 12px;
}

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

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    z-index: 100;
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .menu-toggle {
    display: block;
  }
}

@media (max-width: 768px) {
  .welcome-message h1 {
    font-size: 32px;
  }
  
  .welcome-message p {
    font-size: 16px;
  }
  
  .quick-prompts {
    flex-direction: column;
  }
  
  .input-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
  
  .input-controls, .send-controls {
    align-self: center;
  }
}
