#semantic-search-process-status {
  max-height: 110px;
  overflow-y: auto;
}

/* Semantic Search Module Styles */
.semantic-search-container {
  display: flex;
  height: calc(100vh - 120px); /* Account for navbar + banner */
  margin-top: 120px; /* Account for navbar (80px) + banner (40px) */
  overflow: hidden;
  background: linear-gradient(135deg, #e0f2fe 0%, #0ea5e9 50%, #0284c7 100%);
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
  gap: 0;
  overflow: hidden; /* Prevent content from being clipped */
}

/* Left Navigation Panel - Hidden to create two-column layout */
.semantic-search-nav-panel {
  display: none;
}

.semantic-search-nav-header {
  padding: 0 1.25rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(2, 132, 199, 0.2);
  margin-bottom: 0.5rem;
}

.semantic-search-nav-title {
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.semantic-search-nav-items {
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.semantic-search-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  font-size: 0.9375rem;
}

.semantic-search-nav-item:hover {
  background: rgba(2, 132, 199, 0.1);
  color: #0284c7;
}

.semantic-search-nav-item.active {
  background: rgba(2, 132, 199, 0.15);
  color: #0284c7;
  border-left-color: #0284c7;
  font-weight: 600;
}

.semantic-search-nav-icon {
  font-size: 1.25rem;
  width: 20px;
  text-align: center;
  opacity: 0.9;
}

.semantic-search-nav-item.active .semantic-search-nav-icon {
  opacity: 1;
}

.semantic-search-nav-label {
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Center Content Area */
.semantic-search-content-area {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

/* Landing View */
.semantic-search-landing-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 4rem 2rem;
}

.semantic-search-landing-content {
  text-align: center;
  max-width: 1000px;
}

.semantic-search-landing-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.semantic-search-landing-description {
  color: #ffffff;
  font-size: 1rem;
  margin-bottom: 2rem;
  font-weight: 400;
  line-height: 1.6;
  opacity: 0.9;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.semantic-search-landing-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

.semantic-search-landing-title {
  color: #ffffff;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: -0.02em;
}

.semantic-search-landing-subtitle {
  color: #ffffff;
  font-size: 1.125rem;
  margin-bottom: 3rem;
  font-weight: 400;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  opacity: 0.95;
}

.semantic-search-landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.semantic-search-feature-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.semantic-search-feature-card:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.35);
}

.semantic-search-feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.semantic-search-feature-card h3 {
  color: #ffffff;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.semantic-search-feature-card p {
  color: #ffffff;
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.6;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* App View */
.semantic-search-app-view {
  padding: 0.5rem;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.semantic-search-app-container {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(440px, 1.5fr) minmax(280px, 1fr);
  gap: 0.5rem;
  height: 100%;
  box-sizing: border-box;
  padding: 0;
}

/* WIP Banner */
.semantic-search-wip-banner {
  position: fixed;
  top: 80px; /* Right below navbar */
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 0.5rem 1rem; /* Reduced padding to make banner smaller */
  text-align: center;
  font-weight: bold;
  font-size: 0.8rem; /* Smaller font */
  z-index: 999;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: 1px;
  text-transform: uppercase;
  height: 40px; /* Fixed height */
  display: flex;
  align-items: center;
  justify-content: center;
}

.semantic-search-wip-banner::before {
  content: "⚠️ ";
  margin-right: 0.5rem;
}

/* Left Sidebar */
.semantic-search-sidebar-left {
  width: 70px;
  background: linear-gradient(180deg, #1e3a8a 0%, #3b82f6 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  gap: 1.5rem;
}

.semantic-search-sidebar-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
}

.semantic-search-sidebar-icon:hover {
  background: rgba(255, 255, 255, 0.2);
}

.semantic-search-sidebar-icon.active {
  background: rgba(255, 255, 255, 0.3);
}

/* Left Panel: Upload & Ingest Documents */
.semantic-search-left-panel {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(2, 132, 199, 0.2);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  color: #0f172a;
  margin: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.semantic-search-middle-panel {
  min-width: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(2, 132, 199, 0.2);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  color: #0f172a;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.semantic-search-middle-panel * {
  color: #0f172a !important;
}

.semantic-search-left-panel * {
  color: inherit;
}

.semantic-search-left-panel .semantic-search-choose-file-btn {
  color: white !important;
}

.semantic-search-left-panel h2,
.semantic-search-left-panel h3,
.semantic-search-left-panel p,
.semantic-search-left-panel span,
.semantic-search-left-panel div:not(.semantic-search-choose-file-btn) {
  color: #0f172a !important;
}

.semantic-search-panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a !important;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.semantic-search-middle-panel .semantic-search-panel-title {
  margin-bottom: 0;
}

/* Right Panel: Search Results */
.semantic-search-right-panel {
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(2, 132, 199, 0.2);
  border-radius: 8px;
  padding: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  color: #0f172a;
  margin: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.semantic-search-section-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.semantic-search-section-title {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* New Upload Zone Style */
.semantic-search-upload-zone-new {
  border: 2px dashed rgba(2, 132, 199, 0.4);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  text-align: center;
  background: rgba(2, 132, 199, 0.05);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 0.25rem;
  position: relative;
}

.semantic-search-upload-zone-new:hover {
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.6);
}

/* Ensure button inside upload zone is clickable */
.semantic-search-upload-zone-new .semantic-search-choose-file-btn {
  pointer-events: auto;
  cursor: pointer;
}

.semantic-search-cloud-icon {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.semantic-search-choose-file-btn {
  display: inline-block;
  background: #1e40af;
  color: white !important;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(30, 64, 175, 0.3);
  letter-spacing: 0.01em;
  pointer-events: auto;
  position: relative;
  z-index: 10;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
}

.semantic-search-choose-file-btn:hover {
  background: #1e3a8a;
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.4);
}

.semantic-search-choose-file-btn:active {
  transform: scale(0.98);
}

.semantic-search-file-info {
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.2);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  color: #0f172a !important;
  margin-top: 0.2rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  flex: 1;
  min-height: 80px;
  max-height: 360px;
  overflow: auto;
}

/* File Source Selection */
.semantic-search-file-source-selection {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  padding: 0.4rem;
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.2);
  border-radius: 8px;
}

.semantic-search-radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #0f172a;
  font-weight: 500;
}

.semantic-search-radio-option input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #0284c7;
}

.semantic-search-radio-option:hover {
  color: #0284c7;
}

/* Existing Files Section */
.semantic-search-existing-files-section {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.2);
  border-radius: 8px;
}

.semantic-search-existing-files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.semantic-search-existing-files-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}

