/* tab-benchmark.css with improved compact radar layout */

/* Inherit styles from tab-search.css for consistency */
.search-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.search-ui-container {
    font-family: Arial, sans-serif;
    width: 48%;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: #f9f9f9;
}

/* Wizard Panel - Fix the padding issues and make more compact */
.wizard-panel {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 6px;
    /* Remove the padding-top and handle spacing differently */
    padding: 0;
    /* Additional styles to ensure content flows correctly */
    display: flex;
    flex-direction: column;
}

/* Header styling with proper spacing - more compact */
.step-header {
    position: relative; /* Change from absolute to relative */
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    padding: 6px 10px; /* Reduced padding */
    border-bottom: 1px solid #ddd;
    border-radius: 6px 6px 0 0;
    margin-bottom: 0; /* Ensure no gap between header and content */
}

/* Content area needs padding now that header is part of normal flow - more compact */
.wizard-panel > p,
.wizard-panel > form,
.wizard-panel > .upload-area,
.wizard-panel > .or-separator,
.wizard-panel > .search-ui-form-group {
    padding: 8px 10px; /* Reduced padding */
    margin-top: 0;
    margin-bottom: 5px; /* Add smaller bottom margin for compact spacing */
}

/* First element after header needs extra padding - but less than before */
.wizard-panel > p:first-of-type {
    padding-top: 8px; /* Reduced padding */
}

/* Fix for upload areas inside wizard panel - more compact */
.wizard-panel .upload-area {
    margin: 5px 10px;
    width: calc(100% - 20px);
    padding: 15px; /* Reduced padding */
}

.search-ui-form-group {
    margin-bottom: 10px; /* Reduced margin */
}

.search-ui-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--dark);
}

.search-ui-select {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-size: 1rem;
}

.search-ui-checkbox-container {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px;
    margin-top: 5px;
    background-color: #fff;
}

.search-ui-checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px;
}

.search-ui-checkbox-item:nth-child(odd) {
    background-color: white;
}

.search-ui-checkbox-item:nth-child(even) {
    background-color: #f0f0f0;
}

.search-ui-checkbox-item label {
    order: 1;
    font-weight: normal;
    margin: 0;
    flex-grow: 1;
}

.search-ui-checkbox-item input[type="checkbox"] {
    order: 2;
    margin-left: 5px;
}

.search-ui-hidden {
    display: none;
}

.search-ui-selection-summary {
    margin-top: 15px;
    font-weight: bold;
    color: var(--accent);
}

.search-ui-reset-button {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    color: #333;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    padding: 2px 8px;
    transition: all 0.2s ease;
}

.search-ui-reset-button:hover {
    background-color: #e0e0e0;
    border-color: #999;
}

.search-ui-pre {
    background-color: #fff;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    border: 1px solid #eee;
    font-family: monospace;
}

/* Benchmark-specific styles */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 4px;
    padding: 30px;
    text-align: center;
    background-color: var(--light);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.upload-area:hover {
    border-color: var(--dark-green);
    background-color: var(--light-green);
}

.upload-area p {
    margin-bottom: 15px;
    color: var(--medium-gray);
}

/* Progress Bar Styles - Simplified and fixed */
.benchmark-progress-container {
    margin-bottom: 12px; /* Reduced margin */
    padding: 10px; /* Reduced padding */
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.benchmark-progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
}

.benchmark-progress-bar::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #dee2e6;
    z-index: 0;
}

