/* === Animated Dark Futuristic Background === */
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0f0f0f, #1a1a1a);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  color: #b6ffdf;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* === Chat Container === */
#chat-container {
  flex: 1 1 auto;
  width: 90%;
  max-width: 860px;
  margin: 20px 0 10px;
  padding: 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 255, 136, 0.2);
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.1);
  overflow-y: auto;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* === Messages === */
.message {
  max-width: 85%;
  padding: 16px 20px;
  border-radius: 20px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  position: relative;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.1);
  transition: transform 0.3s ease;
  font-size: 1rem;
}

.message:hover {
  transform: scale(1.02);
}

.message.user {
  background: rgba(0, 200, 255, 0.2);
  border: 1px solid rgba(0, 200, 255, 0.3);
  color: #a6ffff;
  align-self: flex-end;
  text-align: right;
  box-shadow: 0 0 10px rgba(0, 200, 255, 0.4);
}

.message.assistant {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.2);
  color: #b6ffdf;
  align-self: flex-start;
  text-align: left;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

/* === Code Blocks === */
pre {
  background: #141414;
  color: #00ff88;
  padding: 14px;
  border-radius: 12px;
  overflow-x: auto;
  font-family: 'Fira Code', monospace, monospace;
  font-size: 0.9rem;
  margin-top: 12px;
  position: relative;
  border: 1px solid rgba(0, 255, 136, 0.2);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.2);
}

/* Inline code */
code {
  font-family: 'Fira Code', monospace, monospace;
  background: rgba(0, 255, 136, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
}

/* === Copy Button === */
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 255, 136, 0.8);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  z-index: 2;
}

.copy-btn:hover {
  background: rgba(0, 255, 136, 1);
  transform: scale(1.05);
}

/* === Input Area === */
#prompt {
  width: 90%;
  max-width: 860px;
  min-height: 48px;
  padding: 14px 18px;
  font-size: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #b6ffdf;
  outline: none;
  resize: none;
  backdrop-filter: blur(12px);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
  margin-bottom: 12px;
  transition: box-shadow 0.3s ease;
}

#prompt:focus {
  box-shadow: 0 0 25px rgba(0, 255, 136, 0.6);
}

/* === Send Button === */
#send-btn {
  width: 90%;
  max-width: 860px;
  padding: 14px 0;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  background-color: #00ff88;
  color: #000;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
  transition: background-color 0.3s ease, transform 0.2s ease;
  margin-bottom: 20px;
}

#send-btn:hover {
  background-color: #00cc6a;
  transform: scale(1.05);
}

/* === Responsive tweaks === */
@media (max-width: 480px) {
  #prompt,
  #send-btn,
  #chat-container {
    width: 95%;
  }

  .message {
    max-width: 100%;
  }
}

header {
  width: 90%;
  max-width: 860px;
  margin: 30px auto 10px;
  text-align: center;
  color: #70ffbb;
  font-weight: 600;
  text-shadow: 0 0 12px #00ff88, 0 0 20px #00ff88;
}

header h1 {
  margin-bottom: 8px;
  font-size: 2.4rem;
  letter-spacing: 1.2px;
}

#description {
  font-size: 1.1rem;
  line-height: 1.4;
  max-width: 700px;
  margin: 0 auto;
  color: #aaffcccc;
}