.semantic-search-refresh-files-btn {
  background: #1e40af;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.semantic-search-refresh-files-btn:hover {
  background: #1e3a8a;
}

.semantic-search-existing-files-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.semantic-search-existing-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: white;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 6px;
  transition: all 0.2s;
}

.semantic-search-existing-file-item:hover {
  border-color: rgba(30, 64, 175, 0.3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.semantic-search-existing-file-info {
  flex: 1;
}

.semantic-search-existing-file-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.semantic-search-existing-file-meta {
  font-size: 0.75rem;
  color: #6b7280;
}

.semantic-search-select-file-btn {
  background: #1e40af;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 0.75rem;
}

.semantic-search-select-file-btn:hover {
  background: #1e3a8a;
}

.semantic-search-textarea {
  width: 100%;
  min-height: 120px;
  border-radius: 8px;
  padding: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-size: 1rem;
  background: white;
  font-family: inherit;
}

.semantic-search-textarea:focus {
  outline: none;
  border: 2px solid white;
}

.semantic-search-btn {
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.semantic-search-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.semantic-search-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

.semantic-search-btn-process {
  background: #10b981 !important;
  color: white !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 0.45rem 1rem !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
  margin-top: 0.25rem !important;
  width: 100% !important;
  display: block !important;
}

.semantic-search-btn-process:hover {
  background: #059669 !important;
  transform: translateY(-1px) !important;
}

.semantic-search-btn-process:disabled {
  background: #6b7280 !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
  transform: none !important;
}

.semantic-search-result-card {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  color: white;
  transition: all 0.2s;
}

.semantic-search-result-card:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.semantic-search-error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
  padding: 0.5rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.semantic-search-status {
  color: white;
  padding: 0.5rem;
  border-radius: 6px;
  margin-top: 1rem;
  background: rgba(16, 185, 129, 0.2);
}

.semantic-search-progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.semantic-search-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Processing Steps */
.semantic-search-processing-steps {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.semantic-search-step {
  display: flex;
  align-items: center;
}

.semantic-search-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  position: relative;
}

.semantic-search-step-circle.step-completed {
  background: #1e40af;
  color: white;
}

.semantic-search-step-circle.step-processing {
  background: #1e40af;
  color: white;
}

.semantic-search-step-circle.step-pending {
  background: #d1d5db;
  border: 2px solid #9ca3af;
}

.semantic-search-spinner {
  width: 16px;
  height: 16px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.semantic-search-status-text {
  text-align: center;
  color: #1e40af !important;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* Process Button */
.semantic-search-process-btn {
  width: 100%;
  background: #0284c7;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2);
  letter-spacing: 0.01em;
}

.semantic-search-process-btn:hover {
  background: #0369a1;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
  transform: translateY(-1px);
}

.semantic-search-process-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Index Ready Section */
.semantic-search-index-ready {
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e5e7eb;
}

.semantic-search-index-ready-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.semantic-search-index-ready-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 180px;
  overflow-y: auto;
}

.semantic-search-index-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0.75rem;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 6px;
  font-size: 0.8125rem;
  transition: all 0.2s;
}

.semantic-search-index-item:hover {
  background: #f1f5f9;
  border-color: rgba(30, 64, 175, 0.3);
}

.semantic-search-index-item-name {
  color: #374151;
  font-weight: 500;
}

.semantic-search-index-item-status {
  color: #6b7280;
  font-size: 0.85rem;
}

.semantic-search-index-item-status.done {
  color: #1e40af;
  font-weight: 600;
}

/* Search Bar */
.semantic-search-search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  position: sticky;
  top: 44px;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.3rem 0;
  z-index: 1;
}

.semantic-search-search-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.semantic-search-search-icon {
  position: absolute;
  left: 1rem;
  color: #9ca3af;
  font-size: 1.2rem;
  pointer-events: none;
}

.semantic-search-search-input {
  width: 100%;
  padding: 0.5rem 0.6rem 0.5rem 2.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.85rem;
  background: white;
  color: #0f172a;
  font-weight: 400;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.semantic-search-search-input:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.2);
  transform: translateY(-1px);
}

.semantic-search-search-button {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.semantic-search-search-button:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.35);
  transform: translateY(-1px);
}