.progress-segment {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.progress-indicator {
    width: 30px; /* Smaller size */
    height: 30px; /* Smaller size */
    background-color: #f8f9fa;
    border: 2px solid #6c757d; /* Thinner border */
    border-radius: 50%;
    margin-bottom: 6px; /* Reduced margin */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #6c757d;
    font-size: 1rem; /* Smaller font */
}

.progress-segment.complete .progress-indicator {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.progress-label {
    font-size: 0.9rem;
    font-weight: bold;
    color: #6c757d;
    text-align: center;
}

.progress-segment.complete .progress-label {
    color: #28a745;
}

/* Fix step number styling */
.step-number {
    background-color: #6c757d;
    color: white;
    width: 24px; /* Smaller size */
    height: 24px; /* Smaller size */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 8px; /* Reduced margin */
    flex-shrink: 0;
    font-size: 0.9rem; /* Smaller font */
}

.step-header h3 {
    margin: 0;
    font-size: 1rem; /* Smaller font */
    flex-grow: 1;
}

.step-status {
    margin-left: auto;
    font-size: 0.9em;
    padding: 3px 8px;
    border-radius: 12px;
    background-color: #f8d7da;
    color: #721c24;
    flex-shrink: 0;
}

.step-status.complete {
    background-color: #d4edda;
    color: #155724;
}

.optional-step {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Second step header in middle panel - more compact */
.wizard-panel .step-header:nth-of-type(2) {
    margin-top: 10px; /* Reduced margin */
    border-top: 1px solid #ddd;
    border-radius: 0;
}

/* Completion markers */
.completion-marker {
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #721c24;
    opacity: 0.5;
    z-index: 5;
}

.completion-marker.complete {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
    opacity: 1;
}

.checkmark {
    opacity: 0;
}

.completion-marker.complete .checkmark {
    opacity: 1;
}

/* Fix for position relative elements */
.upload-area, 
.search-ui-form-group {
    position: relative;
}

/* Global submit container */
.global-submit-container {
    text-align: center;
    margin: 20px 0;
}

#benchmark-submit-button {
    padding: 10px 20px;
    font-size: 16px;
}

#benchmark-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Fixed OR separator */
.or-separator {
    text-align: center;
    margin: 15px;
    position: relative;
}

.or-separator:before, .or-separator:after {
    content: "";
    display: inline-block;
    width: 20%;
    height: 1px;
    background: #ccc;
    vertical-align: middle;
    margin: 0 10px;
}

.or-separator span {
    display: inline-block;
    background: #f9f9f9;
    padding: 0 10px;
    color: #666;
    font-weight: bold;
}

/* Required upload styling */
.required-upload {
    border-color: #e74c3c !important;
}

.required-upload p strong {
    color: #e74c3c;
}

/* Reference files list */
#reference-files-list {
    font-size: 0.9em;
    margin-top: 10px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    border-bottom: 1px solid #eee;
}

.remove-file {
    color: #e74c3c;
    cursor: pointer;
}

/* Disabled feature selection state */
.disabled {
    opacity: 0.6;
    pointer-events: none;
    background-color: #f0f0f0;
}

.disabled::after {
    content: "Feature selection disabled when file is uploaded";
    display: block;
    text-align: center;
    color: #666;
    margin-top: 10px;
    font-style: italic;
}

/* Status message styling for shared container */
.benchmark-status {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    font-size: 1.1rem;
}

.benchmark-status-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.benchmark-status-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Reference pair side-by-side */
.reference-pair {
  margin-bottom: 15px;
}
.reference-pair .upload-pair {
  display: flex;
  gap: 10px;
}
.reference-pair .upload-area {
  flex: 1;
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 4px;
  padding: 20px;
  text-align: center;
  background-color: var(--light);
  cursor: pointer;
}
.reference-pair .upload-area p {
  margin-bottom: 10px;
  color: var(--medium-gray);
}
.reference-pair .filename {
  margin-top: 8px;
  font-size: 0.9em;
  color: var(--dark);
  word-break: break-all;
}

/* Add-button */
#add-reference-btn {
  margin-top: 10px;
}

/* Results container styling */
#benchmark-results-container {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 25px;
  margin-top: 30px;
}

#benchmark-results-container h3 {
  text-align: center;
  margin-bottom: 20px;
  color: #2c3e50;
  font-size: 1.5rem;
}

/* ----- COMPACT RADAR CHART STYLES ----- */
/* New compact layout container */
.compact-container {
  max-width: 1000px;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  box-sizing: border-box;
}

/* Top info box */
.info-box-top {
  background: #f1f8ff;
  border: 1px solid #cce5ff;
  border-radius: 4px;
  padding: 8px 15px;
  text-align: center;
  font-size: 14px;
  color: #0c5460;
  margin-bottom: 15px;
}

/* Protocol selector row */
.protocol-selector {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  background-color: #f8f9fa;
  margin-bottom: 15px;
}

.protocol-labels {
  display: flex;
  gap: 25px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Main content with legend and chart */
.radar-content {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
}

.legend-panel {
  width: 280px;
  padding: 15px;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
}

.legend-panel h4 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 14px;
  font-weight: bold;
}

.chart-container {
  flex: 1;
  height: 450px;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 10px;
  position: relative;
}

/* Enhanced legend rows */
.legend-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.legend-markers {
  display: flex;
  gap: 5px;
  min-width: 35px;
}

.legend-label {
  font-size: 13px;
  margin-left: 8px;
}

/* Markers and colors */
.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.your-protocol {
  background: rgba(54,162,235,0.5);
  border: 1px solid rgba(54,162,235,1);
}

