/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', 'Arial', sans-serif;
}

body {
  height: 100%;
  background: linear-gradient(180deg, #0f0f0f, #151515);
 /* background-image: url('/images/bg.jpg');
  background-position: center;
  background-attachment: fixed; 
  background-size: cover; */ 
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
}

/* Container */
.chat-container {
  width: 100%;
  max-width: 520px;
  height: 92vh;
 /* background: #111; */
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: #111;
  border-bottom: 1px solid #333;
  flex-wrap: wrap;
  position: relative;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 120px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-right button,
.nav-right a,
.nav-center select {
  background: none;
  border: 1px solid #444;
  color: #aaa;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}

.nav-right button:hover,
.nav-right a:hover,
.nav-center select:hover {
  background: #222;
  color: #fff;
}

.logo {
  height: 28px;
  object-fit: contain;
}

/* Toggle button for small screens */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid #444;
  color: #aaa;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
}

/* Responsive for screens < 600px */
@media (max-width: 600px) {
  .nav-right,
  .nav-center {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
  }

  .nav-toggle {
    display: block;
  }

  .navbar.active .nav-right,
  .navbar.active .nav-center {
    display: flex;
  }
}

.logo {
  height: 26px;
  opacity: 0.9;
}

.nav-actions {
  display: flex;
  gap: 10px;
}

.nav-actions button,
.nav-actions a {
  background: #141414;
  border: 1px solid #2a2a2a;
  color: #ccc;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-actions button:hover,
.nav-actions a:hover {
  background: #1e1e1e;
  color: #fff;
}

/* Chat area */
.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

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

.chat-messages::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 10px;
}

/* Messages */
.message {
  padding: 10px 14px;
  border-radius: 16px;
  max-width: 85%;
  font-size: 0.5rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #1c3f7a, #162f5a);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ai {
  align-self: flex-start;
  background: #1b1b1b;
  color: #eee;
  border-bottom-left-radius: 4px;
}

/* Markdown styling */
.message.ai h1,
.message.ai h2,
.message.ai h3 {
  margin: 6px 0;
  font-weight: 600;
}

.message.ai p {
  margin: 6px 0;
}

.message.ai code {
  background: #0f0f0f;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.8rem;
}

.message.ai pre {
  background: #0f0f0f;
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.8rem;
}

/* Typing indicator */
.typing {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: #1b1b1b;
  border-radius: 16px;
}

.typing span {
  width: 7px;
  height: 7px;
  background: #888;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.typing span:nth-child(1) { animation-delay: -0.32s; }
.typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Input */
#chat-form {
  display: flex;
  padding: 10px;
  background: #0d0d0d;
  border-top: 1px solid #222;
}

#user-input {
  flex: 1;
  padding: 12px 14px;
  background: #111;
  border: 1px solid #222;
  color: #fff;
  border-radius: 14px;
  outline: none;
  font-size: 14px;
}

#user-input::placeholder {
  color: #777;
}

#chat-form button {
  margin-left: 8px;
  padding: 12px 16px;
  background: #1c3f7a;
  border: none;
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

#chat-form button:hover {
  background: #2550a0;
}

/* Mobile */
@media (max-width: 480px) {
  .chat-container {
    height: 100vh;
    border-radius: 0;
  }
}
.user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #ccc;
}

.user-profile img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
#new-chat {
  background-color: transparent;
  border: 1px solid purple;
  color: white;
  padding: 3px;
  border-radius: 10px;
}