.semantic-search-search-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Search Results Container */
.semantic-search-results-container {
  margin-top: 0.5rem;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.semantic-search-summary {
  background: #f8fafc;
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08);
}

.semantic-search-summary-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1e40af;
  margin-bottom: 0.5rem;
}

.semantic-search-summary-body {
  font-size: 0.88rem;
  color: #0f172a;
  line-height: 1.5;
}

.semantic-search-results-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

/* Result Cards */
.semantic-search-result-card-new {
  background: white;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.2s;
}

.semantic-search-result-card-new:hover {
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.15);
  border-color: rgba(30, 64, 175, 0.3);
}

/* Scrollable results grid - vertical and horizontal scroll */
.semantic-search-grid-wrapper {
  overflow-x: scroll;   /* always-visible horizontal scrollbar */
  overflow-y: auto;
  flex: 1;              /* fill remaining height in the flex column */
  min-height: 120px;
  /* no max-height — the panel height constrains it, keeping scrollbar at bottom */
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  display: block;
  margin-top: 0.5rem;
}

/* Style the always-visible horizontal scrollbar */
.semantic-search-grid-wrapper::-webkit-scrollbar {
  height: 10px;
  width: 8px;
}
.semantic-search-grid-wrapper::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 0 0 6px 6px;
}
.semantic-search-grid-wrapper::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 10px;
  border: 2px solid #f1f5f9;
}
.semantic-search-grid-wrapper::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.semantic-search-grid-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 0.8125rem;
}

.semantic-search-grid-th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.semantic-search-grid-td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: top;
}

.semantic-search-grid-tr:hover .semantic-search-grid-td {
  background: #f8fafc;
}

.semantic-search-grid-match {
  font-weight: 600;
  color: #1e40af;
  min-width: 4rem;
}

