/* Base Styles */
body {
  font-family: Arial, sans-serif;
  margin: 20px;
  background-color: #fdfdfd;
}

/* Header Styles */
.page-header {
  background-color: #f0f0f0;
  padding: 10px 20px;
  border-bottom: 1px solid #ccc;
}
.header-content {
  display: flex;
  align-items: center;
}
.logo-placeholder {
  margin-right: 20px;
}
.logo {
  width: 50px;
  height: 50px;
}
.page-header h1 {
  font-size: 1.8em;
  margin: 0;
}

/* Generate Analysis Button */
.generate-container {
  text-align: center;
  margin: 20px auto;
}
.generate-container button {
  padding: 10px 20px;
  font-size: 1em;
  border: none;
  background-color: #28a745;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}
.generate-container button:hover {
  background-color: #218838;
}

/* Spinner and Live Indicator */
#spinner,
#liveIndicator {
  text-align: center;
  margin-top: 20px;
}

/* Pulse Dot for Live Indicator */
.pulse-dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: #007bff;
  border-radius: 50%;
  margin-left: 5px;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Copy Button */
.copy-button {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  background-color: #215286;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.copy-button:hover {
  background-color: #0056b3;
}

/* Inline Search Containers */
.search-container-inline {
  display: flex;
  gap: 40px; /* Increased space between search boxes */
  justify-content: center;
  margin: 30px auto;
}
.search-container-inline .search-container {
  flex: 1;
  max-width: 450px; /* Wider search boxes */
}

/* Individual Search Container */
.search-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
}
.search-container label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
}
.search-container input {
  width: 100%;
  padding: 14px; /* Larger input padding */
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

/* Auto-Suggestions */
.autocomplete-suggestions {
  position: absolute;
  top: 110%; /* Slightly below input */
  left: 0;
  right: 0;
  border: 1px solid #ccc;
  background: #f8ffea;
  z-index: 1000;
  max-height: 300px; /* Taller suggestion box */
  overflow-y: auto;
  font-size: 1rem;
}
.autocomplete-suggestion {
  padding: 10px;
  cursor: pointer;
}
.autocomplete-suggestion:hover {
  background-color: #f0f0f0;
}

/* Results Container */
#result {
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
  margin: 20px auto;
  border: 0.2px solid #ccc;
  border-radius: 4px;
  width: 90%;        /* Wider container */
  max-width: 1200px;
  white-space: pre-wrap;
}

/* Rendered Narrative Content */
.narrative-content {
  font-family: Arial, sans-serif;
  line-height: 1.3; /* Tighter line spacing */
  white-space: pre-wrap;
}
.narrative-content h1 {
  font-size: 2em;
  margin-bottom: 0.4em;
}
.narrative-content h2 {
  font-size: 1.2em;
  margin-bottom: 0.4em;
}
.narrative-content h3 {
  font-size: 1em;
  margin-bottom: 0.4em;
}
.narrative-content p {
  margin-bottom: 0.6em;
}
.narrative-content ul,
.narrative-content ol {
  margin-left: 20px;
  margin-bottom: 0.6em;
}
