*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DM Mono', monospace;
  background: #0d0d0f;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 255, 180, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 180, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.chat-container {
  width: 420px;
  height: 620px;
  background: #13141a;
  border: 1px solid rgba(0, 255, 180, 0.2);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(0, 255, 180, 0.04),
    0 30px 80px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(0, 255, 180, 0.04) inset;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: rise 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header */
.header {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 255, 180, 0.02);
}

.header-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ffb4;
  box-shadow: 0 0 8px #00ffb4;
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 8px #00ffb4;
  }

  50% {
    opacity: 0.6;
    box-shadow: 0 0 16px #00ffb4;
  }
}

.header-title {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
  flex: 1;
}

.header-status {
  font-size: 10px;
  color: #00ffb4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* Chat area */
#chat {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

#chat::-webkit-scrollbar {
  width: 4px;
}

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

#chat::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

/* Messages */
.message {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  animation: msgIn 0.25s ease;
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  align-self: flex-end;
  background: rgba(0, 255, 180, 0.12);
  border: 1px solid rgba(0, 255, 180, 0.2);
  color: #e8fff8;
  border-bottom-right-radius: 3px;
}

.message.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
  border-bottom-left-radius: 3px;
}

/* Typing indicator */
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  border-bottom-left-radius: 3px;
  width: fit-content;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #00ffb4;
  opacity: 0.4;
  animation: dot 1.2s infinite;
}

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

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

@keyframes dot {

  0%,
  80%,
  100% {
    opacity: 0.2;
    transform: scale(0.8);
  }

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

/* Input area */
.input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

#messageInput {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: #e0e0e0;
  transition: border-color 0.2s;
}

#messageInput::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

#messageInput:focus {
  outline: none;
  border-color: rgba(0, 255, 180, 0.35);
  background: rgba(0, 255, 180, 0.03);
}

#sendBtn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: #00ffb4;
  color: #0d0d0f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}

#sendBtn:hover {
  background: #33ffc4;
}

#sendBtn:active {
  transform: scale(0.93);
}

#sendBtn:disabled {
  background: rgba(0, 255, 180, 0.2);
  cursor: not-allowed;
}