.semantic-search-grid-td-long {
  max-width: 280px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.semantic-search-result-source {
  font-size: 0.8125rem;
  color: #64748b;
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.semantic-search-result-match-badge {
  display: inline-block;
  background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
  color: white;
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 3px rgba(30, 64, 175, 0.3);
  letter-spacing: 0.01em;
}

.semantic-search-result-snippet {
  color: #1e293b;
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.semantic-search-result-category {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.5rem;
  font-weight: 400;
}

.semantic-search-sidebar-section {
  margin-bottom: 2rem;
}

.semantic-search-sidebar-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.semantic-search-status-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.semantic-search-status-item:last-child {
  border-bottom: none;
}

.semantic-search-status-label {
  font-size: 0.85rem;
  opacity: 0.7;
}

.semantic-search-status-value {
  font-size: 1.1rem;
  font-weight: bold;
  margin-top: 0.25rem;
}

/* Column Selection Styles */
.semantic-search-columns-container {
  max-height: 140px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.4rem;
  margin-bottom: 0.25rem;
}

.semantic-search-column-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.2rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  transition: all 0.2s;
}

.semantic-search-column-item:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.semantic-search-column-item:last-child {
  margin-bottom: 0;
}

.semantic-search-column-item input[type="checkbox"] {
  accent-color: #3b82f6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .semantic-search-container {
    flex-direction: column;
    height: auto;
    margin-top: 120px; /* Account for navbar + banner on mobile */
    min-height: calc(100vh - 120px);
  }

  .semantic-search-wip-banner {
    top: 70px; /* Account for smaller navbar on mobile */
  }

  .semantic-search-nav-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .semantic-search-nav-items {
    flex-direction: row;
    overflow-x: auto;
  }

  .semantic-search-nav-item {
    min-width: 150px;
    border-left: none;
    border-bottom: 3px solid transparent;
  }

  .semantic-search-nav-item.active {
    border-left: none;
    border-bottom-color: white;
  }

  .semantic-search-app-container {
    grid-template-columns: 1fr;
  }

  .semantic-search-left-panel,
  .semantic-search-middle-panel,
  .semantic-search-right-panel {
    width: 100%;
  }

  .semantic-search-column-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .semantic-search-column-item > div:last-child {
    width: 100%;
    justify-content: space-between;
  }

  .semantic-search-landing-features {
    grid-template-columns: 1fr;
  }
}

/* Help Modal Styles */
.semantic-search-help-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  overflow-y: auto;
}

.semantic-search-help-modal.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.semantic-search-help-modal-content {
  background: #ffffff;
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.semantic-search-help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 12px 12px 0 0;
}

.semantic-search-help-modal-header h2 {
  margin: 0;
  color: #1f2937;
  font-size: 1.5rem;
  font-weight: 700;
}

.semantic-search-help-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.semantic-search-help-close-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

.semantic-search-help-modal-body {
  padding: 2rem;
  color: #374151;
}

.semantic-search-help-section {
  margin-bottom: 2rem;
}

