@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Tinos:wght@400;700&display=swap');

:root {
  --dark-bg: #2d2f34;
  --chat-bg: #343541;
  --sidebar-bg: #202123;
  --user-bubble: #40414f;
  --ai-bubble: #343541;
  --text-white: #ececf1;
  --text-light-gray: #a4a4b0;
  --input-bg: #40414f;
  --send-btn-color: #555660;
  --send-btn-hover: #7b7d87;
  --copy-btn-bg: #555660;
  --copy-btn-hover: #7b7d87;
}

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

body {
  font-family: 'Tinos', serif;
  background: var(--chat-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 0;
  color: var(--text-white);
}

.chat-container {
  width: 100%;
  max-width: 900px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--chat-bg);
  box-shadow: none;
  border-radius: 0;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--chat-bg);
  color: var(--text-white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header h2 {
  font-weight: 700;
  font-size: 1.5rem;
}

.new-chat-btn {
  padding: 8px 12px;
  background: #505058;
  border: none;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s;
}

.new-chat-btn:hover {
  background-color: #60606b;
}

.model-selector {
  padding: 12px 20px;
  background: var(--chat-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-white);
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#model-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background-color: var(--sidebar-bg);
  color: var(--text-white);
  outline: none;
  cursor: pointer;
}

.chat-window {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px 20px 100px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  scroll-behavior: smooth;
}

/* Message Bubbles */
.message-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
}

.message-container.user {
  align-items: flex-end;
}

.message {
  max-width: 70%;
  padding: 12px 18px;
  border-radius: 12px;
  word-wrap: break-word;
  line-height: 1.5;
  position: relative;
}

.user-message .message-text {
  background-color: var(--user-bubble);
  color: var(--text-white);
}

.ai-message .message-text {
  background-color: var(--ai-bubble);
  color: var(--text-white);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-message .message-text p {
  margin: 0;
}

.ai-message.typing .message-text::after {
  content: '...';
  animation: blink 1s infinite;
}

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

.copy-btn {
  position: absolute;
  right: 10px;
  top: -30px;
  background: var(--copy-btn-bg);
  border: none;
  color: var(--text-white);
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.message-container:hover .copy-btn {
  opacity: 1;
}

.chat-form-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(to top, rgba(52, 53, 65, 1), rgba(52, 53, 65, 0));
}

.chat-form {
  display: flex;
  width: 100%;
  max-width: 700px;
  background: var(--input-bg);
  border-radius: 12px;
  border: 1px solid var(--border-glass);
}

#user-input {
  flex-grow: 1;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  background: transparent;
  color: var(--text-white);
  resize: none;
  overflow: hidden;
  max-height: 200px;
}

#user-input::placeholder {
  color: var(--text-light-gray);
}

#send-btn {
  background: transparent;
  border: none;
  color: var(--send-btn-color);
  padding: 0 15px;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
}

#send-btn:hover {
  color: var(--send-btn-hover);
}

@media (max-width: 768px) {
  .chat-container {
    height: 100vh;
    border-radius: 0;
  }
  .message {
    max-width: 85%;
  }
  .chat-form {
    border-radius: 12px;
  }
}
