/* ====================================
   Search Page Styles
   ==================================== */

/* Search Container */
.search-container {
  padding: 2rem 1rem;
}

/* Search Section */
#search-section {
  text-align: center;
  margin-bottom: 3rem;
}

.search-header h1 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  color: var(--primary-base, #1e293b);
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  line-height: 1.3;
}

.search-subtitle {
  font-size: 1.1rem;
  color: var(--secondary-text, #334155);
  margin-bottom: 2rem;
  font-family: 'Roboto', sans-serif;
}

/* Search Form */
.search-input-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch;
  gap: 1rem;
  max-width: 700px;
  margin: 0 auto;
}

.search-input {
  flex: 1 !important;
  width: auto !important;
  min-height: 50px;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0 !important;
}

.search-button {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 120px;
  min-height: 50px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0 !important;
}

.search-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.search-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Loading State */
.loading-state {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Results Section */
#results-section {
  margin-top: 2rem;
}

/* Confidence Banner - positioned after answer, before sources */
.confidence-banner {
  background: #e7f3ff;
  border: 1px solid #b3d9ff;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--secondary-text, #334155);
  font-size: 0.95rem;
  font-style: italic;
}

.confidence-banner i {
  font-size: 1.25rem;
  color: var(--accent-blue, #007acc);
  flex-shrink: 0;
}

/* Answer Container */
.answer-container {
  background: transparent;
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.answer-container h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--primary-base, #1e293b);
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  line-height: 1.3;
}

.answer-text {
  font-size: 1rem;
  line-height: 1.7;
  word-wrap: break-word;
}

.answer-text p {
  margin-bottom: 1rem;
}

.answer-text p:last-child {
  margin-bottom: 0;
}

.answer-text ul,
.answer-text ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.answer-text li {
  margin-bottom: 0.5rem;
}

.answer-text strong {
  font-weight: 600;
  color: var(--primary-base, #1e293b);
}

.answer-text em {
  font-style: italic;
}

.answer-text h1,
.answer-text h2,
.answer-text h3,
.answer-text h4 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary-base, #1e293b);
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  line-height: 1.3;
}

.answer-text h1:first-child,
.answer-text h2:first-child,
.answer-text h3:first-child,
.answer-text h4:first-child {
  margin-top: 0;
}

/* Sources Container */
.sources-container {
  margin-top: 2rem;
}

.source-count {
  font-size: 0.9rem;
  color: var(--secondary-text);
  font-weight: normal;
}

/* Empty Results */
.empty-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted-color);
}

.empty-results i {
  opacity: 0.5;
}

.empty-results p {
  margin: 0.5rem 0;
}

/* Error Section */
#error-section {
  margin-top: 2rem;
}

.error-message {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 1rem;
  color: #721c24;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.error-message i {
  font-size: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .search-container {
    padding: 1rem 0.5rem;
  }

  .search-header h1 {
    font-size: 2rem;
  }

  .search-subtitle {
    font-size: 1rem;
  }

  .search-input-group {
    flex-direction: column !important;
  }

  .search-button {
    width: 100% !important;
    flex: 1 1 auto !important;
  }

  .answer-container {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .search-header h1 {
    font-size: 1.75rem;
  }

  .search-subtitle {
    font-size: 0.95rem;
  }
}