.semantic-search-help-section h3 {
  color: #1f2937;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.semantic-search-help-section p,
.semantic-search-help-section li {
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.semantic-search-help-section ol,
.semantic-search-help-section ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.semantic-search-help-example {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.semantic-search-help-example h4 {
  color: #1f2937;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.semantic-search-help-code {
  background: #1f2937;
  color: #10b981;
  padding: 0.75rem;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.4;
  margin-top: 0.5rem;
}

.semantic-search-help-modal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 0 0 12px 12px;
  text-align: right;
}

.semantic-search-help-close-btn-footer {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.semantic-search-help-close-btn-footer:hover {
  background: #2563eb;
}
/* Data Preview Table Styles - NO WRAPPING ENFORCED */
.semantic-search-preview-container {
  margin-top: 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 0.75rem;
  border: 1px solid rgba(2, 132, 199, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.semantic-search-preview-title-section {
  margin-bottom: 0.5rem;
}

.semantic-search-preview-title {
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.35rem 0;
}

.semantic-search-preview-subtitle {
  color: #475569;
  font-size: 0.8rem;
  margin: 0;
  line-height: 1.4;
}

.semantic-search-preview-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 350px;
  border: 1px solid rgba(2, 132, 199, 0.2);
  border-radius: 6px;
  background: #ffffff;
}

.semantic-search-preview-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
  table-layout: auto;
  min-width: 800px; /* Ensure minimum width for horizontal scroll */
}

.semantic-search-preview-thead {
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 10;
}

.semantic-search-preview-header-row {
  border-bottom: 2px solid #e2e8f0;
}

.semantic-search-preview-header {
  padding: 0.5rem 0.4rem;
  text-align: left;
  font-weight: 600;
  color: #1f2937 !important; /* Darker text for better visibility */
  background: #f8fafc !important; /* Light gray background for headers */
  border-right: 1px solid #e2e8f0;
  position: relative;
  cursor: col-resize;
  min-width: 110px;
  max-width: 300px;
  
  /* CRITICAL: Absolutely no text wrapping */
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-wrap: normal !important;
  word-break: normal !important;
}

.semantic-search-preview-header:last-child {
  border-right: none;
}

.semantic-search-preview-header:hover {
  background: #e2e8f0;
}

.semantic-search-preview-tbody {
  background: #ffffff;
}

.semantic-search-preview-row {
  border-bottom: 1px solid #e2e8f0;
  transition: background-color 0.2s ease;
}

.semantic-search-preview-row:hover {
  background: #f1f5f9;
}

.semantic-search-preview-row:last-child {
  border-bottom: none;
}

.semantic-search-preview-cell {
  padding: 0.4rem 0.4rem;
  border-right: 1px solid #e2e8f0;
  color: #1f2937 !important; /* Darker text for better visibility */
  background-color: #ffffff !important; /* White background for cells */
  font-size: 0.875rem;
  min-width: 120px;
  max-width: 300px;
  
  /* CRITICAL: Absolutely no text wrapping - each record must be one line */
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-wrap: normal !important;
  word-break: normal !important;
  line-height: 1.2 !important;
}

.semantic-search-preview-cell:last-child {
  border-right: none;
}

.semantic-search-preview-cell:hover {
  background: rgba(59, 130, 246, 0.1);
  cursor: pointer;
  position: relative;
}

/* Tooltip for full content on hover */
.semantic-search-preview-cell:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Column resize handle */
.semantic-search-preview-header::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  cursor: col-resize;
  z-index: 1;
}

.semantic-search-preview-header:hover::after {
  background: rgba(59, 130, 246, 0.3);
}

/* Ensure table cells maintain strict no-wrap even with long content */
.semantic-search-preview-table * {
  white-space: nowrap !important;
  word-wrap: normal !important;
  word-break: normal !important;
}

/* Scrollbar styling for table wrapper */
.semantic-search-preview-table-wrapper::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.semantic-search-preview-table-wrapper::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.semantic-search-preview-table-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.semantic-search-preview-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
/* Help Button Styles */
.semantic-search-help-btn {
  background: #0284c7;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.semantic-search-help-btn:hover {
  background: #0369a1;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
  transform: translateY(-2px);
}

.semantic-search-help-btn:active {
  transform: translateY(0);
}

/* Panel Header with Help Button */
.semantic-search-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(2, 132, 199, 0.2);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  z-index: 2;
}

.semantic-search-panel-header .semantic-search-panel-title {
  margin: 0;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Column Filter Styles */
.semantic-search-header-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.semantic-search-header-text {
  font-weight: 600;
  color: #1f2937 !important; /* Dark text for better visibility */
  font-size: 0.875rem;
}

.semantic-search-column-filter {
  width: 100%;
  padding: 0.375rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  background: #ffffff !important; /* White background for filter inputs */
  color: #1f2937 !important; /* Dark text for better visibility */
  font-size: 0.75rem;
  transition: all 0.2s;
}

.semantic-search-column-filter::placeholder {
  color: #6b7280 !important; /* Gray placeholder text */
  font-size: 0.75rem;
}

.semantic-search-column-filter:focus {
  outline: none;
  border-color: #3b82f6;
  background: #ffffff !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.semantic-search-filter-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.semantic-search-filter-status {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  font-style: italic;
  display: none;
}

/* Adjust preview header height for filter inputs */
.semantic-search-preview-header {
  padding: 0.75rem 0.5rem;
  vertical-align: top;
  min-height: 4rem;
}

/* Ensure table cells have proper data attributes for filtering */
.semantic-search-preview-cell[data-column] {
  position: relative;
}

/* Responsive adjustments for filters */
@media (max-width: 768px) {
  .semantic-search-column-filter {
    font-size: 0.7rem;
    padding: 0.25rem 0.375rem;
  }
  
  .semantic-search-header-content {
    gap: 0.375rem;
  }
  
  .semantic-search-filter-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}
/* Click-to-search functionality */
.semantic-search-clickable-cell {
  cursor: pointer !important;
  transition: background-color 0.2s ease;
  position: relative;
}

.semantic-search-clickable-cell:hover {
  background-color: rgba(59, 130, 246, 0.1) !important;
}

.semantic-search-clickable-cell:hover::after {
  content: "Click to search";
  position: absolute;
  bottom: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
}

.semantic-search-clickable-cell:active {
  background-color: rgba(59, 130, 246, 0.2) !important;
  transform: scale(0.98);
}

/* Ensure table cells have proper spacing for tooltips */
.semantic-search-preview-table {
  position: relative;
}

.semantic-search-preview-tbody {
  position: relative;
}

/* Copy feedback animation */
@keyframes fadeInOut {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}

#semantic-search-copy-feedback {
  animation: fadeInOut 2s ease-in-out;
}