/* 
 * Verification Page Styling
 * This dedicated stylesheet ensures proper rendering of content with attributions
 * 
 * This stylesheet addresses several issues with the original verification page:
 * 1. Line break handling: Uses white-space: pre-wrap to preserve line breaks in content
 * 2. Tooltip positioning: Improves tooltip visibility and ensures they stay within viewport
 * 3. Attribution styling: Uses consistent styling for attributed segments
 * 4. Debug panels: Adds collapsible debug panels for easier troubleshooting
 * 5. Responsive design: Ensures the page works well on different screen sizes
 * 
 * The styles are organized by component for easier maintenance.
 */

/* Page container */
.verification-page-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Section tabs */
.verification-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #e1e4e8;
}

.verification-tab {
  padding: 10px 16px;
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
  color: var(--color-text-primary);
  border-bottom: 2px solid transparent;
  margin-right: 8px;
}

.verification-tab.active {
  border-bottom-color: #f9826c;
  color: var(--color-text-primary);
  font-weight: 600;
}

/* Debug mode toggle */
.debug-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: #6a737d;
}

.debug-toggle input {
  margin-right: 8px;
}

/* Debug info panel */
.verification-debug-panel {
  margin-bottom: 20px;
  border: 1px solid #e1e4e8;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.verification-debug-header {
  padding: 16px;
  background-color: var(--color-bg-secondary);
  border-bottom: 1px solid #e1e4e8;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.verification-debug-header button {
  background-color: #fafbfc;
  border: 1px solid rgba(27,31,35,0.15);
  border-radius: var(--radius-md);
  padding: 5px 16px;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
}

.verification-debug-content {
  padding: 16px;
  background-color: var(--color-bg-secondary);
  overflow-x: auto;
}

.verification-debug-content pre {
  margin: 0;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-primary);
}

/* Main content area */
.verification-content-box {
  border: 1px solid #e1e4e8;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.verification-content-header {
  padding: 16px;
  background-color: var(--color-bg-secondary);
  border-bottom: 1px solid #e1e4e8;
  font-weight: 600;
}

.verification-content-body {
  padding: 16px;
  background-color: var(--color-bg-primary, #fff);
  line-height: 1.5;
  font-size: 16px;
}

/* Attribution styles */
.verification-content-display {
  white-space: pre-wrap !important;
  word-break: break-word !important;
  position: relative;
}

.verification-segment {
  position: relative;
  border-radius: 3px;
}

/* Normal unattributed text */
.verification-segment.unattributed {
  display: inline;
}

/* Attributed text */
.verification-segment.attributed {
  position: relative;
  display: inline;
  background-color: rgba(255, 230, 180, 0.2);
  border-bottom: 1px dashed #ffa726;
  cursor: pointer;
  padding: 0 2px;
  margin: 0 0;
  transition: background-color var(--transition-normal);
}

.verification-segment.attributed:hover {
  background-color: rgba(255, 230, 180, 0.6);
}

/* Paragraph styles */
.verification-content-display p {
  margin: 0 0 1em 0;
  display: block;
}

.verification-content-display p:last-child {
  margin-bottom: 0;
}

/* Line break handling */
.verification-content-display br {
  display: block !important;
  content: "" !important;
  margin-bottom: 1em !important;
}

/* Attribution tooltip */
.attribution-tooltip {
  position: absolute;
  z-index: 1000;
  width: 280px;
  background-color: var(--color-bg-primary, #fff);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  border-radius: var(--radius-sm);
  padding: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.attribution-tooltip.visible {
  opacity: 1;
  pointer-events: auto;
}

.attribution-tooltip-header {
  padding: 8px 12px;
  background-color: var(--color-bg-secondary);
  border-bottom: 1px solid #e1e4e8;
  font-weight: 600;
  font-size: 14px;
}

.attribution-tooltip-content {
  padding: 8px 12px;
}

.attribution-tooltip-row {
  margin-bottom: 6px;
}

.attribution-tooltip-label {
  font-weight: 500;
  font-size: 12px;
  color: #6a737d;
}

.attribution-tooltip-value {
  font-size: 14px;
  color: var(--color-text-primary);
}

/* Source type colors */
.source-edit {
  color: var(--color-success);
}

.source-pull_request, .source-pull-request {
  color: #0366d6;
}

.source-original {
  color: #6f42c1;
}

/* Attribution summary */
.verification-attributions-summary {
  margin-top: 30px;
  display: none; /* Hidden by default, shown in debug mode */
}

.verification-attributions-summary h3 {
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
}

.attribution-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}

.attribution-summary-table th {
  text-align: left;
  padding: 8px 16px;
  border-bottom: 1px solid #e1e4e8;
  font-size: 14px;
  font-weight: 600;
}

.attribution-summary-table td {
  padding: 8px 16px;
  border-bottom: 1px solid #e1e4e8;
  font-size: 14px;
}

.attribution-summary-table tr:nth-child(even) {
  background-color: var(--color-bg-secondary);
}

/* Code representation for debugging */
.html-preview {
  margin-top: 30px;
  border: 1px solid #e1e4e8;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: none; /* Hidden by default, shown in debug mode */
}

.html-preview-header {
  padding: 10px 16px;
  background-color: var(--color-bg-secondary);
  border-bottom: 1px solid #e1e4e8;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.html-preview-content {
  padding: 16px;
  background-color: var(--color-bg-secondary);
  overflow-x: auto;
  max-height: 400px;
}

.html-preview-content pre {
  margin: 0;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.html-preview-content code {
  color: var(--color-text-primary);
}

/* Color coding for HTML preview */
.tag {
  color: #22863a;
}

.attribute {
  color: #6f42c1;
}

.value {
  color: #032f62;
}

.text {
  color: var(--color-text-primary);
}

/* Raw Data Table Styles */
.raw-data-section {
  margin-bottom: 30px;
  overflow-x: auto;
}

.raw-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 20px;
  background-color: var(--color-bg-primary, #fff);
}

.raw-data-table th {
  background-color: var(--color-bg-tertiary);
  padding: 10px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--color-border-primary);
  position: sticky;
  top: 0;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.raw-data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border-primary);
  vertical-align: top;
}

.raw-data-table tr:nth-child(even) {
  background-color: #f8f8f8;
}

.raw-data-table tr:hover {
  background-color: #f0f7fa;
}

.partition-content {
  max-width: 300px;
  max-height: 150px;
  overflow: auto;
  white-space: pre-wrap;
  margin: 0;
  font-family: monospace;
  font-size: 12px;
  background-color: var(--color-bg-secondary);
  padding: 5px;
  border-radius: 3px;
}

/* Raw Data Action Buttons */
.raw-data-actions {
  margin-bottom: 15px;
  display: flex;
  gap: 10px;
}

.raw-data-actions button {
  padding: 6px 12px;
  background-color: #607d8b;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
}

.raw-data-actions button:hover {
  background-color: #455a64;
}

.raw-data-actions button:active {
  background-color: #37474f;
}
