* Enhanced Card Styles */
.judgment-card {
  background: rgb(var(--color-bg-secondary));
  transition: all 0.3s ease;
}

.judgment-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgb(var(--color-primary) / 0.3);
}

.judgment-card.card-expanded {
  box-shadow: var(--shadow-xl);
  height: auto;
  min-height: auto;
}


/* Section Titles */
.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: rgb(var(--color-text-primary, 15 23 42));
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.content-box {
  background: rgb(var(--color-bg-primary));
  border: 1px solid rgb(var(--color-border));
  border-radius: 0.5rem;
  padding: 1rem;
}

.content-section {
  margin-bottom: 1.5rem;
}

.content-section:last-child {
  margin-bottom: 0;
}

/* Headnotes Preview */
.headnotes-preview-content {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Documents Grid */
.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
}

.document-links-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  transition: all 0.2s ease-in-out;
  gap: 0.25rem;
}

.document-links-container:hover {
  background: rgb(var(--color-bg-secondary, 249 250 251));
  border-color: rgb(var(--color-primary, 59 130 246) / 0.3);
}

.document-links-item {
  font-size: 1.25rem;
  line-height: 1;
}

.document-title {
  font-weight: 500;
  font-size: 0.875rem;
  color: rgb(var(--color-text-primary, 15 23 42));
}

.document-meta {
  font-size: 0.75rem;
  color: rgb(var(--color-text-secondary, 100 116 139));
}

