:root {
  --bg: #1a1a1a;
  --panel: #242424;
  --panel2: #1f1f1f;
  --text: #f0f0f0;
  --muted: #888888;
  --border: rgba(255,255,255,0.1);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, Segoe UI, sans-serif; }

.shell { display: grid; grid-template-columns: 320px 1fr; height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.main { background: var(--panel2); padding: 16px; }

.brand-title { font-size: 22px; font-weight: 700; }
.brand-title a {
  text-decoration: none;
  color: inherit;
  background: linear-gradient(135deg, #78b4ff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-title a:hover {
  opacity: 0.9;
}
.brand-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

.section-title { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

.row { display: flex; gap: 8px; }
input, textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 10px;
}
textarea { resize: none; }

button {
  background: rgba(255,255,255,0.10);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}
button:hover { background: rgba(255,255,255,0.14); }

.project-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.project {
  display: block;
  padding: 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
}
.project:hover { background: rgba(255,255,255,0.04); border-color: var(--border); }
.project.active { background: rgba(255,255,255,0.06); border-color: var(--border); }

.footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.muted { color: var(--muted); }

.chat { height: calc(100vh - 32px); display: grid; grid-template-rows: 1fr auto; gap: 12px; }
.messages { overflow: auto; padding-right: 6px; display: flex; flex-direction: column; gap: 10px; }

.bubble { max-width: 820px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); }
.bubble .meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.bubble.user { align-self: flex-end; background: rgba(120, 180, 255, 0.08); }
.bubble.assistant { align-self: flex-start; background: rgba(255, 255, 255, 0.04); }

.composer { display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: end; }
.empty { max-width: 720px; padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,0.03); }

