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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
  background: #0f0f0f;
  color: #ffffff;
  overflow: hidden;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 800px;
  margin: 0 auto;
  background: #0f0f0f;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  height: 64px;
}

.header-left, .header-right {
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.infinity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2d5f4f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
}

.menu-icon {
  font-size: 24px;
  color: #808080;
}

.header-center {
  flex: 1;
  text-align: center;
}

.header-title {
  font-size: 18px;
  font-weight: bold;
  color: #ffffff;
}

.header-subtitle {
  font-size: 12px;
  color: #808080;
  margin-top: 2px;
}

/* Messages */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #0f0f0f;
}

.messages-inner {
  max-width: 100%;
}

.message-wrapper {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.system-wrapper {
  align-items: center;
}

.user-wrapper {
  align-items: flex-start;
}

.assistant-wrapper {
  align-items: flex-end;
}

.message-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 600;
}

.system-label {
  color: #808080;
}

.user-label {
  color: #b0b0b0;
  padding-left: 8px;
}

.assistant-label {
  color: #90c9b0;
  padding-right: 8px;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 75%;
  line-height: 1.5;
  font-size: 15px;
  word-wrap: break-word;
}

.system-bubble {
  background: #404040;
  color: #d0d0d0;
  opacity: 0.9;
  max-width: 90%;
  text-align: center;
  font-size: 14px;
}

.user-bubble {
  background: #f0f0f0;
  color: #1a1a1a;
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.assistant-bubble {
  background: #2d5f4f;
  color: #ffffff;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #808080;
  font-size: 14px;
  padding-left: 8px;
  margin-bottom: 16px;
}

.typing-dots {
  display: inline-flex;
  gap: 2px;
}

.typing-dots span {
  animation: typingDot 1.4s infinite;
}

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

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

@keyframes typingDot {
  0%, 60%, 100% {
    opacity: 0.3;
  }
  30% {
    opacity: 1;
  }
}

/* Composer */
.composer-container {
  background: #1a1a1a;
  border-top: 1px solid #2a2a2a;
  padding: 12px 16px 16px;
}

.composer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.info-text {
  font-size: 12px;
  color: #808080;
  flex: 1;
}

.new-chat-btn {
  background: transparent;
  border: 1px solid #404040;
  color: #b0b0b0;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.new-chat-btn:hover {
  background: #2a2a2a;
  border-color: #505050;
  color: #ffffff;
}

.composer-input-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #252525;
  border-radius: 12px;
  padding: 8px;
}

.composer-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 16px;
  font-family: inherit;
  resize: none;
  outline: none;
  padding: 8px;
  max-height: 150px;
  min-height: 24px;
}

.composer-textarea::placeholder {
  color: #606060;
}

.composer-textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.send-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #2d5f4f;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-button:hover:not(.disabled) {
  background: #3a7a63;
  transform: scale(1.05);
}

.send-button.disabled {
  background: #404040;
  color: #606060;
  cursor: not-allowed;
  opacity: 0.5;
}

/* Footer */
.footer {
  text-align: center;
  padding: 8px 16px;
  background: #0f0f0f;
  border-top: 1px solid #1a1a1a;
}

.footer-link {
  font-size: 12px;
  color: #606060;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover {
  color: #808080;
}

/* Scrollbar */
.messages-container::-webkit-scrollbar {
  width: 8px;
}

.messages-container::-webkit-scrollbar-track {
  background: #0f0f0f;
}

.messages-container::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
}

/* Responsive */
@media (max-width: 640px) {
  .header-subtitle {
    font-size: 11px;
  }

  .message-bubble {
    max-width: 85%;
    font-size: 14px;
  }

  .composer-info {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .info-text {
    text-align: center;
  }

  .new-chat-btn {
    width: 100%;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .messages-container {
    padding: 20px;
  }

  .composer-container {
    padding: 16px 20px 20px;
  }
}

@media (min-width: 1025px) {
  .messages-container {
    padding: 24px;
  }

  .composer-container {
    padding: 16px 24px 20px;
  }

  .send-button:hover:not(.disabled) {
    transform: scale(1.1);
  }
}