/* Individual Judgment Styles */
.judgments-individual-title {
  font-size: 2rem;
  font-weight: 800;
  color: rgb(var(--color-text-primary));
  margin-top: 1rem;
  margin-bottom: 1rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.judgments-individual-meta {
  background-color: rgb(var(--color-bg-secondary));
  border-radius: 0;
  width: 100%;
  padding: 1rem;
}

.judgments-individual-meta-items {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}


/* Individual judgment meta section - now uses Tailwind classes */

/* Full-width Content Fields */
.judgments-individual-content-fields {
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.content-field {
  background: rgb(var(--color-bg-primary));
  border: 1px solid rgb(var(--color-border));
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.content-field-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: rgb(var(--color-text-primary));
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.content-field-value {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgb(var(--color-text-primary));
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Search snippets container */
.search-snippets-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Individual search match fragment styling */
.search-match-fragment {
  padding: 0.5rem 0.75rem;
  background: rgb(var(--color-bg-primary));
  border: 2px solid rgb(var(--color-primary) / 0.2);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
  line-height: 1.5;
  position: relative;
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
}

.search-match-fragment:hover {
  border-color: rgb(var(--color-primary) / 0.4);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

/* Add a clear indicator for each match */
.search-match-fragment::before {
  content: "🔍 Match";
  position: absolute;
  top: -0.5rem;
  right: 0.75rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: rgb(var(--color-primary));
  background: rgb(var(--color-bg-primary));
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  border: 2px solid rgb(var(--color-primary) / 0.2);
  box-shadow: var(--shadow-sm);
}

/* Add a subtle left border accent */
.search-match-fragment::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, rgb(var(--color-primary)), rgb(var(--color-primary) / 0.3));
  border-radius: 0.75rem 0 0 0.75rem;
}

/* Dark mode support */
.dark .search-match-fragment {
  background: rgb(var(--color-bg-tertiary));
  border-color: rgb(var(--color-primary) / 0.3);
}

.dark .search-match-fragment:hover {
  border-color: rgb(var(--color-primary) / 0.5);
}

.dark .search-match-fragment::before {
  background: rgb(var(--color-bg-tertiary));
  border-color: rgb(var(--color-primary) / 0.3);
  color: rgb(var(--color-primary));
}

.dark .search-match-fragment::after {
  background: linear-gradient(to bottom, rgb(var(--color-primary)), rgb(var(--color-primary) / 0.4));
}

/* Ellipsis indicators for truncated text */
.search-ellipsis {
  color: rgb(var(--color-text-secondary));
  font-style: italic;
  font-size: 0.875rem;
  margin: 0 0.25rem;
}

/* Global search highlight styling - used across all fields */
.search-highlight {
  background-color: rgb(var(--color-warning-light));
  color: rgb(var(--color-warning-dark));
  border-radius: 0.25rem;
  font-weight: normal;
  transition: all 0.2s ease;
}

.search-highlight:hover {
  background-color: rgb(var(--color-warning));
  color: rgb(255 255 255);
  transform: scale(1.02);
}

/* Dark mode support for search highlights */
.dark .search-highlight {
  background-color: rgb(var(--color-warning-dark));
  color: rgb(var(--color-warning-light));
}

.dark .search-highlight:hover {
  background-color: rgb(var(--color-warning));
  color: rgb(255 255 255);
}

/* Dark mode support */
.dark .search-match-separator {
  background: rgb(var(--color-bg-tertiary));
  border-color: rgb(var(--color-border));
}

.dark .search-ellipsis {
  color: rgb(var(--color-text-secondary));
}

* Match explanation styling */
.match-explanation {
  background-color: rgba(59, 130, 246, 0.1);
  border-left: 3px solid rgb(59, 130, 246);
}

.match-explanation .info-label {
  color: rgb(59, 130, 246);
}

.match-explanation .info-value {
  color: rgb(59, 130, 246);
  font-style: italic;
}

.search-configuration-container {
  width: 100%;
  max-width: none;
  margin-top: 1rem;
}

.search-config-header {
  background-color: rgb(var(--color-bg-tertiary));
  transition: all var(--transition-normal);
}

.search-config-header:hover {
  background-color: rgb(var(--color-bg-secondary));
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.search-config-content {
  background-color: rgb(var(--color-bg-primary));
  border: 1px solid rgb(var(--color-border));
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Use btn-filter styling for consistency */
.search-preset-btn,
.search-scope-button,
.search-source-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgb(var(--color-border));
  border-radius: 0.5rem;
  background-color: rgb(var(--color-bg-primary));
  color: rgb(var(--color-text-primary));
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: center;
  width: 100%;
}

.search-preset-btn {
  flex-direction: column;
  min-height: 4rem;
}

.search-scope-button,
.search-source-button {
  text-align: left;
}

.search-preset-btn:hover,
.search-scope-button:hover,
.search-source-button:hover {
  border-color: rgb(var(--color-primary));
  background-color: rgb(var(--color-bg-tertiary));
  color: rgb(var(--color-primary));
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.search-preset-btn.active,
.search-scope-button.active,
.search-source-button.active {
  border-color: rgb(var(--color-primary));
  background-color: rgb(var(--color-primary));
  color: rgb(var(--color-text-inverse));
}

.scope-text,
.source-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.search-toggle-button {
  padding: 0.25rem 0.75rem;
  border: 1px solid rgb(var(--color-border));
  border-radius: 1rem;
  background-color: rgb(var(--color-bg-primary));
  color: rgb(var(--color-text-primary));
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  min-width: 3rem;
}

.search-toggle-button:hover {
  border-color: rgb(var(--color-primary));
  background-color: rgb(var(--color-bg-tertiary));
  color: rgb(var(--color-primary));
}

.search-toggle-button.active {
  border-color: rgb(var(--color-primary));
  background-color: rgb(var(--color-primary));
  color: rgb(var(--color-text-inverse));
}

/* Visual state based on input state using :has() */
.search-scope-button:has(input:checked), 
.search-source-button:has(input:checked), 
.search-preset-btn:has(input:checked) {
  border-color: rgb(var(--color-primary));
  background-color: rgb(var(--color-primary));
  color: rgb(var(--color-text-inverse));
}

/* Match reason styling */
.match-reason-content {
  white-space: pre;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.4;
  color: rgb(var(--color-text));
}