:root {
  --primary-color: #4f46e5;
  --primary-light: #eef2ff;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --background: #ffffff;
  --background-alt: #f9fafb;
  --border-color: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius: 12px;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-color);
  background-color: var(--background);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

.logo a {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s ease-in-out;
}

.logo a:hover {
  color: var(--primary-color);
}

.logo-icon {
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon {
  stroke: currentColor;
}

h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary-color);
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.tagline {
  color: var(--text-light);
  font-size: 14px;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--background-alt);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
  padding-bottom: 80px;
}

.message {
  display: flex;
  margin-bottom: 12px;
  max-width: 100%;
}

.message.user {
  justify-content: flex-end;
}

.message.bot {
  justify-content: flex-start;
}

.message-content {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  white-space: pre-line;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.message.bot .message-content {
  background-color: white;
  border: 1px solid var(--border-color);
  margin-right: auto;
}

.message.user .message-content {
  background-color: var(--primary-color);
  color: white;
  margin-left: auto;
}

.message p {
  margin: 0;
}

/* Fixed input container at bottom */
.chat-input-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--background-alt);
  border-top: 1px solid var(--border-color);
  padding: 12px;
  z-index: 10;
}

/* New styles for the input container group */
.input-container-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-input-container {
  display: flex;
  align-items: center;
  background-color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0 8px;
  flex: 1;
}

/* Group the icons together */
.input-icons {
  display: flex;
  align-items: center;
}

.input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

#user-input {
  flex: 1;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  background-color: transparent;
}

#user-input:focus {
  border-color: var(--primary-color);
}

/* Input waveform for audio recording */
.input-waveform {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 16px;
  background-color: white;
  border-radius: var(--radius);
  z-index: 1;
}

.input-waveform.hidden {
  display: none;
}

.waveform-bar {
  width: 3px;
  height: 15px;
  background-color: var(--primary-color);
  border-radius: 1px;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% {
    height: 5px;
  }
  50% {
    height: 15px;
  }
}

#send-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius);
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.2s;
  flex-shrink: 0;
}

#send-button:hover {
  background-color: #4338ca;
  transform: translateY(-1px);
}

#send-button:active {
  transform: translateY(1px);
}

/* Scroll to bottom button */
.scroll-to-bottom-btn {
  position: absolute;
  right: 20px;
  bottom: 80px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  border: none;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: opacity 0.3s, transform 0.3s;
}

.scroll-to-bottom-btn:hover {
  transform: translateY(-2px);
}

.scroll-to-bottom-btn.hidden {
  opacity: 0;
  pointer-events: none;
}

.suggestions {
  margin-top: 24px;
}

.suggestions p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-chip {
  background-color: var(--primary-light);
  color: var(--primary-color);
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.suggestion-chip:hover {
  background-color: #dfe7ff;
  transform: translateY(-1px);
}

.suggestion-chip:active {
  transform: translateY(1px);
}

footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
}

/* Loading animation */
.typing-indicator {
  display: flex;
  padding: 12px 16px;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: fit-content;
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  background-color: var(--text-light);
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
  animation: bounce 1.5s infinite ease-in-out;
}

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

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
  margin-right: 0;
}

@keyframes bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-4px);
  }
}

/* Icon buttons styling */
.icon-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  border-radius: var(--radius);
  transition: color 0.2s, background-color 0.2s, transform 0.2s;
}

.icon-button:hover {
  color: var(--primary-color);
  background-color: var(--primary-light);
  transform: translateY(-1px);
}

.icon-button:active {
  transform: translateY(1px);
}

/* Message content bullet points */
.message-content ul {
  margin: 8px 0;
  padding-left: 24px;
  list-style: none;
}

.message-content li {
  position: relative;
  margin-bottom: 4px;
}

.message-content li::before {
  content: "•";
  color: var(--primary-color);
  position: absolute;
  left: -15px;
}

/* Responsive design */
@media (max-width: 600px) {
  .container {
    padding: 12px;
    height: 100vh;
  }

  header {
    margin-bottom: 16px;
  }

  .chat-container {
    height: calc(100vh - 180px);
  }

  .message-content {
    max-width: 90%;
  }

  .suggestion-chips {
    justify-content: center;
  }

  .chat-input-wrapper {
    padding: 8px;
  }

  #user-input {
    padding: 10px 12px;
  }
}

/* Camera Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--background);
  padding: 20px;
  border-radius: var(--radius);
  width: 90%;
  max-width: 600px;
}

.camera-interface {
  position: relative;
  width: 100%;
  height: 400px;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}

#camera-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  justify-content: space-between;
}

/* Preview Container */
.preview-container {
  position: relative;
  padding: 10px;
  background: var(--background-alt);
  border-bottom: 1px solid var(--border-color);
}

.preview-container.hidden {
  display: none;
}

.preview-items {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.delete-preview {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

#image-prompt {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-top: 8px;
}

/* Add image preview styling */
.message.user .message-content img {
  max-width: min(100%, 300px);
  height: auto;
  border-radius: 8px;
  margin-top: 8px;
  border: 2px solid var(--primary-light);
}

.message-image {
  max-width: 300px;
  border-radius: 12px;
  margin: 8px 0;
  border: 2px solid var(--primary-light);
  overflow: hidden;
}

.message-image img {
  width: 100%;
  height: auto;
  display: block;
}

.separated-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0;
}

.media-container {
  background: var(--background-alt);
  border-radius: var(--radius);
  padding: 8px;
  margin-top: 8px;
}

/* Highlighting active microphone button when recording */
.icon-button.recording {
  color: var(--primary-color);
  background-color: var(--primary-light);
  animation: pulse 2s infinite;
}

/* Send button transforms to stop button during recording */
#send-button.stop-recording {
  background-color: #ef4444;
}

#send-button.stop-recording:hover {
  background-color: #dc2626;
}

/* Transcribing indicator */
.transcribing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-color);
  font-size: 14px;
}

.transcribing-indicator .dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
  animation: pulse 1.5s infinite ease-in-out;
}

.transcribing-indicator .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.transcribing-indicator .dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Button styles for modal */
.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.btn-primary:hover {
  background-color: #4338ca;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--background);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.btn-secondary:hover {
  background-color: var(--background-alt);
  transform: translateY(-1px);
}