.reference {
  background: rgba(255,99,132,0.5);
  border: 1px solid rgba(255,99,132,1);
}

.legend-marker {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  vertical-align: middle;
}

/* Protocol Markers */
.marker-pred-yours {
  background-color: #fff;
  border: 2px solid rgba(54,162,235,1);
}

.marker-expt-yours {
  background-color: rgba(30,120,190,1);
  border: none;
}

.marker-exceeds-yours {
  background-color: rgba(10,60,110,1);
  border: none;
}

.marker-below-yours {
  background-color: rgba(100,180,235,1);
  border: none;
}

/* Reference Markers */
.marker-pred-ref {
  background-color: #fff;
  border: 2px solid rgba(255,99,132,1);
}

.marker-expt-ref {
  background-color: rgba(255,99,132,1);
  border: none;
}

.marker-exceeds-ref {
  background-color: rgba(180,50,80,1);
  border: none;
}

.marker-below-ref {
  background-color: rgba(255,170,192,1);
  border: none;
}

/* Next Reference button */
#regenerateBtn {
  background: #3498db;
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

#regenerateBtn:hover {
  background: #2980b9;
}

/* Transitions */
#refLabel {
  transition: opacity 0.3s ease;
}

/* Responsive adjustments for compact layout */
@media (max-width: 900px) {
  .radar-content {
    flex-direction: column;
  }
  
  .legend-panel {
    width: 100%;
    margin-bottom: 15px;
  }
  
  .protocol-selector {
    flex-direction: column;
    gap: 10px;
  }
  
  .protocol-labels {
    width: 100%;
    justify-content: space-around;
  }
  
  .chart-container {
    height: 350px;
  }
}

@media (max-width: 600px) {
  .protocol-labels {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  
  .legend-row {
    margin-bottom: 10px;
  }
  
  .info-box-top {
    font-size: 12px;
  }
}

/* Make the container fill more width */
.compact-container {
  max-width: 100%;
  width: 100%;
  padding: 10px;
  margin: 0;
}

/* Adjust the info box to be more compact */
.info-box-top {
  margin-bottom: 10px;
  padding: 6px 10px;
}

/* Make protocol selector more compact */
.protocol-selector {
  padding: 8px 10px;
  margin-bottom: 10px;
}

/* Optimize the legend and chart layout */
.radar-content {
  gap: 15px;
}

/* Make legend panel narrower */
.legend-panel {
  width: 220px;
  padding: 10px;
  flex-shrink: 0;
}

/* Increase chart size */
.chart-container {
  flex: 1;
  height: 550px; /* Taller chart */
  min-width: 70%; /* Ensure chart takes at least 70% of the width */
}

/* Make legends more compact */
.legend-row {
  margin-bottom: 8px;
}

/* Optimize the overall layout */
#benchmark-results-container {
  padding: 15px;
}

/* Remove extra margin around header */
#benchmark-results-container h3 {
  margin-bottom: 10px;
}

/* Optimize for larger screens */
@media (min-width: 1200px) {
  .chart-container {
    height: 650px; /* Even taller on large screens */
  }
  
  .legend-panel {
    width: 250px; /* Slightly wider on large screens */
  }
}

/* Ensure chart fills the space horizontally */
canvas#maturityChart {
  width: 100% !important;
  height: 100% !important;
}

/* Category legend section */
.category-legend {
  margin-top: 20px;
  border-top: 1px solid #e9ecef;
  padding-top: 15px;
}

.category-legend h4 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: bold;
}

.category-legend-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-icon {
  font-size: 12px;
  width: 20px;
  display: flex;
  justify-content: center;
}

.category-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

/* Adjust the legend panel width to accommodate category names */
.legend-panel {
  width: 250px;
  padding: 15px;
}

/* Chart container fills more space */
.chart-container {
  flex: 1;
  height: 550px; /* Taller chart */
  min-width: 70%; /* Ensure chart takes at least 70% of the width */
  padding: 20px;
}

/* Make the container fill more width */
.compact-container {
  max-width: 100%;
  width: 100%;
  padding: 10px;
  margin: 0;
}

/* Ensure chart fills the space horizontally */
canvas#maturityChart {
  width: 100% !important;
  height: 100% !important;
}

/* Responsive adjustments for category legend */
@media (max-width: 900px) {
  .category-legend-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  
  .legend-panel {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .category-legend-items {
    display: flex;
    flex-direction: column;
  }
}