* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Söhne', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Noto Sans', sans-serif;
}

:root {
  --sidebar-bg: #202123;
  --sidebar-hover: #2A2B32;
  --sidebar-selected: #343541;
  --main-bg: #343541;
  --chat-bg: #444654;
  --user-bg: #343541;
  --text-primary: #ECECF1;
  --text-secondary: #D9D9E3;
  --text-tertiary: #8E8EA0;
  --border-color: rgba(255, 255, 255, 0.2);
  --button-primary: #10A37F;
  --button-hover: #1A7F64;
  --input-bg: #40414F;
  --input-border: rgba(32, 33, 35, 0.5);
  --brand-color: #10A37F;
}

body {
  background-color: var(--main-bg);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.3s ease;
  z-index: 10;
}

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

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  color: var(--text-primary);
  padding: 12px;
  width: 100%;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;
}

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

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.conversation-list {
  list-style: none;
}

.conversation-item {
  padding: 12px 14px;
  cursor: pointer;
  border-radius: 5px;
  margin: 0 8px 4px 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  transition: background-color 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item:hover {
  background-color: var(--sidebar-hover);
}

.conversation-item.active {
  background-color: var(--sidebar-selected);
}

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

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.2s;
}

.user-info:hover {
  background-color: var(--sidebar-hover);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--brand-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}

.user-name {
  flex: 1;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.chat-container {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 120px;
  scroll-behavior: smooth;
}

.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
  text-align: center;
}

.welcome-title {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 20px;
  background: linear-gradient(90deg, #10A37F, #06D6A0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.examples-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  max-width: 900px;
  width: 100%;
}

.example-card {
  background-color: var(--sidebar-bg);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.example-card:hover {
  background-color: var(--sidebar-hover);
}

.example-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.example-text {
  font-size: 14px;
  color: var(--text-tertiary);
}

/* Chat Messages */
.message-row {
  padding: 24px 16px;
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.message-row.user {
  background-color: var(--user-bg);
}

.message-row.assistant {
  background-color: var(--chat-bg);
}

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

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar.user {
  background-color: #5436DA;
}

.avatar.assistant {
  background-color: var(--brand-color);
}

.avatar i {
  font-size: 20px;
}

.message-content {
  flex: 1;
  line-height: 1.6;
  font-size: 16px;
  padding-top: 6px;
}

.message-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  opacity: 0;
  transition: opacity 0.2s;
}

.message-row:hover .message-actions {
  opacity: 1;
}

.action-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.action-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Input Area */
.input-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background-color: var(--main-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.input-wrapper {
  position: relative;
  max-width: 800px;
  width: 100%;
}

.message-input {
  width: 100%;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 14px 50px 14px 16px;
  color: var(--text-primary);
  font-size: 16px;
  resize: none;
  height: 52px;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.5;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.message-input:focus {
  outline: none;
  border-color: var(--brand-color);
}

.send-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.send-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.send-btn.active {
  color: var(--brand-color);
}

.input-footer {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 8px;
  text-align: center;
}

/* Mobile Styles */
.mobile-nav {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background-color: var(--main-bg);
  z-index: 5;
  border-bottom: 1px solid var(--border-color);
}

.menu-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 20px;
}

@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .mobile-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .main-content {
    padding-top: 56px;
  }

  .examples-container {
    grid-template-columns: 1fr;
  }
}

/* Typing Animation */
.typing-animation {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 0;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background-color: var(--text-tertiary);
  border-radius: 50%;
  animation: typing-animation 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing-animation {

  0%,
  80%,
  100% {
    transform: scale(0.7);
  }

  40% {
    transform: scale(1);
  }
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Code Block Styling */
pre {
  background-color: #1E1E1E;
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
  margin: 12px 0;
  position: relative;
}

pre code {
  color: #D4D4D4;
  font-family: 'Söhne Mono', Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  font-size: 14px;
  line-height: 1.5;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: #2D2D2D;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  font-size: 12px;
  color: #ABABAB;
}

.code-copy-btn {
  background: transparent;
  border: none;
  color: #ABABAB;
  cursor: pointer;
  font-size: 14px;
  transition: color 0.2s;
}

.code-copy-btn:hover {
  color: #FFFFFF;
}

/* Dark Mode Toggle */
.theme-toggle {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 16px;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
  background-color: var(--sidebar-hover);
  color: var(--text-primary);
}

/* Light Theme */
body.light-theme {
  --sidebar-bg: #F7F7F8;
  --sidebar-hover: #ECECF1;
  --sidebar-selected: #E5E5E5;
  --main-bg: #FFFFFF;
  --chat-bg: #F7F7F8;
  --user-bg: #FFFFFF;
  --text-primary: #343541;
  --text-secondary: #40414F;
  --text-tertiary: #6E6E80;
  --border-color: rgba(0, 0, 0, 0.1);
  --input-bg: #FFFFFF;
  --input-border: #DEDEDE;
}

body.light-theme .message-input {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.text-white {
  color: var(--text-primary)!important;
}

a.no-underline {
  text-decoration: none!important;
}

.typing {
    display: flex;
    gap: 4px;
    padding: 8px;
}
.typing span {
    width: 6px;
    height: 6px;
    background: #aaa;
    border-radius: 50%;
    animation: blink 1.4s infinite both;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0% { opacity: .2; }
    20% { opacity: 1; }
    100% { opacity: .2; }
}
.hidden { display: none; }

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

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    display: inline-block;
    animation: blink 1.4s infinite both;
}

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

@keyframes blink {
    0% { opacity: .3; }
    20% { opacity: 1; }
    100% { opacity: .3; }
}