* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1e2a44, #050b1a);
  color: white;
}

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

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #081629, #020716);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar h1 {
  margin: 0 0 10px 0;
  font-size: 26px;
  background: linear-gradient(135deg, #2965f1, #5e9aff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar p {
  font-size: 14px;
  color: #9aa4b6;
  margin: 0 0 5px 0;
}

.sidebar small {
  color: #5f6d84;
  display: inline-block;
  padding: 4px 8px;
  background: rgba(41, 101, 241, 0.2);
  border-radius: 4px;
  font-size: 11px;
  margin-top: 10px;
}

.main {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat {
  flex: 1;
  background: linear-gradient(180deg, #030812, #01040b);
  border-radius: 18px;
  padding: 30px;
  overflow-y: auto;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  max-width: 80%;
  padding: 16px 20px;
  border-radius: 16px;
  line-height: 1.6;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.message.user {
  background: #2965f1;
  align-self: flex-end;
  margin-left: auto;
  box-shadow: 0 4px 12px rgba(41, 101, 241, 0.3);
}

.message.assistant {
  background: #1b273a;
  margin-right: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.message.assistant h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #5e9aff;
  border-bottom: 1px solid rgba(94, 154, 255, 0.3);
  padding-bottom: 8px;
}

.message.assistant ul,
.message.assistant ol {
  margin: 8px 0;
  padding-left: 24px;
}

.message.assistant li {
  margin: 6px 0;
}

.message.assistant code {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: #5e9aff;
}

.message.assistant pre {
  background: rgba(0, 0, 0, 0.5);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 12px 0;
  border-left: 3px solid #2965f1;
}

.message.assistant pre code {
  background: none;
  padding: 0;
  color: #e0e0e0;
}

.message.loading {
  background: #1b273a;
  margin-right: auto;
  display: flex;
  gap: 6px;
  padding: 16px 20px;
  max-width: 80px;
}

.loading-dot {
  width: 8px;
  height: 8px;
  background: #5e9aff;
  border-radius: 50%;
  animation: pulse 1.4s infinite;
}

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

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

@keyframes pulse {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.input-area {
  display: flex;
  margin-top: 20px;
  gap: 10px;
}

.input-area input {
  flex: 1;
  border-radius: 14px;
  border: 2px solid rgba(41, 101, 241, 0.3);
  padding: 14px 16px;
  font-size: 16px;
  background: rgba(3, 8, 18, 0.6);
  color: white;
  transition: border-color 0.3s;
}

.input-area input:focus {
  outline: none;
  border-color: #2965f1;
}

.input-area input::placeholder {
  color: #5f6d84;
}

.input-area button {
  background: linear-gradient(135deg, #2965f1, #1e4fc4);
  border: none;
  color: white;
  padding: 14px 28px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.input-area button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(41, 101, 241, 0.4);
}

.input-area button:active {
  transform: translateY(0);
}

.input-area button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.chat::-webkit-scrollbar {
  width: 8px;
}

.chat::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.chat::-webkit-scrollbar-thumb {
  background: rgba(41, 101, 241, 0.5);
  border-radius: 4px;
}

.chat::-webkit-scrollbar-thumb:hover {
  background: rgba(41, 101, 241, 0.7);
}