/* Landing Page Styles */
.landing {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.landing-header {
  text-align: center;
  padding: 40px 0 60px 0;
  border-bottom: 1px solid var(--border);
}

.braldey-avatar-large {
  margin-bottom: 24px;
}

.braldey-avatar-large img {
  width: 400px;
  height: auto;
  object-fit: contain;
}

.landing-header h1 {
  font-size: 48px;
  margin: 0 0 10px 0;
  background: linear-gradient(135deg, #78b4ff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 24px;
  color: var(--text);
  margin: 0 0 8px 0;
  font-weight: 600;
}

.subtitle {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 30px 0;
}

.cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.btn-primary {
  background: rgba(120, 180, 255, 0.15);
  color: var(--text);
  border-color: rgba(120, 180, 255, 0.3);
}

.btn-primary:hover {
  background: rgba(120, 180, 255, 0.25);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-large {
  padding: 16px 32px;
  font-size: 18px;
}

.landing-section {
  padding: 50px 0;
  border-bottom: 1px solid var(--border);
}

.landing-section h2 {
  font-size: 28px;
  margin: 0 0 20px 0;
  color: var(--text);
}

.landing-section p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 16px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.stat {
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.stat-number {
  display: block;
  font-size: 36px;
  font-weight: 700;
  color: #78b4ff;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 14px;
  color: var(--muted);
}

.expertise-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0 0;
}

.expertise-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  position: relative;
  padding-left: 24px;
}

.expertise-list li:before {
  content: "→";
  position: absolute;
  left: 0;
  color: #78b4ff;
}

.expertise-list li:last-child {
  border-bottom: none;
}

.blog-preview {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.blog-post {
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.blog-post h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: var(--text);
}

.blog-post h3 a {
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(135deg, #78b4ff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-post h3 a:hover {
  opacity: 0.8;
}

.blog-date {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px 0;
}

.blog-excerpt {
  margin: 0 0 12px 0;
  color: var(--muted);
  line-height: 1.5;
}

.read-more {
  color: #78b4ff;
  text-decoration: none;
  font-size: 14px;
}

.read-more:hover {
  text-decoration: underline;
}

.blog-archive {
  margin-top: 20px;
  text-align: center;
}

.blog-archive a {
  color: var(--muted);
  text-decoration: none;
}

.blog-archive a:hover {
  color: var(--text);
}

.testimonials {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.testimonials blockquote {
  margin: 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border-left: 3px solid #78b4ff;
}

.testimonials blockquote p {
  margin: 0 0 10px 0;
  font-style: italic;
  color: var(--text);
}

.testimonials cite {
  font-size: 14px;
  color: var(--muted);
  font-style: normal;
}

.cta-section {
  text-align: center;
  border-bottom: none;
}

.cta-section h2 {
  margin-bottom: 10px;
}

.cta-section p {
  margin-bottom: 25px;
}

.landing-footer {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

.landing-footer p {
  margin: 0 0 8px 0;
  color: var(--muted);
  font-size: 14px;
}

.footer-disclaimer {
  font-size: 12px !important;
  opacity: 0.7;
}

/* Auth Page Styles (Login) */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid var(--border);
}

.auth-brand {
  text-align: center;
  margin-bottom: 30px;
}

.auth-brand h1 {
  font-size: 36px;
  margin: 0 0 8px 0;
  background: linear-gradient(135deg, #78b4ff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-tagline {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.form-group input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  border-radius: 10px;
  font-size: 15px;
}

.form-group input:focus {
  outline: none;
  border-color: rgba(120, 180, 255, 0.5);
  background: rgba(255,255,255,0.06);
}

.form-group input::placeholder {
  color: var(--muted);
}

.btn-full {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  margin-top: 10px;
}

.auth-error {
  padding: 12px 16px;
  background: rgba(255, 100, 100, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.3);
  border-radius: 10px;
  color: #ff6464;
  font-size: 14px;
  text-align: center;
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
}

.auth-footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.auth-footer a:hover {
  color: var(--text);
}

/* Landing Page Navigation */
.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  margin: -40px -20px 20px -20px;
  border-bottom: 1px solid var(--border);
}

.landing-nav-brand a {
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(135deg, #78b4ff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.landing-nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.landing-nav-links a:hover {
  color: var(--text);
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
}

/* User Menu */
.user-menu-container {
  position: relative;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #78b4ff 0%, #a78bfa 100%);
  border: none;
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.user-avatar:hover {
  transform: scale(1.05);
}

.user-menu {
  position: absolute;
  top: 44px;
  right: 0;
  min-width: 200px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
  z-index: 100;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.user-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.user-menu-name {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
}

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.user-menu-item svg {
  opacity: 0.7;
}

.user-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.user-menu-logout {
  color: #ff6464;
}

/* ============================================================================
   MODERN CHAT INTERFACE
   ============================================================================ */

.app-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  background: var(--bg);
}

/* Sidebar Styles */
.app-sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.sidebar-avatar {
  margin-bottom: 16px;
}

.sidebar-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(120, 180, 255, 0.3);
  box-shadow: 0 4px 16px rgba(120, 180, 255, 0.15);
}

.sidebar-brand {
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(135deg, #78b4ff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-tagline {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0 0;
}

.sidebar-section {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-section-title svg {
  opacity: 0.6;
}

.new-project-form {
  margin-bottom: 16px;
}

.new-project-form input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s;
}

.new-project-form input:focus {
  outline: none;
  border-color: rgba(120, 180, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
}

.new-project-form input::placeholder {
  color: var(--muted);
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.project-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.project-item.active {
  background: rgba(120, 180, 255, 0.1);
  border-color: rgba(120, 180, 255, 0.3);
}

.project-icon {
  opacity: 0.7;
  font-size: 13px;
}

.project-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-projects {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

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

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #78b4ff 0%, #a78bfa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.logout-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.logout-link:hover {
  color: #ff6464;
}

/* Main Chat Area */
.app-main {
  background: var(--panel2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 24px;
}

.empty-state h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 12px 0;
  background: linear-gradient(135deg, #78b4ff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.empty-state p {
  color: var(--muted);
  font-size: 16px;
  max-width: 400px;
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.empty-state-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.hint-arrow {
  font-size: 20px;
  animation: bounce-left 1s infinite;
}

@keyframes bounce-left {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-5px); }
}

/* Chat Container */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header-icon {
  font-size: 18px;
}

.chat-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.chat-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Messages */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

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

.message-avatar {
  flex-shrink: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.user-avatar {
  background: rgba(120, 180, 255, 0.2);
  color: #78b4ff;
  border: 1px solid rgba(120, 180, 255, 0.3);
}

.braldey-avatar {
  background: linear-gradient(135deg, #78b4ff 0%, #a78bfa 100%);
  color: white;
}

.braldey-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(120, 180, 255, 0.3);
}

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

.message-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.message-author {
  font-weight: 600;
  color: var(--text);
}

.message-time {
  color: var(--muted);
}

.message-body {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

.message.user .message-body {
  background: rgba(120, 180, 255, 0.1);
  border-color: rgba(120, 180, 255, 0.2);
}

.message.assistant .message-body {
  background: rgba(255, 255, 255, 0.04);
}

/* Composer */
.composer-container {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.composer {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.composer-input-wrapper {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px;
  transition: all 0.2s;
}

.composer-input-wrapper:focus-within {
  border-color: rgba(120, 180, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

.composer textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 12px 16px;
  font-size: 15px;
  resize: none;
  max-height: 150px;
  min-height: 24px;
  line-height: 1.5;
}

.composer textarea:focus {
  outline: none;
}

.composer textarea::placeholder {
  color: var(--muted);
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #78b4ff 0%, #a78bfa 100%);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(120, 180, 255, 0.3);
}

.send-btn.sending {
  opacity: 0.6;
  cursor: not-allowed;
}

.composer-hint {
  text-align: center;
  margin: 8px 0 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ============================================================================
   MARKDOWN RENDERING STYLES
   ============================================================================ */

.message-body {
  /* Ensure proper spacing for markdown content */
  line-height: 1.6;
}

.message-body > *:first-child {
  margin-top: 0;
}

.message-body > *:last-child {
  margin-bottom: 0;
}

/* Headers */
.message-body h1,
.message-body h2,
.message-body h3,
.message-body h4,
.message-body h5,
.message-body h6 {
  margin: 20px 0 12px 0;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.message-body h1 { font-size: 22px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.message-body h2 { font-size: 20px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.message-body h3 { font-size: 18px; }
.message-body h4 { font-size: 16px; }
.message-body h5 { font-size: 15px; }
.message-body h6 { font-size: 14px; color: var(--muted); }

/* Paragraphs */
.message-body p {
  margin: 12px 0;
}

/* Links */
.message-body a {
  color: #78b4ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(120, 180, 255, 0.3);
  transition: border-color 0.2s;
}

.message-body a:hover {
  border-bottom-color: #78b4ff;
}

/* Inline Code */
.message-body .inline-code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, Inconsolata, 'Fira Code', monospace;
  font-size: 0.9em;
  color: #f0f0f0;
}

/* Code Blocks */
.code-block-wrapper {
  margin: 16px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-language {
  font-size: 12px;
  color: var(--muted);
  text-transform: lowercase;
  font-family: 'SF Mono', Monaco, monospace;
}

.copy-code-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-code-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.copy-code-btn.copied {
  background: rgba(74, 222, 128, 0.2);
  border-color: rgba(74, 222, 128, 0.4);
  color: #4ade80;
}

.copy-code-btn svg {
  opacity: 0.7;
}

.code-block-wrapper pre {
  margin: 0;
  padding: 12px 16px;
  overflow-x: auto;
  background: #0d1117;
}

.code-block-wrapper code {
  font-family: 'SF Mono', Monaco, Inconsolata, 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.7 !important;
  background: transparent;
  padding: 0;
}

/* Line Numbers */
.hljs-ln {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.hljs-ln td {
  padding: 2px 0 !important;
  border: none !important;
  background: transparent !important;
  line-height: 1.8 !important;
}

.hljs-ln-code {
  line-height: 1.8 !important;
}

.hljs-ln-code .hljs-ln-line {
  line-height: 1.8 !important;
  display: block;
}

.hljs-ln-numbers {
  user-select: none;
  text-align: right;
  color: var(--muted);
  padding-right: 16px !important;
  padding-left: 0 !important;
  width: 1%;
  min-width: 32px;
  opacity: 0.4;
  font-size: 12px;
}

/* Ensure code blocks don't look like tables */
.code-block-wrapper table,
.code-block-wrapper tbody,
.code-block-wrapper tr,
.code-block-wrapper td {
  border: none !important;
  background: transparent !important;
}

/* Override any highlight.js inline styles */
.code-block-wrapper .hljs {
  line-height: 1.8 !important;
}

.code-block-wrapper .hljs-line {
  line-height: 1.8 !important;
  padding: 2px 0 !important;
  margin: 0 !important;
}

.hljs-ln-code {
  padding-left: 12px !important;
}

/* Tables */
.message-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.message-body th,
.message-body td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.message-body th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

.message-body tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

/* Override zebra striping for code blocks - ChatGPT/Claude style */
.code-block-wrapper .hljs-ln tr:nth-child(even) {
  background: transparent !important;
}

/* Blockquotes */
.message-body blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 3px solid #78b4ff;
  background: rgba(120, 180, 255, 0.05);
  border-radius: 0 8px 8px 0;
}

.message-body blockquote p {
  margin: 0;
  color: var(--muted);
}

/* Lists */
.message-body ul,
.message-body ol {
  margin: 12px 0;
  padding-left: 24px;
}

.message-body li {
  margin: 6px 0;
}

.message-body ul ul,
.message-body ol ol,
.message-body ul ol,
.message-body ol ul {
  margin: 4px 0;
}

/* Horizontal Rule */
.message-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* Strong and Emphasis */
.message-body strong {
  font-weight: 600;
  color: var(--text);
}

.message-body em {
  font-style: italic;
}

.message-body del,
.message-body s {
  text-decoration: line-through;
  opacity: 0.6;
}

/* Images */
.message-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
}

/* Streaming Indicator */
.streaming-indicator {
  display: flex;
  gap: 3px;
  align-items: center;
}

.typing-dot {
  width: 5px;
  height: 5px;
  background: var(--muted);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

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

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.message.streaming .message-body {
  min-height: 40px;
}

/* Ensure syntax highlighting doesn't break layout */
.hljs {
  display: block;
  overflow-x: auto;
  padding: 0;
  background: transparent;
  color: #c9d1d9;
}
