@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Space+Grotesk:wght@400;600&display=swap');

:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e232d;
  --text: #eef1f6;
  --muted: #9aa3b2;
  --accent: #ff7a5c;
  --accent-2: #5ad4e6;
  --stroke: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 122, 92, 0.18), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(90, 212, 230, 0.2), transparent 40%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--accent), #ffb88f);
  display: grid;
  place-items: center;
  color: #0f1115;
  font-weight: 700;
}

.title {
  font-size: 20px;
  font-weight: 600;
}

.subtitle {
  font-size: 13px;
  color: var(--muted);
}

.status {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  font-size: 12px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 2.2fr 1.2fr;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border-radius: 18px;
  border: 1px solid var(--stroke);
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  animation: fadeIn 0.6s ease;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel h2 {
  margin: 0;
  font-size: 16px;
}

.ghost {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  flex: 1;
  overflow-y: auto;
}

.project-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid transparent;
  cursor: pointer;
  transition: border 0.2s ease, transform 0.2s ease;
}

.project-item.active {
  border-color: var(--accent);
  transform: translateX(4px);
}

.project-create {
  display: flex;
  gap: 8px;
}

.project-create input {
  flex: 1;
  background: #0f1115;
  border: 1px solid var(--stroke);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
}

.project-create button {
  background: var(--accent);
  border: none;
  color: #0f1115;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.chat {
  min-height: 600px;
}

.chat-window {
  flex: 1;
  background: #0d0f14;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--stroke);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  padding: 12px 14px;
  border-radius: 14px;
  max-width: 85%;
  line-height: 1.4;
  font-size: 14px;
  white-space: pre-wrap;
}

.message.user {
  align-self: flex-end;
  background: rgba(255, 122, 92, 0.2);
  border: 1px solid rgba(255, 122, 92, 0.4);
}

.message.bot {
  align-self: flex-start;
  background: rgba(90, 212, 230, 0.18);
  border: 1px solid rgba(90, 212, 230, 0.35);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
}

.chat-input {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.chat-input input {
  flex: 1;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #0f1115;
  color: var(--text);
  padding: 10px 12px;
}

.chat-input button {
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  background: var(--accent-2);
  color: #0f1115;
  font-weight: 600;
  cursor: pointer;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--stroke);
  color: var(--muted);
}

.help {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.model-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}

.model-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5f6775;
  box-shadow: 0 0 0 4px rgba(95, 103, 117, 0.15);
}

.dot.online {
  background: #36d37a;
  box-shadow: 0 0 0 4px rgba(54, 211, 122, 0.25);
}

.dot.loading {
  background: #f7b955;
  box-shadow: 0 0 0 4px rgba(247, 185, 85, 0.25);
}

.model-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.model-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #0f1115;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}

.model-btn.active {
  border-color: var(--accent-2);
  color: var(--accent-2);
  background: rgba(90, 212, 230, 0.12);
}

.code {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent-2);
}

.tree {
  flex: 1;
  background: #0d0f14;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--stroke);
  overflow: auto;
  font-size: 12px;
  color: #dbe0ea;
}

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

@media (max-width: 1080px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: auto;
  }
}
