* {
  box-sizing: border-box;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  margin: 0;
  background: radial-gradient(1200px 800px at 50% 0%, #1e293b 0%, #020617 60%);
  color: #e5e7eb;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

/* Chat shell */
.chat-container {
  width: 100%;
  max-width: 520px;
  height: 88vh;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.15);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Header */
.chat-header {
  padding: 18px 20px;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.9),
    rgba(2, 6, 23, 0.9)
  );
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h1 {
  font-size: 15px;
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.3px;
}

#status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
}

/* Messages */
.chat-messages {
  flex: 1;
  padding: 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Message bubbles */
.message {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.55;
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* User bubble */
.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border-bottom-right-radius: 6px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

/* AI bubble */
.message.ai {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.9);
  color: #e5e7eb;
  border-bottom-left-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* Input area */
.chat-input {
  display: flex;
  gap: 10px;
  padding: 14px;
  background: rgba(2, 6, 23, 0.9);
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

/* Text input */
.chat-input input {
  flex: 1;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 14px;
  color: #e5e7eb;
  outline: none;
  font-size: 14px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.chat-input input::placeholder {
  color: #64748b;
}

.chat-input input:focus {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Send button */
.chat-input button {
  padding: 0 18px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  border-radius: 14px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.chat-input button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.55);
}

.chat-input button:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

/* Thinking indicator animation */
.message.thinking {
  display: flex;
  gap: 4px;
  justify-content: flex-start;
  align-items: center;
  width: 50px;
  padding: 8px 12px;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.9);
  color: #e5e7eb;
}

.message.thinking .dot {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: blink 1.4s infinite both;
}

.message.thinking .dot:nth-child(1) {
  animation-delay: 0s;
}
.message.thinking .dot:nth-child(2) {
  animation-delay: 0.2s;
}
.message.thinking .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
}
