/* Main Styles */
body {
  min-height: 100vh;
}

/* Search Page Styles */

.search-page {
  max-width: 1280px; /* Centers content within reasonable width */
  padding: 32px 16px 120px 16px; /* Prevent overlap with fixed input */
}

/* Conversation Container */
.conversation-container {
  /* NEW: stack messages vertically like chat */
  /* display: flex;
  flex-direction: column;
  gap: 12px; */
  display: block;
}

.chat-container {
  display: flex;
  flex-direction: column;
  max-width: 640px;
  align-self: center;
  margin: 0 auto 12px auto;
}

/* --- Chat Bubbles --- */
.chat-message {
  padding: 12px 16px;
  border: none; /* remove divider */
  border-radius: 16px;
  font-size: 1rem;
  line-height: 1.4;
  max-width: 80%;
  /* add subtle shadow */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* AI bubble aligned to left */
.ai-message {
  align-self: flex-start;
  background: var(--card-bg);
  color: var(--text-color);
  border-top-left-radius: 0;
  border: 1px solid var(--border-color);
}

/* User bubble aligned to right */
.user-message {
  align-self: flex-end;
  background: var(--primary-color);
  color: white;
  font-weight: 600;
  border-top-right-radius: 0;
}

/* Remove text centering inside bubbles */
.chat-message p {
  margin: 0;
  text-align: left;
  font-size: 1rem;
}

.chat-message strong {
  margin-right: 0.5rem;
}

.ai-message p {
  color: var(--text-color);
}

.user-message p {
  font-weight: 600;
  color: white;
}

/* Results Grid - Styles moved to styles.css */

/* Loading indicator for infinite scroll */
.loading-more-results {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 20px 0;
}

.loading-more-results i {
  margin-right: 8px;
  color: var(--primary-color);
}

/* --- Enhanced Chat Input Bar --- */
.chat-input {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-color);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.05);
  padding: 6px 6px;
  z-index: 1030; /* Above other elements */
  /* for mobile devices */
  padding-bottom: max(12px, env(safe-area-inset-top));
  transition: background-color 0.3s ease;
}

.chat-input .input-group {
  max-width: 700px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-input .form-control {
  height: 64px;
  font-size: 1.25rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  background-color: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-color);
  border-right: none;
  border-radius: 0;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.chat-input .form-control:focus {
  background-color: var(--card-bg);
  border-color: var(--primary-color);
  color: var(--text-color);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.chat-input .btn {
  height: 64px;
  min-width: 64px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 8px 8px 0;
}

/* --- Simple fade-in animation for chat messages --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeInUp 0.25s ease-out;
}

/* Loading (typing) bubble animation */
@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

.chat-message.ai-message.loading p::after {
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: dots 1s steps(5, end) infinite;
  content: '';
}



@media (max-width: 500px) {
  .chat-input .form-control {
    font-size: 1rem;
    padding-left: 0.2rem;
    padding-right: 0.5rem;
  }
}

